Link association method and link association system based on service discovery
Through the link association method based on service discovery, a multi-dimensional link list between services in the microservice architecture is constructed, which solves the problems of service failure location and troubleshooting in the microservice architecture, and realizes efficient link generation and monitoring, reducing costs.
Patent Information
- Application Number
- CN202510357063.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-06-27
Smart Images

Figure CN120216318A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of big data processing, and in particular, to a link association method and a link association system based on service discovery. Background Art
[0002] With the continuous development of cloud computing, big data, and microservices architecture, it has brought new development directions for platform integration and provided convenience for aspects such as modularization and rapid iteration of services. The microservices architecture is to divide the monolithic service facing users into modules with clear functional boundaries. Each module is independent and tiny, and lightweight protocols are used for communication and scheduling between each other, and finally form a service set of a complete application.
[0003] The microservices architecture brings convenience to the operation and maintenance and deployment of individual modules. However, when there are exceptions or failures in the service, there are problems such as difficult positioning, difficult troubleshooting, and unclear call links. It is difficult to quickly stop losses when a failure occurs. This series of problems will become more and more intractable as the number of modules increases. Therefore, a system for generating microservice link relationships with good maintainability and low implementation cost is needed to monitor and generate links for all microservice modules.
[0004] Currently, to solve such problems, mainly by using a unified framework and a logging module, print the access information required by all services into the log, collect the data to the data processing terminal through the log collection module, and use the computing module to concatenate the entire access link with the globally unique traceID or span identifier generated in the log. However, this technology has the characteristics of using more resources, higher maintainability and transformation costs, and is more difficult to implement. Summary of the Invention
[0005] In view of this, embodiments of the present invention provide a link association method and a link association system based on service discovery to improve the convenience of service association.
[0006] According to an aspect of the present invention, there is provided a link association method based on service discovery, which is applied to a link association system. The method includes:
[0007] Obtain an information acquisition request sent by a first service, where the information acquisition request includes the first service identifier and a second service identifier, and the second service is the service requested by the first service;
[0008] Based on the second service identifier, find the target service information of the corresponding second service in the preset service information, and return the target service information to the first service; the target service information includes a port and instance information;
[0009] Obtain the call request of the first service for the second service and the call reception request of the second service for the first service, and store the call request and the call reception request correspondingly;
[0010] Based on the correspondingly stored call request and call reception request, construct a multi-dimensional association linked list among services, where the multi-dimensional association linked list includes a service association linked list, an instance association linked list, and a port association linked list.
[0011] In a possible embodiment, the method further includes:
[0012] Receive the registration requests of each service, and store the service information corresponding to each service and the identifier of each service correspondingly, where the service information includes service instance information, instance computer room information, service ports, and the URL address for service registration;
[0013] Monitor the running status of each service, where the running status includes the instance running status, the availability status of ports and URL addresses.
[0014] In a possible embodiment, the method further includes:
[0015] Determine the available status of each instance running status, ports, and URL addresses included in the second service;
[0016] Return the available instances, ports, and URL addresses as target service information to the first service.
[0017] In a possible embodiment, the method further includes:
[0018] Perform data cleaning on the stored call request and call reception request, where the data cleaning includes incomplete request filtering, restart redundant request filtering, and duplicate request filtering;
[0019] The constructing a multi-dimensional association linked list among services based on the correspondingly stored call request and call reception request includes:
[0020] Based on the call request and call reception request after data cleaning, construct a multi-dimensional association linked list among services.
[0021] In a possible embodiment, the method further includes:
[0022] Store the edge nodes of each multi-dimensional association linked list, where the edge nodes are services that do not call other services;
[0023] Based on each edge node and a preset service call relationship, form each multi-dimensional association linked list into a global association linked list.
[0024] According to another aspect of the present invention, there is provided a link association system, the system comprising:
[0025] An acquisition module, configured to acquire an information acquisition request sent by a first service, wherein the information acquisition request includes the first service identifier and a second service identifier, and wherein the second service is the service requested by the first service;
[0026] A lookup module, configured to look up target service information of a corresponding second service in preset service information based on the second service identifier, and return the target service information to the first service; the target service information includes a port and instance information;
[0027] A storage module, configured to acquire a call request of the first service for the second service and a call reception request of the second service for the first service, and store the call request and the call reception request correspondingly;
[0028] An association module, configured to construct a multi-dimensional association linked list between services based on the correspondingly stored call request and call reception request, wherein the multi-dimensional association linked list includes a service association linked list, an instance association linked list, and a port association linked list.
[0029] In a possible embodiment, the system further comprises:
[0030] A registration module, configured to receive registration requests of each service, and store the service information corresponding to each service in correspondence with the identifier of each service, wherein the service information includes service instance information, instance computer room information, a service port, and a URL address for service registration;
[0031] A monitoring module, configured to monitor the running status of each service, and the running status includes an instance running status, availability status of a port, and a URL address.
[0032] In a possible embodiment, the system further comprises:
[0033] A screening module, configured to determine the available status of each instance running status, port, and URL address included in the second service; and return the available instances, ports, and URL addresses as target service information to the first service.
[0034] According to another aspect of the present invention, there is provided an electronic device, comprising:
[0035] A processor; and
[0036] A memory storing a program,
[0037] Wherein, the program includes instructions that, when executed by the processor, cause the processor to execute any one of the above-mentioned service discovery-based link association methods.
[0038] According to another aspect of the present invention, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute any one of the above-mentioned service discovery-based link association methods.
[0039] One or more technical solutions provided in the embodiments of the present invention receive an information acquisition request between services and return service information to the information acquisition request sender. After obtaining the call request selected by the caller based on the service information, an association relationship is established between the caller and the callee. The association relationship includes the called service information and the calling service information. A multi-dimensional association linked list between services is established based on the stored association relationships, including dimensions such as ports and instances. By recording the request relationships between services, the association linked list can be generated without excessive modification of the services, which is relatively convenient to implement. Moreover, the association linked list is constructed through the actual call relationships between services, improving the accuracy of generating the association relationship. After a faulty service appears, by inputting the faulty service, the overall affected range and the specific surrounding services affected can be observed to assist in fault location and resolution. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In the following description of exemplary embodiments in conjunction with the drawings, more details, features, and advantages of the present invention are disclosed. In the drawings:
[0041] Figure 1 is a schematic flowchart of a service discovery-based link association method provided by an embodiment of the present invention;
[0042] Figure 2 is a schematic system architecture diagram for implementing a service discovery-based link association method provided by an embodiment of the present invention;
[0043] Figure 3 is another schematic flowchart of a service discovery-based link association method provided by an embodiment of the present invention;
[0044] Figure 4 is a schematic logical structure diagram of a link association system provided by an embodiment of the present invention;
[0045] Figure 5 is a block diagram of the structure of an exemplary electronic device capable of implementing the embodiments of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0046] Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. On the contrary, these embodiments are provided to more thoroughly and completely understand the present invention. It should be understood that the drawings and embodiments of the present invention are only for exemplary purposes and are not used to limit the protection scope of the present invention.
[0047] It should be understood that the various steps described in the method embodiments of the present invention can be executed in a different order and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this regard.
[0048] As used herein, the term "including" and its variants are open-ended, that is, "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description. It should be noted that the concepts such as "first" and "second" mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0049] It should be noted that the modifications of "one" and "a plurality" mentioned in the present invention are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly specified in the context, it should be understood as "one or more".
[0050] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only for illustrative purposes and are not used to limit the scope of these messages or information.
[0051] In order to improve the efficiency and accuracy of building a service link, embodiments of the present invention provide a link association method, system, electronic device and storage medium based on service discovery. The link association method based on service discovery provided by the embodiments of the present invention can be applied to any electronic device with link association. The electronic device can be a computer, a server, a mobile terminal, etc. The solution of the present invention will be described below with reference to the accompanying drawings:
[0052] Figure 1 A flowchart of a link association method based on service discovery provided by an embodiment of the present invention may include the following steps:
[0053] S101. Obtain an information acquisition request sent by a first service, where the information acquisition request includes the first service identifier and a second service identifier, and the second service is the service requested by the first service;
[0054] S102. Based on the second service identifier, search for the target service information of the corresponding second service in the preset service information, and return the target service information to the first service; the target service information includes a port and instance information;
[0055] S103. Obtain a call request of the first service for the second service and a call reception request of the second service for the first service, and store the call request and the call reception request correspondingly;
[0056] S104. Based on the correspondingly stored call request and call reception request, construct a multi-dimensional association linked list between services, where the multi-dimensional association linked list includes a service association linked list, an instance association linked list, and a port association linked list.
[0057] Applying the embodiments of the present invention, by receiving information acquisition requests between services and returning service information to the sender of the information acquisition request, after obtaining a call request selected by the caller based on the service information, an association relationship between the caller and the callee is established. This association relationship includes call service information and called service information. Based on the stored association relationships, a multi-dimensional association linked list between services is established, including dimensions such as ports and instances. By recording the request relationships between services, an association linked list can be generated without excessive modification of the services, which is relatively convenient to implement. Moreover, by constructing the association linked list through the actual call relationships between services, the accuracy of generating the association relationship is improved. After a faulty service appears, by inputting the faulty service, the overall affected range and the specific surrounding services affected can be observed to assist in fault location and resolution.
[0058] The following is an exemplary description of the above S101 - S104:
[0059] The link association method based on service discovery provided by the embodiments of the present invention can be applied to a microservice architecture. Microservice is a software architecture style that is based on small functional blocks focusing on single responsibilities and functions, and uses a modular way to combine complex large-scale application programs. Each functional block is language-independent, and a simple URI is used to open interfaces behind complex services, and any service and any fine-grained entity can be opened. The above link association method based on service discovery can be used to establish the association relationship between services in a microservice architecture. Services in a microservice architecture are usually implemented through instances. Specifically, the services described in the present invention refer to a set of instance collections that provide the same function or method under a microservice architecture.
[0060] In a possible embodiment, a link association system can be built, and the above link association method based on service discovery can be implemented through this link association system. In this link association system, the link association of services can be performed by participating in the call process between services. Exemplarily, a service can request another service through this link association system.
[0061] In a possible embodiment, a service that needs to call other services (hereinafter referred to as the first service) can send an information acquisition request to the link association system. The information acquisition request can include a first service identifier, a second service identifier that the first service needs to call, etc. After receiving the information acquisition request, the link association system can search for the service information corresponding to the second service identifier from the stored service information based on the second service identifier included in the information acquisition request. The service information can include instance information, instance computer room information, service ports, service-registered URL (Uniform Resource Locator) address information, etc. included in the second service.
[0062] Among them, an instance refers to a separate service process in a microservices architecture. It provides specific business functions and communicates with other service processes through network interfaces. Microservice instances can be independently deployed and scaled, and can be horizontally scaled among multiple instances through load balancing or other mechanisms. The instance information can include the number of instances included in the service and the names of each instance, etc. The computer room information can include the geographical location of the computer room, the computer room identifier, etc. There can be multiple service-registered url addresses, and the url address corresponds to a specific instance. Each url address can include parameters such as a transport protocol, a hostname (the domain name or IP address of the service), a port number, and a path.
[0063] In a possible embodiment, before each service goes online and is put into use, the service information can be registered in the link association system. The link association system can store each service information corresponding to the service identifier. After receiving the information acquisition request sent by the first service, it can obtain the service information corresponding to the second service from the stored service identifier and the corresponding service information based on the second service identifier.
[0064] After the link association system finds the service information of the second service, it can return it to the first service, and the first service can select the required instance request based on the service information of the second service. In a possible embodiment, the link association system can continuously monitor the instance running status of each service and the available status of ports and URL addresses. Exemplarily, the link association system can monitor the running status of each registered service through corresponding monitoring tools and return the available instances, ports, and URL addresses to the first service as service information. Here, "available" means not occupied, having a normal running status, and being able to accept calls from other services.
[0065] In a possible embodiment, the link association system can store the record of this request. Exemplarily, it can store the first service information for sending this request, the second service information being requested, and the request time, etc. The above first service information can include the first service name, the first service instance name, etc.
[0066] In a possible embodiment, after the first service requests a target instance in the second service, the link association system can capture and record this request. Exemplarily, a request record reporting module can be added to each service process. After the first service requests the target instance, the corresponding process can report this request to the link association system, enabling the link association system to capture this request.
[0067] The link association system can record the service request of the first service to the second service. Exemplarily, it can associate the request of the first service to the second service and the request received by the second service and record it in the link association system to record a complete service request.
[0068] In a possible embodiment, the link association system can associate each service based on the recorded service requests and information acquisition requests to form one or more association linked lists. The number of these association linked lists can be determined according to the actual recorded service requests and information acquisition requests. Exemplarily, for each recorded service request, the two services included in the same service request can be associated to form an association linked list.
[0069] In a possible embodiment, the above association linked list can be a multi-dimensional linked list, which can include service names, instance names, ports, etc. That is, a multi-dimensional linked list can be formed for different levels or different types of information such as services, instances, and ports. By forming a multi-dimensional linked list, the comprehensiveness of the established service association relationship is improved, and thus the accuracy of subsequent fault location based on the association linked list is improved.
[0070] In a possible embodiment, the above association linked list can be stored in the linked list association system in the form of segmented storage of multi-level linked lists to form an upstream and downstream link display.
[0071] In a possible embodiment, after establishing the associated linked list, the edge nodes of each associated linked list can be stored. The edge node refers to a service that does not call other services. By based on the preset service call logic and each edge node, each local associated linked list can be composed into a global associated linked list to handle more fault location scenarios.
[0072] In practical applications, there are some non-service request records in the request information. Therefore, it is possible to combine the upstream information and the service registration information to authenticate whether the system exists, so as to exclude non-registered services, and at the same time filter redundant requests (such as retry requests). In a possible embodiment, the recorded service requests can be filtered before establishing the associated linked list, including filtering incomplete requests, filtering restart redundant requests, and filtering duplicate requests, etc. Among them, an incomplete request can be a service request that only includes the first service requesting the second service or a record that only contains the second service receiving the first service request. A restart redundant request is a mechanism in a distributed system that automatically forwards requests to a standby service (i.e., a redundant service) when the primary service fails or becomes unavailable.
[0073] In a possible embodiment, the above-mentioned link association system may include a service discovery system and a service association system. Among them, the service discovery system is used to register the service information of each service, monitor the running status of each service, and when receiving an information acquisition request of the first service, query the service information of the second service and return it to the first service, and when receiving a call request reported by a process, record the call request and store the call request and the call request received by the second service in an associated manner.
[0074] The service association system can obtain the request records from the service discovery system according to a preset protocol, and perform data cleaning and data association on the request records to obtain multiple associated lists.
[0075] As Figure 2 shown, Figure 2 FIG. is a schematic architecture diagram of a link association system provided by an embodiment of the present invention. The link association system can be implemented through a service discovery system and a service association system. Specifically, the link association system may include an associated data output layer, an associated data processing layer, an associated data storage layer, and an associated data storage layer. Among them, the associated data output layer takes the name service as the core and includes service registration, service discovery, and service request information recording capabilities.
[0076] Among them, service registration refers to registering service information into the service discovery system, including registering service name, service instance information, instance computer room information, service port, and service registration url information, etc. into the service discovery system. The service discovery system can store the service information of each registered service. Specifically, the service name can be stored corresponding to other information of the service.
[0077] Service discovery means that when the first service requests the second service, a call request will be sent to the link association system to request the instance information and url information needed, so as to request the second service according to the instance information and url information.
[0078] Service request information recording means that when the first service uses the second service identifier to obtain the instance and url information of the second service, the associated data production layer will temporarily store the request record in the file system.
[0079] The associated data processing layer is used to read the service request information record of the associated data production layer into the system, process the upstream and downstream information, and filter the read service discovery information to remove records that are not service discovery requests. The associated system processing system is used to associate the upstream and downstream services together and store them in the system in segments through a multi-level linked list to form an upstream and downstream link display. Specifically, it can include the following processes:
[0080] Service request information acquisition: An information acquisition protocol is agreed between the service association system and the service discovery system, and the service request information stored in the service discovery system is loaded into the service association system for processing through multiple instances of the distributed system requesting in a loop.
[0081] Information cleaning: As an open system, the service discovery system has some non-service request records in the request information. Therefore, it is possible to combine the upstream information and service registration information to authenticate whether the system exists, so as to exclude non-registered services, and at the same time filter redundant requests (such as retry requests).
[0082] Association relationship generation: Load the data after information cleaning, and use the upstream and downstream link information to generate multiple local link tables for storage. In multiple query cases, according to the input link depth, generate a link association relationship graph by connecting the head and tail of the link through the corresponding depth.
[0083] Fault speculation ability: When a fault occurs, the faulty service can be transmitted to the service association system, and the upstream and downstream association systems of the faulty service can be given through the link relationship system to determine the scope and impact surface of the associated services.
[0084] Query association relationship: When a query association relationship request is received, query the corresponding association relationship and return it.
[0085] The associated data storage layer is used to store the cleaning metadata of the link relationship system and the local link table data for upstream and downstream link service queries.
[0086] As Figure 3 shown, Figure 3 FIG. is another flowchart of the link association method based on service discovery provided by an embodiment of the present invention, which may include the following steps:
[0087] Step ①: Register the information of service A and service B in the service discovery system, including service name, service instance information, instance computer room information, service port, service registration url information, etc. Among them, service B includes instance a and instance b.
[0088] Step ②: Hang instances a and b to BNS (Block Native Store, a naming system for managing storage resources), and deploy and run.
[0089] Step ③: The service discovery system actively monitors whether the instances mounted on the BNS are available.
[0090] Step ④: Service A instance 1 requests the service discovery system to obtain the instance information of service B according to the BNS of service B, including IP information, port information, etc.
[0091] Step ⑤: The service discovery system returns the instance information to service A instance 1 and marks whether the instance is available. The service association system records the information of service A accessing service B, and at the same time records the service A instance information and access time and other information.
[0092] Step ⑥: Service A instance requests service B using the IP and port of the available instance. When the request reaches service B instance a, the process will report the request information. The service discovery system associates and records the request of service A to service B and the request received by service B, and at the same time makes a local record.
[0093] The service association system continuously obtains the latest complete record recorded by the service discovery system through the protocol agreement with the service discovery system, pulls back the data to the system through requests for data cleaning, removes dirty data such as incomplete requests and restart redundant requests, and de-duplicates the requests.
[0094] After de-duplication, the upstream and downstream information is sorted into a multi-dimensional linked list result and divided into multiple local multi-dimensional linked lists. And expose each edge node. When the system queries the upstream and downstream association relationship of the service, the upstream and downstream node relationships exposed are connected into a global access link relationship graph.
[0095] Applying the embodiments of the present invention, the upstream and downstream request information is recorded through service registration and service discovery methods, and the upstream and downstream information is cleaned and sorted by using a service association system, integrated into multiple local multi-dimensional linked lists and stored. After a faulty service appears, by inputting the faulty service, the overall affected scope and the specific surrounding services affected can be observed, assisting in fault location and resolution. When a local system fails, the upstream and downstream calls and the affected scope can be quickly identified, realizing fast fault handling and loss prevention.
[0096] Based on the same inventive concept, an embodiment of the present invention further provides a link association system, as Figure 4 shown. The system 400 may include:
[0097] An obtaining module 401, configured to obtain an information obtaining request sent by a first service, where the information obtaining request includes the first service identifier and a second service identifier, and the second service is the service requested by the first service;
[0098] A searching module 402, configured to search for target service information of a corresponding second service in preset service information based on the second service identifier, and return the target service information to the first service; the target service information includes a port and instance information;
[0099] A storage module 403, configured to obtain a call request of the first service for the second service and a call receiving request of the second service for the first service, and store the call request and the call receiving request correspondingly;
[0100] An association module 404, configured to construct a multi-dimensional association linked list between services based on the correspondingly stored call request and call receiving request, where the multi-dimensional association linked list includes a service association linked list, an instance association linked list, and a port association linked list.
[0101] In a possible embodiment, the system further includes:
[0102] A registration module, configured to receive registration requests of each service, and store the service information corresponding to each service and the identifier of each service correspondingly, where the service information includes service instance information, instance computer room information, service ports, and URL addresses for service registration;
[0103] A monitoring module, configured to monitor the running status of each service, where the running status includes instance running status, availability status of ports, and URL addresses.
[0104] In a possible embodiment, the system further includes:
[0105] A screening module, configured to determine the running status of each instance included in the second service, the availability status of ports, and the URL addresses; and return the available instances, ports, and URL addresses as target service information to the first service.
[0106] Wherein, the collection, storage, use, processing, transmission, provision, and disclosure of the user's personal information involved in the present invention all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.
[0107] An exemplary embodiment of the present invention further provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor. The memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, it is configured to cause the electronic device to execute the method according to the embodiment of the present invention.
[0108] An exemplary embodiment of the present invention further provides a non-transitory computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor of a computer, it is configured to cause the computer to execute the method according to the embodiment of the present invention.
[0109] An exemplary embodiment of the present invention further provides a computer program product, including a computer program, wherein when the computer program is executed by a processor of a computer, it is configured to cause the computer to execute the method according to the embodiment of the present invention.
[0110] Reference Figure 5 , the structural block diagram of an electronic device 500 that can be used as a server or a client of the present invention will now be described. It is an example of a hardware device that can be applied to various aspects of the present invention. The electronic device is intended to represent various forms of digital electronic computer devices, such as, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, a personal digital processor, a cellular phone, a smart phone, a wearable device, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0111] As Figure 5As shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to computer programs stored in a read-only memory (ROM) 502 or computer programs loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0112] Multiple components in the electronic device 500 are connected to the I / O interface 505, including: an input unit 506, an output unit 507, a storage unit 508, and a communication unit 509. The input unit 506 can be any type of device capable of inputting information into the electronic device 500. The input unit 506 can receive input digital or character information and generate key signal inputs related to user settings and / or function controls of the electronic device. The output unit 507 can be any type of device capable of presenting information and can include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 508 can include, but is not limited to, magnetic disks and optical discs. The communication unit 509 allows the electronic device 500 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks and can include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a BluetoothTM device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0113] The computing unit 501 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 501 executes the various methods and processes described above. For example, in some embodiments, any of the above-described service discovery-based link association methods can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 500 via the ROM 502 and / or the communication unit 509. In some embodiments, the computing unit 501 can be configured to execute any of the above-described service discovery-based link association methods in any other appropriate manner (e.g., by means of firmware).
[0114] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to the processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing devices, such that when the program codes are executed by the processor or controller, the functions / operations specified in the flowchart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, executed partially on the machine as an independent software package and partially on a remote machine, or executed entirely on a remote machine or server.
[0115] In the context of the present invention, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0116] As used in the present invention, the terms “machine-readable medium” and “computer-readable medium” refer to any computer program product, apparatus, and / or device (e.g., a disk, an optical disc, a memory, a programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term “machine-readable signal” refers to any signal for providing machine instructions and / or data to a programmable processor.
[0117] In order to provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0118] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.
[0119] A computer system can include clients and servers. Clients and servers are generally far apart from each other and typically interact through a communication network. The client - server relationship is created by computer programs running on the respective computers and having a client - server relationship with each other.
Claims
1. A link association method based on service discovery, characterized in that: Applied to a link association system, the method comprises: Obtaining an information acquisition request sent by a first service, wherein the information acquisition request includes the first service identifier and a second service identifier, wherein the second service is a service requested by the first service; Searching for target service information of the corresponding second service in the preset service information based on the second service identifier, and returning the target service information to the first service; the target service information includes port and instance information; Obtaining a call request by the first service for the second service and a call receiving request by the second service for the first service, and storing the call request and the call receiving request in correspondence; Based on the corresponding stored call requests and call reception requests, a multi-dimensional association linked list between services is constructed, wherein the multi-dimensional association linked list includes a service association linked list, an instance association linked list, and a port association linked list.
2. The method according to claim 1, characterized in that The method further comprises: Receive registration requests for each service, and store service information corresponding to each service and an identifier of each service in correspondence, wherein the service information includes service instance information, instance computer room information, service port, and URL address of service registration; The running status of each of the services is monitored, wherein the running status includes the instance running status, the port and the available status of the URL address.
3. The method according to claim 2, characterized in that The method further comprises: Determine the running status of each instance included in the second service, the available status of the port and the URL address; The available instance, port, and URL address are returned to the first service as target service information.
4. The method according to claim 1, characterized in that: The method further comprises: Performing data cleaning on stored call requests and call receiving requests, wherein the data cleaning includes filtering incomplete requests, filtering restart redundant requests, and filtering duplicate requests; The multi-dimensional association list between services is constructed based on the corresponding stored call request and call receiving request, including: Based on the call request and call receiving request after data cleaning, a multi-dimensional association list between services is constructed.
5. The method according to claim 1, characterized in that The method further comprises: storing edge nodes of each of the multi-dimensional association linked lists, the edge nodes being services that do not call other services; The multi-dimensional association linked lists are combined into a global association linked list based on the edge nodes and the preset service calling relationship.
6. A link association system, characterized in that: The system comprises: an acquisition module, configured to acquire an information acquisition request sent by a first service, wherein the information acquisition request includes the first service identifier and a second service identifier, wherein the second service is a service requested by the first service; A search module, configured to search for target service information of the corresponding second service in the preset service information based on the second service identifier, and return the target service information to the first service; the target service information includes port and instance information; A storage module, used to obtain a call request from the first service to the second service and a call reception request from the second service to the first service, and store the call request and the call reception request in correspondence; The association module is used to construct a multi-dimensional association list between services based on the corresponding stored call requests and call reception requests, wherein the multi-dimensional association list includes a service association list, an instance association list and a port association list.
7. The system according to claim 6, characterized in that The system further comprises: A registration module, used to receive registration requests for each service, and store service information corresponding to each service and the identifier of each service in correspondence, wherein the service information includes service instance information, instance computer room information, service port, and URL address of service registration; The monitoring module is used to monitor the running status of each of the services, wherein the running status includes the instance running status, the port and the available status of the URL address.
8. The system according to claim 6, characterized in that: The system further comprises: The screening module is used to determine the running status of each instance, port and URL address included in the second service, and return the available instance, port and URL address as the target service information to the first service.
9. An electronic device, comprising: processor; as well as Memory for storing programs, The program includes instructions, which, when executed by the processor, cause the processor to perform the method according to any one of claims 1 to 5.
10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to make a computer execute the method according to any one of claims 1-5.