Method and apparatus for managing service instance, device and medium
Patent Information
- Application Number
- CN202510865405.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2045-06-25
AI Technical Summary
[0010] According to one or more embodiments of this disclosure, the mapping relationship between service instances and databases can be accurately determined to more accurately manage the configuration resources of multiple service instances and multiple databases.
Smart Images

Figure CN120751006B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of big data technology, and more particularly to the field of database management and service instance management technology, specifically to a service instance management method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Technology
[0002] Large-scale distributed data systems typically include multiple databases and business product service instances that need to query and access data from multiple databases. To facilitate the management of data access from different business product service instances, a proxy service is usually used to receive data requests from the business product service instances and route them to the appropriate target database.
[0003] The methods described in this section are not necessarily methods that had been previously conceived or adopted. Unless otherwise specified, no method described in this section should be assumed to be prior art simply because it is included in this section. Similarly, unless otherwise specified, the issues mentioned in this section should not be considered to be accepted in any prior art. Summary of the Invention
[0004] This disclosure provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for managing service instances.
[0005] According to one aspect of this disclosure, a method for managing service instances is provided, comprising: obtaining multiple historical requests between the multiple service instances and the multiple databases based on logs of a proxy service used to route data requests from multiple service instances to multiple databases, wherein each historical request includes a dynamic address that sent the historical request and a target database; obtaining a request service instance corresponding to each historical request by querying device operation information corresponding to the dynamic address included in each historical request; determining a request time corresponding to each historical request based on the logs of the proxy service for each historical request; determining a connection time between the request service instance corresponding to the historical request and the proxy service based on the device operation information corresponding to the historical request; and storing a mapping relationship between the target database included in the historical request and the request service instance corresponding to the historical request in a mapping relationship table in response to determining that the connection time is not later than the request time; and managing the configuration resources of the multiple service instances or the configuration resources of the multiple databases based on the mapping relationship table.
[0006] According to another aspect of this disclosure, a service instance management apparatus is provided, comprising: a first acquisition unit configured to acquire multiple historical requests between the multiple service instances and the multiple databases based on logs of a proxy service for routing data requests from multiple service instances to multiple databases, wherein each historical request includes a dynamic address that sent the historical request and a target database; a second acquisition unit configured to acquire a request service instance corresponding to each historical request by querying device operation information corresponding to the dynamic address included in each historical request; a first determination unit configured to determine a request time corresponding to each historical request based on logs of the proxy service for each historical request; a second determination unit configured to determine a connection time between the request service instance corresponding to the historical request and the proxy service based on the device operation information corresponding to the historical request; a storage unit configured to store a mapping relationship between the target database included in the historical request and the request service instance corresponding to the historical request in a mapping relationship table in response to determining that the connection time is not later than the request time; and a management unit configured to manage the configuration resources of the multiple service instances or the configuration resources of the multiple databases based on the mapping relationship table.
[0007] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the management method of the above-described service instance.
[0008] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform the management method of the above-described service instance.
[0009] According to another aspect of this disclosure, a computer program product is provided, including a computer program, wherein the computer program, when executed by a processor, is capable of implementing the management method for the above-described service instances.
[0010] According to one or more embodiments of this disclosure, the mapping relationship between service instances and databases can be accurately determined to more accurately manage the configuration resources of multiple service instances and multiple databases.
[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0012] The accompanying drawings exemplify embodiments and form part of the specification, serving together with the textual description to explain exemplary implementations of the embodiments. The illustrated embodiments are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0013] Figure 1 A schematic diagram of an exemplary system in which various methods described herein may be implemented, according to exemplary embodiments of the present disclosure;
[0014] Figure 2 A flowchart illustrating a method for managing service instances according to exemplary embodiments of this disclosure is shown;
[0015] Figure 3 A schematic diagram of a distributed system according to an exemplary embodiment of the present disclosure is shown;
[0016] Figure 4 A structural block diagram of a management apparatus for a service instance according to an exemplary embodiment of the present disclosure is shown;
[0017] Figure 5 A structural block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure is shown. Detailed Implementation
[0018] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0019] In this disclosure, unless otherwise stated, the use of terms such as "first," "second," etc., to describe various elements is not intended to limit the positional, temporal, or importance relationships of these elements; such terms are merely used to distinguish one element from another. In some examples, the first element and the second element may refer to the same instance of that element, while in other cases, based on the context, they may refer to different instances.
[0020] The terminology used in the description of the various examples described in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context explicitly indicates otherwise, an element may be one or more unless the number of elements is specifically limited. Furthermore, the term "and / or" as used in this disclosure covers any one of the listed items and all possible combinations thereof.
[0021] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.
[0022] Figure 1 A schematic diagram of an exemplary system 100 in which the various methods and apparatus described herein can be implemented according to embodiments of this disclosure is shown. Reference Figure 1 The system 100 includes one or more client devices 101, 102, 103, 104, 105 and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105 and 106 can be configured to execute one or more applications.
[0023] In embodiments of this disclosure, server 120 may run one or more services or software applications that enable the execution of management methods for service instances.
[0024] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtual and virtual environments. In some embodiments, these services may be provided as web-based services or cloud services, such as to users of client devices 101, 102, 103, 104, 105, and / or 106 under a Software as a Service (SaaS) model.
[0025] exist Figure 1 In the configuration shown, server 120 may include one or more components that implement the functions performed by server 120. These components may include software components, hardware components, or combinations thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 can sequentially interact with server 120 using one or more client applications to utilize the services provided by these components. It should be understood that various different system configurations are possible and may differ from system 100. Therefore, Figure 1 This is an example of a system used to implement the various methods described herein, and is not intended to be limiting.
[0026] Users can use client devices 101, 102, 103, 104, 105, and / or 106 to transmit logs for the proxy service and requests for mappings between service instances and databases. The client devices can provide interfaces that allow users to interact with them. The client devices can also output information to users through this interface. Although... Figure 1 Only six client devices are described, but those skilled in the art will understand that this disclosure can support any number of client devices.
[0027] Client devices 101, 102, 103, 104, 105, and / or 106 may include various categories of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptops), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors, or other sensing devices. These computer devices can run various categories and versions of software applications and operating systems, such as Microsoft Windows, Apple iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as Google Chrome OS); or include various mobile operating systems, such as Microsoft Windows Mobile OS, iOS, Windows Phone, and Android. Portable handheld devices may include cellular phones, smartphones, tablets, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Gaming systems may include various handheld gaming devices, internet-enabled gaming devices, etc. Client devices can run a variety of different applications, such as various Internet-related applications, communication applications (e.g., email applications), short message service (SMS) applications, and can use various communication protocols.
[0028] Network 110 can be any type of network well known to those skilled in the art, and can use any of a variety of available protocols (including but not limited to TCP / IP, SNA, IPX, etc.) to support data communication. By way of example only, one or more networks 110 can be a local area network (LAN), an Ethernet-based network, a token ring network, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.
[0029] Server 120 may include one or more general-purpose computers, special-purpose server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running a virtual operating system, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that can be virtualized to maintain virtual storage devices for servers). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.
[0030] The computing unit in server 120 can run one or more operating systems, including any of the aforementioned operating systems and any commercially available server operating system. Server 120 can also run any of a variety of additional server applications and / or middleware applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.
[0031] In some implementations, server 120 may include one or more applications to analyze and merge data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and 106.
[0032] In some implementations, server 120 can be a server for a distributed system or a server integrated with blockchain. Server 120 can also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in the cloud computing service system, designed to address the shortcomings of traditional physical hosts and Virtual Private Server (VPS) services, such as high management difficulty and weak business scalability.
[0033] System 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. Databases 130 may reside in various locations. For example, a database used by server 120 may be local to server 120, or it may be located away from server 120 and may communicate with server 120 via a network-based or dedicated connection. Databases 130 may be of different categories. In some embodiments, the database used by server 120 may be, for example, a relational database. One or more of these databases may store, update, and retrieve data from and from the databases in response to commands.
[0034] In some embodiments, one or more of the databases 130 may also be used by an application to store application data. The databases used by the application may be different categories of databases, such as key-value stores, object stores, or regular stores supported by a file system.
[0035] Figure 1The system 100 can be configured and operated in various ways to enable the application of the various methods and apparatus described in this disclosure.
[0036] Large-scale distributed data systems typically include multiple databases and business product service instances that need to query and access data from these databases. To facilitate the management of data access from different business product service instances, a proxy service is usually used to receive data requests from these instances and route them to the appropriate target database. However, in this scenario, because the request information from the service instance to the database is managed and forwarded by the proxy service, the mapping relationship between the service instance and the database cannot be determined. This makes accurate management impossible when there are a large number of service instances and databases with varying architectures.
[0037] Based on this, this disclosure provides a method for managing service instances. It obtains data request information stored in a proxy service between the service instance and the database to determine the mapping relationship between the dynamic address of the service instance and the database. Then, it queries device operation information based on the dynamic address to obtain the mapping relationship between the dynamic address and the requesting service instance. Furthermore, it filters the correct mapping relationship between the dynamic address and the requesting service instance based on the request time recorded in the proxy service log and the connection time recorded in the device operation information to prevent the dynamic address on the service instance side from becoming invalid. Thus, it is possible to obtain the mapping relationship between the service instance and the database using the dynamic address as a medium, and to more accurately manage the resource configuration of the service instance and the database based on the mapping relationship table.
[0038] Figure 2 A flowchart of a method 200 for managing service instances according to an exemplary embodiment of this disclosure is shown. Figure 2 As shown, method 200 includes:
[0039] Step S201: Based on the logs of the proxy service used to route data requests from multiple service instances to multiple databases, obtain multiple historical requests between the multiple service instances and the multiple databases. Each historical request includes the dynamic address that sent the historical request and the target database.
[0040] Step S202: Query the device operation information corresponding to the dynamic address based on the dynamic address included in each historical request to obtain the request service instance corresponding to each historical request;
[0041] Step S203: For each of the multiple historical requests, determine the corresponding request time based on the logs of the proxy service;
[0042] Step S204: Determine the connection time between the request service instance corresponding to the historical request and the proxy service based on the device operation information corresponding to the historical request;
[0043] Step S205: In response to determining that the connection time is not later than the request time, store the mapping relationship between the target database included in the historical request and the request service instance corresponding to the historical request in a mapping relationship table; and
[0044] Step S206: Based on the mapping relationship table, manage the configuration resources of the multiple service instances or the configuration resources of the multiple databases.
[0045] By applying the above method 200, data request information stored in the proxy service between the service instance and the database is obtained to obtain the mapping relationship between the dynamic address of the service instance and the database. Then, the mapping relationship between the dynamic address and the requested service instance is obtained by querying the device operation information based on the dynamic address. Furthermore, the correct mapping relationship between the dynamic address and the requested service instance is filtered based on the request time recorded in the proxy service log and the connection time recorded in the device operation information to prevent the dynamic address on the service instance side from becoming invalid. Thus, the mapping relationship between the service instance and the database can be obtained using the dynamic address as a medium, and the resource configuration of the service instance and the database can be managed more accurately based on the mapping relationship table.
[0046] In some examples, service instances corresponding to various business products access multiple databases through a proxy service. The network connection establishment process and request forwarding mechanism between the service instance, the proxy service, and the database are implemented as follows: When a service instance needs to access data, it proactively sends a connection request to the proxy service's listening address. The proxy service's listening address is a pre-configured network address used for external services. When the service instance initiates this connection, the operating system allocates a temporary dynamic address to it. Once the connection based on this dynamic address and the listening address is established, the service instance can send a data request carrying information about the target data to the proxy service. The proxy service can then parse the request and route it to the target database based on the mapping relationship between data names and data service node addresses maintained in the proxy service.
[0047] According to the above implementation, since the service instance uses a temporary dynamic address during the process of establishing a connection with the proxy service and sending a data request, steps S203-S205 are needed to detect the validity of the mapping relationship between the dynamic address determined in step S202 and the requesting service instance. When the connection time recorded in the device operation information is not later than the request time recorded in the proxy service log, it indicates that the connection (corresponding to the requesting service instance found in step S202) was established earlier than its appearance time in the proxy service log, that is, the mapping relationship between the requesting service instance and the dynamic address is valid, and thus the mapping relationship between the requesting service instance and the target database can be accurately determined based on this.
[0048] According to some embodiments, step S202, which involves querying the device operation information corresponding to the dynamic address included in each historical request to obtain the request service instance corresponding to each historical request, includes: for each historical request, determining the process information corresponding to the historical request by querying the device operation information corresponding to the dynamic address included in the historical request; and obtaining the request service instance corresponding to the historical request by querying the working directory corresponding to the process information. Therefore, the request service instance corresponding to a historical request can be easily and accurately determined by querying the process information and process working directory of the running device of the service instance.
[0049] In some examples, the step of determining the requested service instance based on the dynamic address can also be implemented in other ways, such as capturing the name or identifier of the requested service instance from the device operation information when the connection corresponding to the historical request is active. As long as the mapping relationship between the dynamic address sent by the request and the requested service instance can be determined based on the device operation information, this disclosure does not limit the specific implementation of this determination step.
[0050] According to some embodiments, each of the plurality of historical requests also includes the listening address of the proxy service. The step of determining the process information corresponding to each historical request by querying the device operation information corresponding to the dynamic address included in the historical request includes: for each historical request, scanning multiple sets of connection information of the device corresponding to the dynamic address included in the historical request; determining at least one set of target connection information including the listening address of the proxy service from the multiple sets of connection information; and determining the process information corresponding to the at least one set of target connection information. Therefore, by scanning the connection relationships of the instance's running devices, the connection relationship corresponding to the proxy service can be queried from the connection relationship scan results, and the process information corresponding to the historical request can be accurately determined based on this. As described above, before sending a data request, the service instance establishes a connection with the proxy service. By scanning the connection relationship information of the service instance's running devices, the process information for establishing the connection can be easily and accurately extracted based on the connection relationship information.
[0051] According to some embodiments, the dynamic address includes an IP address and port information. The step of determining the process information corresponding to each historical request by querying the device operation information corresponding to the dynamic address based on the dynamic address included in the historical request includes: dividing the multiple historical requests into multiple groups based on the IP address included in each historical request; determining the corresponding device for each request group based on the IP address corresponding to the request group; and determining the process information corresponding to each historical request in the request group by querying the device operation information corresponding to the request group. In practical application scenarios, the dynamic address used to establish a communication connection typically includes the IP address of the running device of the service instance and the communication port information assigned to the service instance. By grouping according to IP address, parallel group queries can be performed on the running devices of different service instances corresponding to the IP addresses of different request groups, improving query efficiency and preventing the mapping relationship between dynamic addresses and request service instances from becoming invalid.
[0052] In some examples, the operation of initially determining the mapping relationship between dynamic addresses and requested service instances in step S202 can be implemented in the following way:
[0053] In step 1, a prelim_mapping2_results array is initialized. This array is used to continuously collect the preliminary calculation results of the mapping relationship between dynamic addresses and requested service instances. The array contains the following elements: src_ip (IP address of the dynamic address), src_port (port information of the dynamic address), dst_ip (IP address of the listening address), dst_port (port information of the listening address), process ID, and service_name (identifier of the requested service instance).
[0054] In step 2, multiple historical requests are grouped by src_ip.
[0055] In step 3, for each of the multiple groups obtained based on src_ip, log in to the instance running device where the corresponding src_ip is located, scan all connection relationships of the device, and extract the connection relationships with target addresses dst_ip and dst_port. Each connection relationship contains five pieces of information: src_ip, src_port, dst_ip, dst_port, and process ID. This result is recorded as result1.
[0056] In step 4, the source address in result1 is taken as the target connection relationship of src_ip and src_port in the packet, and the result is recorded as result2.
[0057] In step 5, for each target connection relationship (src_ip, src_port, dst_ip, dst_port, process ID) in result2, check the symbolic links / proc / ${process ID} / exe or / proc / ${process ID} / cwd to find the path they point to. This path is the working directory of that process. Based on this, the metadata file meta.json can be found in the working directory corresponding to the above path. This file contains the identifier service_name of the requested service instance corresponding to the process.
[0058] Based on the above steps, (src_ip, src_port, dst_ip, dst_port, process ID, service_name) can be appended to prelim_mapping2_results to obtain the preliminary calculation results of the mapping relationship between dynamic addresses and requested service instances.
[0059] According to some embodiments, in step S205, determining the connection time between the request service instance corresponding to the historical request and the proxy service based on the device operation information corresponding to the historical request includes: obtaining the communication identifier between the request service instance corresponding to the historical request and the proxy service based on the process information corresponding to the historical request; and obtaining the connection time based on the communication identifier and the plurality of connection information. Therefore, the time when the process corresponding to the historical request establishes a connection with the proxy service can be easily and accurately obtained using the communication identifier as a medium.
[0060] In some examples, the `prelim_mapping2_results` array described earlier can be used to verify the validity of the mapping between dynamic addresses and requested service instances. Specifically, for each connection (src_ip, src_port, dst_ip, dst_port, process ID, service_name) in this array, the inode number corresponding to (src_ip, src_port, dst_ip, dst_port) can be extracted by querying the ` / proc / net / tcp` file on the instance running device. This inode number is denoted as `target_inode`, thus obtaining the communication identifier. Further, the symbolic links under the ` / proc / ${pid} / fd` directory on the instance running device are examined. Symbolic links of type "socket:[inode number]" with an inode number equal to `target_inode` are identified, and their corresponding timestamps are recorded as the connection time. By comparing the connection time with the request time of this connection in the proxy service log, the validity of the mapping between dynamic addresses and requested service instances can be verified.
[0061] According to some embodiments, method 200 further includes: repeatedly reading the logs of the proxy service based on a first time interval to obtain multiple new requests between the multiple service instances and the multiple databases; and maintaining the mapping table based on the multiple new requests. Therefore, the mapping table can be maintained in real time during the operation of the distributed data service system, ensuring the comprehensiveness and accuracy of the mapping table, and thereby achieving more accurate instance management.
[0062] According to some embodiments, repeatedly reading the logs of the proxy service based on a first time interval to obtain multiple new requests between the multiple service instances and the multiple databases includes: reading the logs of the proxy service based on the first time interval and a sampling ratio condition to determine multiple requests to be analyzed that meet the sampling ratio condition from the multiple new requests between the multiple service instances and the multiple databases, wherein maintaining the mapping relationship table based on the multiple new requests includes: maintaining the mapping relationship table based on the multiple requests to be analyzed. Therefore, by randomly sampling a certain proportion of requests for analysis, the computational load can be reduced, saving hardware resources.
[0063] In some examples, step S206, which manages the configuration resources of the multiple service instances or the multiple databases based on the mapping table, may include: when one or more target instances among the multiple service instances experience traffic increases or decreases, scaling up or down the corresponding databases of the target instances according to the mapping table to support the service stability of the target instances. Correspondingly, when the data request processing capabilities of the multiple databases change, the hardware resources of each service instance may also be configured according to the mapping table to support the stability of the data service system.
[0064] According to some embodiments, method 200 further includes: in response to determining that a fault exists in the plurality of service instances or the plurality of databases, determining the cause of the fault based on the mapping relationship table. Therefore, more accurate link fault diagnosis can be achieved based on the mapping relationship between service instances and databases. For example, when a service instance experiences a service fault, the corresponding database of the faulty service instance can be checked according to the mapping relationship table, ensuring the stability of the distributed data service system.
[0065] Figure 3 A schematic diagram of a distributed system according to an exemplary embodiment of the present disclosure is shown. Figure 3As shown, the distributed system includes service instances 311, 312, and 313. Each service instance can establish a connection with the proxy service 320 to send data requests. The proxy service 320 can route the data requests from each service instance to databases 331, 332, or 333. By applying the method 200 described above in the distributed system, the mapping relationship between the dynamic addresses of service instances and databases can be obtained based on the logs of the proxy service. Then, the mapping relationship between the dynamic addresses and the requesting service instances can be obtained by querying the device operation information based on the dynamic addresses. Thus, the mapping relationship between service instances and databases can be obtained using dynamic addresses as a medium, and the resource configuration of service instances and databases can be managed more accurately based on the mapping relationship table.
[0066] According to one aspect of this disclosure, a management device for service instances is also provided. Figure 4 A structural block diagram of a management device 400 for a service instance according to an exemplary embodiment of the present disclosure is shown. Figure 4 As shown, the device 400 includes:
[0067] The first acquisition unit 401 is configured to acquire multiple historical requests between the multiple service instances and the multiple databases based on logs of a proxy service used to route data requests from multiple service instances to multiple databases. Each historical request includes the dynamic address that sent the historical request and the target database.
[0068] The second acquisition unit 402 is configured to query the device operation information corresponding to the dynamic address based on the dynamic address included in each historical request, and obtain the request service instance corresponding to each historical request.
[0069] The first determining unit 403 is configured to determine the corresponding request time of each historical request based on the logs of the proxy service for each of the plurality of historical requests.
[0070] The second determining unit 404 is configured to determine the connection time between the request service instance corresponding to the historical request and the proxy service based on the device operation information corresponding to the historical request.
[0071] Storage unit 405 is configured to, in response to determining that the connection time is not later than the request time, store the mapping relationship between the target database included in the historical request and the request service instance corresponding to the historical request in a mapping relationship table; and
[0072] Management unit 406 is configured to manage the configuration resources of the multiple service instances or the configuration resources of the multiple databases based on the mapping relationship table.
[0073] According to some embodiments, the second acquisition unit 402 includes: a first determining subunit, configured to determine the process information corresponding to each historical request by querying the device operation information corresponding to the dynamic address based on the dynamic address included in the historical request; and a first acquisition subunit, configured to obtain the request service instance corresponding to the historical request by querying the working directory corresponding to the process information.
[0074] According to some embodiments, each of the plurality of historical requests further includes the listening address of the proxy service, and the first determining subunit includes: a scanning module configured to scan multiple sets of connection information of the device corresponding to the dynamic address included in the historical request for each historical request; a first determining module configured to determine at least one set of target connection information including the listening address of the proxy service from the multiple sets of connection information; and a second determining module configured to determine process information corresponding to the at least one set of target connection information.
[0075] According to some embodiments, the dynamic address includes IP address and port information. The first determining subunit includes: a grouping module configured to divide the plurality of historical requests into multiple groups based on the IP address included in each historical request; a third determining module configured to determine the corresponding device for each request group based on the IP address corresponding to the request group; and a fourth determining module configured to determine the process information corresponding to each historical request in the request group by querying the device operation information corresponding to the request group.
[0076] According to some embodiments, the second determining unit 404 includes: a second obtaining subunit configured to obtain the communication identifier between the request service instance corresponding to the historical request and the proxy service based on the process information corresponding to the historical request; and a third obtaining subunit configured to obtain the connection time based on the communication identifier and the plurality of connection information.
[0077] According to some embodiments, the apparatus 500 further includes: a third acquisition unit configured to repeatedly read the logs of the proxy service based on a first time interval to acquire multiple new requests between the multiple service instances and the multiple databases; and a maintenance unit configured to maintain the mapping table based on the multiple new requests.
[0078] According to some embodiments, the third acquisition unit is configured to: read the logs of the proxy service based on the first time interval and sampling ratio conditions, so as to determine multiple requests to be analyzed that meet the sampling ratio conditions from multiple new requests between the multiple service instances and the multiple databases, and wherein the maintenance unit is configured to maintain the mapping relationship table based on the multiple requests to be analyzed.
[0079] According to some embodiments, the apparatus 500 further includes a positioning unit configured to determine the cause of a fault based on the mapping table in response to determining that a fault exists in the plurality of service instances or the plurality of databases.
[0080] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0081] According to another aspect of this disclosure, an electronic device is also provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the above-described management method for the service instance.
[0082] According to another aspect of this disclosure, a non-transitory computer-readable storage medium storing computer instructions is also provided, wherein the computer instructions are used to cause the computer to perform the management method of the above-described service instance.
[0083] According to another aspect of this disclosure, a computer program product is also provided, including a computer program, wherein the computer program, when executed by a processor, implements the above-described method for managing service instances.
[0084] refer to Figure 5 The present invention describes a structural block diagram of an electronic device 500 that can serve as a server or client of the present disclosure, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0085] like Figure 5As shown, device 500 includes a computing unit 501, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 502 or a computer program loaded into random access memory (RAM) 503 from storage unit 508. RAM 503 may also store various programs and data required for the operation of device 500. The computing unit 501, ROM 502, and RAM 503 are interconnected via bus 504. Input / output (I / O) interface 505 is also connected to bus 504.
[0086] Multiple components in device 500 are connected to I / O interface 505, including: input unit 506, output unit 507, storage unit 508, and communication unit 509. Input unit 506 can be any type of device capable of inputting information to device 500. Input unit 506 can receive input numerical or character information and generate key signal inputs related to user settings and / or function control of the electronic device, and may include, but is not limited to, a mouse, keyboard, touchscreen, trackpad, trackball, joystick, microphone, and / or remote control. Output unit 507 can be any type of device capable of presenting information, and may include, but is not limited to, a monitor, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 508 may include, but is not limited to, a hard disk and an optical disk. Communication unit 509 allows device 500 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth™ devices, 802.11 devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.
[0087] The computing unit 501 can be a variety of 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 special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as the service instance management method. For example, in some embodiments, the service instance management method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of the service instance management method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the service instance management method by any other suitable means (e.g., by means of firmware).
[0088] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0089] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0090] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction 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 be, 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 machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0091] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, 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 sound input, voice input, or tactile input).
[0092] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), the Internet, and blockchain networks.
[0093] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0094] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0095] While embodiments or examples of this disclosure have been described with reference to the accompanying drawings, it should be understood that the methods, systems, and devices described above are merely exemplary embodiments or examples, and the scope of the invention is not limited by these embodiments or examples, but only by the granted claims and their equivalents. Various elements in the embodiments or examples may be omitted or replaced by their equivalents. Furthermore, the steps may be performed in a different order than that described in this disclosure. Further, various elements in the embodiments or examples may be combined in various ways. Importantly, as the technology evolves, many elements described herein can be replaced by equivalents that appear after this disclosure.
Claims
1. A method for managing service instances, comprising: Based on the logs of the proxy service used to route data requests from multiple service instances to multiple databases, multiple historical requests between the multiple service instances and the multiple databases are obtained, and each historical request includes the dynamic address that sent the historical request and the target database. By querying the device operation information corresponding to the dynamic address based on the dynamic address included in each historical request, the request service instance corresponding to each historical request can be obtained. For each of the multiple historical requests, The request time corresponding to the historical request is determined based on the logs of the proxy service. Based on the device operation information corresponding to the historical request, the connection time between the request service instance corresponding to the historical request and the proxy service is determined. In response to determining that the connection time is not later than the request time, the mapping relationship between the target database included in the historical request and the request service instance corresponding to the historical request is stored in the mapping relationship table; as well as Based on the mapping table, manage the configuration resources of the multiple service instances or the configuration resources of the multiple databases.
2. The method of claim 1, wherein, The step of querying the device operation information corresponding to the dynamic address based on the dynamic address included in each historical request, and obtaining the request service instance corresponding to each historical request, includes: For each historical request, the process information corresponding to the historical request is determined by querying the device operation information corresponding to the dynamic address based on the dynamic address included in the historical request; and By querying the working directory corresponding to the process information, the request service instance corresponding to the historical request can be obtained.
3. The method as described in claim 2, wherein, Each of the multiple historical requests also includes the listening address of the proxy service. For each historical request, determining the process information corresponding to that historical request by querying the device operation information corresponding to the dynamic address included in the historical request includes: For each historical request, scan multiple sets of connection information for the device corresponding to the dynamic address included in the historical request; Determine at least one set of target connection information from the plurality of sets of connection information, including the listening address of the proxy service; and Determine the process information corresponding to the at least one set of target connection information.
4. The method of claim 2, wherein, The dynamic address includes an IP address and port information. For each historical request, determining the process information corresponding to that historical request by querying the device operation information corresponding to the dynamic address based on the dynamic address included in the historical request includes: The multiple historical requests are divided into multiple groups based on the IP address included in each historical request; For each of the plurality of groups, Determine the corresponding device for the request group based on its IP address; and By querying the device operation information corresponding to the request group, the process information corresponding to each historical request in the request group can be determined.
5. The method of claim 3, wherein, The process of determining the connection time between the request service instance corresponding to the historical request and the proxy service based on the device operation information corresponding to the historical request includes: Based on the process information corresponding to the historical request, obtain the communication identifier between the request service instance and the proxy service corresponding to the historical request; and The connection time is obtained based on the communication identifier and the plurality of connection information.
6. The method according to any one of claims 1-5, further comprising: The logs of the proxy service are repeatedly read based on a first time interval to obtain multiple new requests between the multiple service instances and the multiple databases. as well as The mapping table is maintained based on the multiple new requests.
7. The method of claim 6, wherein, The step of repeatedly reading the logs of the proxy service based on a first time interval to obtain multiple new requests between the multiple service instances and the multiple databases includes: Based on the first time interval and sampling ratio conditions, the logs of the proxy service are read to determine multiple requests to be analyzed that meet the sampling ratio conditions from multiple new requests between the multiple service instances and the multiple databases. Maintaining the mapping table based on the multiple new requests includes: The mapping table is maintained based on the multiple requests to be analyzed.
8. The method according to any one of claims 1-5, further comprising: In response to determining that a fault exists in the plurality of service instances or the plurality of databases, the cause of the fault is determined based on the mapping relationship table.
9. A management device for service instances, comprising: The first acquisition unit is configured to acquire multiple historical requests between the multiple service instances and the multiple databases based on logs of a proxy service used to route data requests from multiple service instances to multiple databases. Each historical request includes the dynamic address that sent the historical request and the target database. The second acquisition unit is configured to query the device operation information corresponding to the dynamic address based on the dynamic address included in each historical request, and obtain the request service instance corresponding to each historical request. The first determining unit is configured to determine the corresponding request time of each of the plurality of historical requests based on the logs of the proxy service. The second determining unit is configured to determine the connection time between the request service instance corresponding to the historical request and the proxy service based on the device operation information corresponding to the historical request. The storage unit is configured to, in response to determining that the connection time is not later than the request time, store the mapping relationship between the target database included in the historical request and the request service instance corresponding to the historical request in a mapping relationship table. as well as The management unit is configured to manage the configuration resources of the multiple service instances or the configuration resources of the multiple databases based on the mapping table.
10. An electronic device, comprising: At least one processor; as well as A memory that is communicatively connected to the at least one processor; in The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.
11. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-8.
12. A computer program product comprising a computer program, wherein, The computer program, when executed by a processor, implements the method according to any one of claims 1-8.
Citation Information
Patent Citations
Conversation-based service instance management method and equipment under micro service framework
CN108206852A
Communication service processing method and device and computer readable storage medium
CN120075199A