A query method, query device, electronic device and readable storage medium

Through querying methods and devices, the problem of host permissions when the internal interface changes in cloud platform service calls or when the host is added is solved, ensuring the normal operation of service instances, and improving the healthy maintenance effect of cloud platform services.

CN115225325BActive Publication Date: 2024-11-05CHINA TELECOM CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210687885.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-17
Publication Date
2024-11-05
Estimated Expiration
2042-06-17

AI Technical Summary

Technical Problem

When the internal interface of the service call of the cloud platform changes or new hosts are added, the service instance may fail to run due to limited access rights between the relevant hosts.

Method used

A query method and device are provided, by receiving the input query information, querying whether there is access permission between the first host and at least one second host, and outputting query results so that relevant personnel can activate access permissions and ensure that the service instance can run normally.

Benefits of technology

By checking access rights between hosts in advance, avoiding service instances from failing due to limited permissions, reducing operation and maintenance personnel's investigation time and energy, and improving service maintenance efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115225325B_ABST
    Figure CN115225325B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a query method, a query device, an electronic device, and a readable storage medium. The query method comprises: receiving input query information; wherein the query information comprises: the address information of the first interface or the address information of the host to be added; according to the query information, querying whether there is access permission between the first host and at least one second host, and obtaining the query result; and outputting the query result. The technical solution provided by the embodiments of the present application can solve the problem in the prior art that when the internal interface of the service call changes or a new host is added, the service instance may fail to run due to the restricted access permission between the related hosts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of communication technology, and specifically relates to a query method, a query device, an electronic device and a readable storage medium. Background Art

[0002] When expanding cloud platform (such as container cloud platform) machines, and when the internal interfaces of service calls deployed on the cloud platform change (adding new internal call interfaces or replacing internal call interfaces), it is easy for the service instance to fail to call the corresponding interface due to ignoring the access rights between hosts, which ultimately leads to the failure of service instance execution and the inability to provide corresponding services to users.

[0003] For example, for the internal interface url_2 (production environment on host host_1, test environment on host host_2) called by service A (production environment on host host_1, test environment on host host_2), when the developer replaces url_2 with interface url_3 (production environment on host host_4, test environment on host host_2), in the test environment, since the host to which service A belongs and the host to which interface url_3 belongs are the same host (i.e. host_2), service A can call url_3. However, in the production environment, since the host to which service A belongs (host_1) is different from the host to which interface url_3 belongs (host_4), if access rights are not enabled between host_1 and host_4, service A cannot call url_3, which results in the inability to implement service A.

[0004] For another example, the operation and maintenance personnel expand the cloud platform machines and add the expanded host host_a. The instances of service B in the cloud platform were previously automatically assigned to hosts host_b and host_c (host_b and host_c have all the inter-host communication permissions required for the operation of service B enabled). When the developers increase the number of instances of service B, some of the newly added instances may be automatically assigned to the newly added host host_a. If the access permissions between host_a and the host required for the operation of service B are not enabled, these newly added instances may not run normally. In addition, since various services share the machine resources of the cloud platform, and the machine resources required for the operation of different services may be different, it is difficult for the operation and maintenance personnel to enable access permissions between all related machines, that is, it is difficult to achieve full coverage of access permissions between new machines and existing machines.

[0005] In short, when the internal interface called by the service changes or a new host is added, the service instance may fail to run due to restricted access rights between related hosts. Summary of the invention

[0006] The purpose of the embodiments of the present application is to provide a query method, a query device, an electronic device and a readable storage medium to solve the problem in the prior art that when the internal interface of the service call changes or a new host is added, the service instance may fail to run due to limited access rights between related hosts.

[0007] In a first aspect, an embodiment of the present application provides a query method, the method comprising:

[0008] Receive input query information; wherein the query information includes: address information of a first interface or address information of a host to be added, the first interface being a calling interface to be configured for a first service;

[0009] According to the query information, query whether the first host and at least one second host have access rights to obtain a query result; wherein, when the query information includes the address information of the first interface, the first host is the host to which the first interface belongs, and the second host is the host to which the first service belongs; when the query information includes the address information of the host to be added, the first host is the host to be added, and the second host is the host to which the second interface called by the second service that can be deployed on the host to be added belongs;

[0010] Output the query results.

[0011] In a second aspect, an embodiment of the present application provides a query device, the device comprising:

[0012] A receiving module, configured to receive input query information; wherein the query information includes: address information of a first interface or address information of a host to be added, wherein the first interface is a calling interface to be configured for a first service;

[0013] A query module, configured to query, based on the query information, whether the first host and at least one second host have access rights, and obtain a query result; wherein, when the query information includes the address information of the first interface, the first host is the host to which the first interface belongs, and the second host is the host to which the first service belongs; and when the query information includes the address information of the host to be added, the first host is the host to be added, and the second host is the host to which the second interface called by the second service that can be deployed on the host to be added belongs;

[0014] Output module, used to output query results.

[0015] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps in the query method described in the first aspect are implemented.

[0016] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps in the query method described in the first aspect are implemented.

[0017] In an embodiment of the present application, before the internal interface of the service call changes, first query whether there is a problem of restricted access rights between the host to which the service belongs and the host to which the interface to be configured for the service belongs, based on the address of the interface to be configured for the service, and output the query results for relevant personnel to view. Or before adding a new host to the cloud platform, query whether there is a problem of restricted access rights between the host to be added and the host to which the interface of the service call that can be deployed on the host to be added belongs, based on the address of the host to be added, and output the query results for relevant personnel to view. In this way, relevant personnel can open access rights when it is determined that there is no access right between the relevant hosts according to the query results, so that the service instance can obtain host resource support in time to avoid operation failure. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A flowchart of a query method provided in an embodiment of the present application;

[0019] Figure 2a One of the data structure diagrams of the standardized configuration information of the internal interface provided in the embodiment of the present application;

[0020] Figure 2b The second data structure diagram of the standardized configuration information of the internal interface provided in the embodiment of the present application;

[0021] Figure 3 A schematic diagram of the data structure of access rights information between hosts provided in an embodiment of the present application;

[0022] Figure 4 A schematic diagram of an example process provided for an embodiment of the present application;

[0023] Figure 5 A schematic block diagram of a query device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described below are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0025] It should be understood that "one embodiment" or "an embodiment" mentioned in the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner.

[0026] In the various embodiments of the present application, it should be understood that the serial numbers of the steps do not mean an absolute order of execution, and the execution order of each step should be determined by its function and internal logic. Therefore, the serial numbers of each step should not constitute an absolute limitation on the implementation process of the embodiments of the present application.

[0027] The query method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0028] An embodiment of the present application provides a query method, which is applied to an electronic device, and the electronic device may be a server or a terminal device.

[0029] like Figure 1 As shown, the query method may include:

[0030] Step 101: Receive input query information.

[0031] The query information mentioned here may include: address information of the first interface or address information of the host to be added.

[0032] The first interface is a calling interface to be configured for the first service. Specifically, the first interface may be a calling interface to be newly added for the first service, or may be a calling interface to be replaced by the first service.

[0033] Among them, the host to be added is the machine to be expanded.

[0034] Step 102: According to the query information, query whether the first host and at least one second host have access rights to obtain a query result.

[0035] In which, when the query information includes the address information of the first interface, the first host refers to the host to which the first interface belongs, the second host refers to the host to which the first service belongs, and the number of the second hosts is one.

[0036] Wherein, in the case where the query information includes the address information of the host to be added, the first host refers to the host to be added, the second host refers to the host to which the interface (hereinafter collectively referred to as the second interface) called by the service (hereinafter collectively referred to as the second service) that can be deployed on the host to be added belongs, and the number of the second hosts is at least one. The second service can be some or all services that can be deployed on the host to be added.

[0037] Optionally, because the cloud platform can divide the space area according to the functional area, the services with a certain domain name space can use the same batch of machines. Therefore, based on this, it can be determined which services can be deployed on the host to be added.

[0038] In the embodiment of the present application, it is possible to query whether the relevant hosts required for the service operation have access rights, that is, whether the first host and the second host have access rights, based on the input interface address or host address.

[0039] Step 103: Output the query result.

[0040] The query result may include: indication information for indicating whether the first host and the second host have access rights or do not have access rights.

[0041] In the embodiment of the present application, the query result can be output, such as through screen output display, for relevant personnel to view. In this way, the relevant personnel can open the access rights when it is determined that there is no access right between the relevant hosts according to the query result, so as to avoid the problem that the service instance cannot obtain the host resource support in time due to the lack of access right between the hosts, causing the service instance to fail to run.

[0042] In addition, in the prior art, when a service instance fails to run, relevant personnel need to spend time and energy to investigate the reasons for the failure of the service instance. For example, service A has 4 instances, a, b, c, and d. Instances a and b are assigned to the machine with IP address 10.128.111.1 for execution, and instances c and d are assigned to the machine with IP address 10.128.222.1 for execution. When service A needs to call the internal interface to access service B (its instance exists on the machine with IP address 10.128.111.2, and there is no access permission between the machine with IP address 10.128.111.2 and the machine with IP address 10.128.222.1), instances a and b can successfully access service B, but instances c and d cannot access service B, resulting in a failure. At this time, the phenomenon that the operation and maintenance personnel see is that the processing efficiency of service A is only 50%. The operation and maintenance personnel need to log in to the cloud platform and check each instance separately to determine the instance that failed to run and the reason for the failure, and then open the access rights between the relevant hosts. In the embodiment of the present application, since the access rights between the relevant hosts required for the service operation are queried in advance, the operation and maintenance personnel can solve the problem of no access rights between the relevant hosts before the service instance is run, thereby reducing the time and energy spent by the operation and maintenance personnel to investigate the reasons for the failure of the service instance.

[0043] As an optional embodiment, after step 103: outputting the query result, the query method may further include:

[0044] When the query result indicates that there is no access permission between the first host and the second host, the query result is sent to the first account.

[0045] (1) In the case where the query information includes the address information of the first interface, the first account is an operation and maintenance personnel account, and the address information of the first interface is input through a developer account.

[0046] When it comes to changes in the internal interface of the service, it is generally implemented by the developer, that is, the developer implements the change of the internal interface of the service by adjusting the program code. Therefore, the address information of the first interface can be entered by the developer through his own account. As for the opening and closing of access rights between machines, it is generally implemented by the operation and maintenance personnel. Therefore, in the embodiment of the present application, when the interface address is entered through the developer account and the query result that there is no access right between the relevant hosts is obtained, the query result can be sent to the operation and maintenance personnel account, so that the operation and maintenance personnel can open the access rights between the relevant hosts. In this way, when the developer executes the service internal interface change work order, the operation and maintenance personnel can also execute the host access right opening work order at the same time. Compared with the existing technical process, the developer does not need to submit the access right opening application work order to the operation and maintenance personnel, which can reduce the work pressure of the developer in service maintenance and improve work efficiency. Among them, the existing technical process is: the developer needs to communicate and coordinate with the operation and maintenance personnel first, and ask the operation and maintenance personnel to assist in querying the host IP address to which the first interface belongs, and when the access right between the hosts can be opened, and then the developer submits the access right opening application work order to the operation and maintenance personnel, and then starts to write code.

[0047] As can be seen from the foregoing, the developer queries the query result of a single service, and the new interface address (ie, the address of the first interface) is the query input parameter.

[0048] (2) When the query information includes the address information of the host to be added, the first account is a developer account, and the address information of the host to be added is input through an operation and maintenance personnel account.

[0049] The expansion of machines is generally performed by operation and maintenance personnel, and the opening and closing of access rights between machines is also generally implemented by operation and maintenance personnel. Therefore, the address information of the host to be added can be entered by the operation and maintenance personnel through their own account to query which other machines need to open access rights between the expanded machine and other machines. The query results can be sent to the corresponding developer account (the developer corresponding to different services may be different) to inform the developer.

[0050] The operation and maintenance personnel query the query result of at least one service, and the host address to be added is the query input parameter.

[0051] Optionally, when the query information includes address information of the host to be added, the query result may further include: a code of a second service deployable on the host to be added, so that relevant personnel can know which services the host to be added involves.

[0052] Optionally, in the case where the query information includes the address information of the host to be added, the query result may also include: the contact information of the developer corresponding to the second service that can be deployed on the host to be added, so that the operation and maintenance personnel can communicate and coordinate with the developer regarding the corresponding service. For example, for service A that can be deployed to the newly added host, when the operation and maintenance personnel are temporarily unable to open the access rights between the newly added host and the host where service B that service A needs to call is located, the operation and maintenance personnel can communicate with the developer of service A in advance and ask the developer to make a "temporary maintenance" notification in the program. In this way, it can also avoid the situation where the developer spends time and energy on a series of troubleshooting operations due to ignorance when some instances of the service fail to execute.

[0053] Optionally, for the aforementioned (1) and (2), after detecting that the access rights between the first host and the second host are opened, a notification message may be sent to the developer account so that the developer may perform further processing operations according to the notification message.

[0054] Optionally, when the query result includes indication information indicating that there is no access permission between the first host and the second host, the query result can be automatically sent to the first account, or it can be manually decided whether to send the query result to the first account. The specific situation can be set according to actual needs.

[0055] As an optional embodiment, in the embodiment of the present application, the concept of internal interface association registration can be used to group the internal interfaces called by the service, and establish the association relationship between the internal interface and the host to which it belongs, that is, for the application service deployed in the cloud platform, the service needs to call the interface and the host resource where the interface is located, and classify and mark it according to the IP address or domain name address to form the standardized configuration information of the service internal logical function interface address. For example, the number query interface called by service A: https: / / test.189.cn:31061 / ic / numbers and the authentication interface: https: / / test.189.cn:31061 / ic / auth have the same domain name address "test.189.cn", then the two interfaces are divided into a group, and the interface group can be marked as Domain_1. Among them, the interface group obtained includes the interface address with the same IP address and / or the same domain name address, and the host information to which the interface address belongs. The interfaces corresponding to the interface addresses in an interface group are all interfaces that need to be called by the same service, and the interface called by a service can be divided into multiple interface groups.

[0056] In the embodiment of the present application, developers can standardize the configuration file of the internal interface called by the service, and the information in each interface group can be stored as follows according to the configuration file: Figure 2a and Figure 2b Optionally, developers can use scripts or develop interface functions to form standardized configuration information about the relationship between the service-to-be-called interface and the host to which the interface belongs, and store the information in a database.

[0057] Figure 2a and Figure 2b It is the relationship between the interface called by service A and the host to which the interface belongs, forming standardized configuration information (i.e. the information in the interface group). Figure 2a Take the example to explain the standardized configuration information.

[0058] in, Figure 2a "Tag_1" in the figure is a group tag. The interfaces in the group include url_1 (http: / / test.189.cn:8080 / numbers) and url_2 (http: / / 10.128.2.68:9090 / auth). Both interfaces are key interfaces that affect the business integrity of service A (that is, key is true, and when key is false, it means that the interface is a non-key interface that does not affect the business integrity, such as Figure 2b The two interfaces are url_1 and url_2 in the figure, and both interfaces belong to the host host_1. The transmission protocol used by the host host_1 is: http. The grouping basis of this group is: test.189.cn (domain name address) and 10.128.2.68 (IP address), among which the domain name address: test.189.cn corresponds to the IP address: 10.128.2.68. The domain name address is another form of representation of the Internet address, which is opposite to the digital IP address. The way to identify a computer on the Internet is to use the IP address, but a set of IP address numbers is not easy to remember, so the domain name address that is relatively easy to remember came into being.

[0059] It should be noted that the HOST field is used to identify the host resource where the internal interface corresponds to the service, the MARK field is used to identify the classification basis of the interface address, and the KEY field is used to identify whether the interface address affects the integrity of the business process.

[0060] In the embodiment of the present application, by standardizing the configuration information of the internal call interface address in the service, it is beneficial to adjust the business logic content (i.e., increase, decrease, replacement, etc. of the call interface). Assuming that the interface url_1 used in service A needs to be replaced with the interface url_2, in the prior art, it is necessary to replace multiple code positions using the interface url_1 with the address of url_2. In the embodiment of the present application, when replacing the interface, the address of url_1 in the configuration information can be directly modified to the address of url_2, which is simpler to operate and reduces the workload of developers.

[0061] As an optional embodiment, in the embodiment of the present application, the access rights between hosts can also be counted in advance to generate access rights relationship information between hosts. In the access rights relationship information between hosts, the host information is the host address. Optionally, the access rights relationship information between hosts can be in the form of Figure 3 The data structure shown is stored.

[0062] As an optional embodiment, in the embodiment of the present application, based on the query information, it is possible to query whether the first host and at least one second host have access rights in the information of the interface grouping and / or the access right relationship information between the hosts to obtain the query result.

[0063] As an optional embodiment, in the case where the query information includes the address information of the first interface, step 102: querying whether the first host and at least one second host have access rights according to the query information may include:

[0064] Step A1: Obtain the IP address or domain name address in the address information of the first interface.

[0065] Step A2: Determine the first interface group corresponding to the IP address or domain name address in the address information of the first interface.

[0066] Step A3: Determine whether the first interface group has an interface address that matches the address information of the first interface.

[0067] Step A4: If yes, determine whether the first host and the second host have access rights.

[0068] Among them, the first interface group is one of at least one interface group, each interface group includes interface addresses with the same IP address and / or the same domain name address, and the interfaces corresponding to the interface addresses in each interface group are all interfaces that the first service needs to call.

[0069] For the first interface to be configured for the first service, in order to determine whether the host to which the first interface belongs has access rights with the host to which the first service belongs, the interface group (i.e., the first interface group) obtained by classification based on the IP address or domain name address in the address information of the first interface can be determined first, that is, the interface group corresponding to the IP address or domain name address of the first interface is determined. Then, it is determined whether the interface group has an interface address that matches the address information of the first interface (specifically, whether it has the IP address and port address or domain name address and port address in the address information of the first interface, or whether it has the same interface address as the domain name address and port address in the address information of the first interface). If so, it means that access rights have been opened between the host to which the first interface belongs and the host to which the first service belongs, and the developer can directly configure the first interface to the first service.

[0070] In the embodiment of the present application, it is determined whether the host to which the first interface belongs and the host to which the first service belongs have access rights based on the interface address and the information in the pre-acquired interface group. In this way, when the two hosts already have access rights, it can be determined that the access rights have been opened between the two hosts when the address information of the host to which the first interface belongs and the host to which the first service belongs is unknown, thereby reducing the information to be queried and improving the query efficiency.

[0071] Optionally, after detecting that the developer configures the first interface to the first service, the first interface may be automatically grouped into a first interface group, and an association relationship between the first interface and the host to which it belongs (ie, the first host) may be established.

[0072] Specifically, the interface grouping also includes grouping basis information (i.e. classification basis information, such as Figure 2a and Figure 2b Therefore, step A2: determining the first interface group corresponding to the IP address or domain name address in the address information of the first interface may include:

[0073] Traverse the grouping basis information in each interface group of the first service; when the grouping basis information in one of the interface groups is the same as the IP address or domain name address in the address information of the first interface, determine the interface group as the first interface group corresponding to the IP address or domain name address in the address information of the first interface.

[0074] Afterwards, you can also traverse all interface addresses corresponding to the grouping basis in the first interface group that is the same as the IP address or domain name address of the first interface, and match the port part in the address. If there is an interface address that is the same as the port information in the address information of the first interface, it means that the interface address matches the address information of the first interface.

[0075] Assume that service A needs to add a new call interface url_a, and the interface address is http: / / test.189.cn:8080 / order. First, extract the domain name address "test.189.cn" in the interface address of url_a, and then in the pre-stored domain name for service A, Figure 2a and Figure 2b Query the MARK field in the structure data shown. It is found that mark_1 (test.189.cn) under the MARK field in the interface group Tag_1 is the same as the domain name address in the interface address of url_a, then the interface group Tag_1 is the interface group corresponding to the domain name address in the interface address of url_a. After that, traverse the interface addresses corresponding to the MARK field in the Tag_1 interface group and match the port part in the address. It is found that the port of interface url_1 (http: / / test.189.cn:8080 / numbers) is the same as the port of interface url_a (both are 8080), then the interface address of url_1 matches the interface address of url_a, which means that the access rights between the host to which url_a belongs and the host where service A is located have been opened.

[0076] Optionally, after step A3: determining whether the first interface group has an interface address that matches the address information of the first interface, the query method may further include:

[0077] When there is no interface address matching the address information of the first interface in the first interface group, determine the address of the first host and the address of the second host; in the pre-recorded access permission relationship information between the hosts, determine whether the first host and the second host have access permission based on the address of the first host and the address of the second host.

[0078] In an embodiment of the present application, when it is impossible to determine whether the host to which the first interface belongs and the host to which the first service belongs have access rights based on the interface address and the information in the pre-acquired interface group, it is possible to query whether the first host and the second host have access rights in the pre-recorded access rights relationship information between the hosts based on the address of the first host and the address of the second host.

[0079] The access permission relationship information between hosts has been described above and will not be repeated here.

[0080] Optionally, in an embodiment of the present application, developers can register and store information about the machine to which the service belongs and the interfaces included in the service in advance. For example, the registration information is: service A is located on machine host_0, including interfaces service_a_url_1, service_a_url_2, ..., service_a_url_n (that is, these interfaces belong to service a). In this way, the host to which the first interface belongs and the host to which the first service belongs can be determined based on these registration information. For example, service B needs to add a new call interface service_a_url_1. From the aforementioned registration information, it can be found that interface service_a_url_1 belongs to service A, and service A is deployed on machine host_0, so that the mapping relationship between interface service_a_url_1 and the machine can be known. Similarly, it is also possible to know which machine service B specifically belongs to based on the registration information.

[0081] As an optional embodiment, in the case where the query information includes address information of the host to be added, step 102: determining whether the first host has access rights with at least one second host according to the query information may include:

[0082] Step B1: Obtain at least one interface group corresponding to the second service.

[0083] Step B2: According to the interface group corresponding to the second service, determine the address information of the second host to which the second interface called by the second service belongs.

[0084] Step B3: In the pre-recorded access permission relationship information between hosts, determine whether the host to be added has access permission with the second host according to the address information of the host to be added and the address information of the second host.

[0085] Each interface group includes interface addresses with the same IP address and / or the same domain name address, and host address information to which the interface addresses belong. The interfaces corresponding to the interface addresses in each interface group are all interfaces that the second service needs to call.

[0086] In the embodiment of the present application, after determining the services that can be deployed on the host to be added, the information in the interface group corresponding to these services can be obtained, such as Figure 2a and Figure 2b The structural data shown; then, based on the information in the interface grouping, determine the host to which the interface for service calls that can be deployed on the host to be added belongs; finally, based on the pre-recorded access permission relationship information between the hosts, determine whether the host to be added and the host to which the interface for service calls that can be deployed on the host to be added belongs have access permissions.

[0087] As an optional embodiment, in step B3: after determining whether the host to be added has access rights with the second host according to the address information of the host to be added and the address information of the second host in the pre-recorded access rights relationship information between the hosts, the query method may further include:

[0088] When it is determined that there is no access permission between the host to be added and the second host, it is determined whether the second interface corresponding to the second host is a key interface for service operation, and the determination result is added to the query result.

[0089] The determination result includes: indication information for indicating that the second interface corresponding to the second host is a critical interface for service operation, or indication information for indicating that the second interface corresponding to the second host is a non-critical interface for service operation.

[0090] Among them, the information of each interface group also includes: indication information for indicating whether the interface is a key interface or a non-key interface for service operation. Therefore, in the embodiment of the present application, it is possible to judge whether the second interface is a key interface for service operation based on the information in the interface group. If the second interface is a key interface, the operation and maintenance personnel can first open the access rights between the hosts and then add a new host; if the second interface is a non-key interface, the host can be added first, and then decide whether to open the access rights between the hosts according to actual needs.

[0091] For example, the instances of service A and service B are originally allocated on host host_0. By querying the interface grouping information, it is found that the interfaces that need to be called within the two services are allocated on host_1, and the interfaces are all key interfaces. If the operation and maintenance personnel want to add a new host host_3, and then Figure 3 From the storage data shown, it can be judged that there is no access permission between host_3 and host_1. If the instances of service A and service B are allocated to host_3, these instances cannot run normally. Based on the query results, the operation and maintenance personnel know that they need to open the access permission between host_3 and host_1 first, and then add host host_3.

[0092] For another example, the interfaces that need to be called within service A are allocated on host_1 and host_4 respectively. Figure 2a and Figure 2b As shown in the figure, the interface that needs to be called within service B is allocated to host_1. When the host resource host_7 must be temporarily added due to the needs of service B, that is, the instance of service B needs to be allocated to host_7, and some new instances of service A may also be allocated to host_7. By querying Figure 3From the storage data shown, we can see that host_7 has access rights with host_1, but host_7 has no access rights with host_4. Therefore, service A can use interfaces url_1 and url_2 in Tag_1 normally, but cannot use interfaces url_1 and url_2 in Tag_2 normally. Since interfaces url_1 and url_2 in Tag_2 are non-critical interfaces (KEY is false), in order to protect the key business of service B, some non-critical interface calls of service A can be temporarily sacrificed. In other words, when there is no access rights between hosts, resulting in the possible failure of the service calling the internal interface, it can be determined whether some non-critical functions can be temporarily sacrificed to ensure the uninterrupted important business based on whether the called interface affects the integrity of the service business logic.

[0093] In an embodiment of the present application, the interfaces called by the service can be divided into critical interfaces and non-critical interfaces based on whether they affect the integrity of the service business logic. In this way, when adding host resources, the operation and maintenance personnel can not only understand the services involved, but also understand the degree of impact of the newly added host on different services (that is, whether it involves critical functions and affects business integrity), so as to take corresponding processing measures.

[0094] It should be noted that the newly added host refers to the newly used machine for the deployment service, not that the original machine does not exist. Before using this machine, the access permission relationship between this machine and other hosts may have been registered in advance.

[0095] Finally, through Figure 4 The processing flow shown provides an exemplary, comprehensive and general description of the embodiments of the present application.

[0096] like Figure 4 As shown, the processing flow may include:

[0097] Step 401: Count the application services entering the cloud, that is, count which application services are deployed on the cloud platform.

[0098] Step 402: Determine whether the cloud platform used by the cloud-entered application service has host resource registration (ie, host-to-host access permission information). If not, proceed to step 403; if yes, proceed to step 404.

[0099] Step 403: Add host resource data of the cloud platform, and then enter step 404.

[0100] Step 404: Determine whether the internal interface address called by the application service is configured according to the home resource specification. If not, proceed to step 405; if yes, proceed to step 406.

[0101] Step 405: Normalize the configuration of the internal interface address of the application service, and then proceed to step 406.

[0102] Step 406: Obtain the mapping relationship between the deployed services on the cloud platform and the used host resources.

[0103] Step 407: When the application service logic is adjusted (ie, the interface is adjusted) or the host resources are expanded, the availability of the internal interface of the application service is queried according to the query rules described in the previous embodiment.

[0104] Step 408: Use the query result as a pre-reference item for adjusting application service logic and expanding host resources.

[0105] The query method provided in the embodiment of the present application can be applied to a variety of scenarios, and the specific application scenarios are as follows:

[0106] (1) The mobile network operator’s Internet cards, data packages, benefits, and other order-submission capability services are in the process of healthy maintenance.

[0107] (2) The number query service and authentication service that are used by a large number of mobile network users are in the process of security upgrade on the cloud platform.

[0108] (3) Maintenance of the connection capability interface between the mobile network operator’s omni-channel center and the provincial and municipal central departments.

[0109] (4) The protocol maintenance work developed and coordinated between mobile network operators and partners.

[0110] In these scenarios, the service may not be able to run normally due to lack of access permissions between hosts.

[0111] The above is a description of the query method provided in the embodiment of the present application.

[0112] In summary, the technical solution provided by the embodiment of the present application is to query whether there is a problem of no access rights between the host to which the service belongs and the host to which the interface to be configured for the service belongs, based on the address of the interface to be configured for the service, before the internal interface called by the service changes, and output the query results for relevant personnel to view. Or before adding a new host to the cloud platform, based on the address of the host to be added, query whether there is a problem of no access rights between the host to be added and the host to which the interface of the service call that can be deployed on the host to be added belongs, and output the query results for relevant personnel to view. In this way, relevant personnel can open access rights when it is determined that there is no access rights between the relevant hosts according to the query results, so as to avoid the problem that the service instance cannot obtain host resource support in time due to the lack of access rights between the hosts, resulting in the failure of the service instance to run. The technical solution provided by the embodiment of the present application is a pre-query verification scheme, which performs query verification on the availability of the internal interface called by the service, which is conducive to improving the health maintenance effect of the service.

[0113] The query method provided by the embodiment of the present application is introduced above. The query device provided by the embodiment of the present application will be introduced below with reference to the accompanying drawings.

[0114] like Figure 5 As shown, an embodiment of the present application also provides a query device, which is applied to an electronic device.

[0115] Wherein, the query device may include:

[0116] The receiving module 501 is used to receive input query information.

[0117] The query information includes: address information of a first interface or address information of a host to be added, and the first interface is a calling interface to be configured for the first service.

[0118] The query module 502 is used to query whether the first host and at least one second host have access rights according to the query information, and obtain a query result.

[0119] Among them, when the query information includes the address information of the first interface, the first host is the host to which the first interface belongs, and the second host is the host to which the first service belongs; when the query information includes the address information of the host to be added, the first host is the host to be added, and the second host is the host to which the second interface called by the second service that can be deployed on the host to be added belongs.

[0120] Output module, used to output query results.

[0121] Optionally, the query device may further include:

[0122] The sending module is used to send the query result to the first account when the query result shows that there is no access permission between the first host and the second host.

[0123] Among them, when the query information includes the address information of the first interface, the first account is an operation and maintenance personnel account, and the address information of the first interface is input through a developer account; when the query information includes the address information of the host to be added, the first account is a developer account, and the address information of the host to be added is input through an operation and maintenance personnel account.

[0124] Optionally, the query module 502 may include:

[0125] The first acquiring unit is configured to acquire an IP address or a domain name address from the address information of the first interface when the query information includes the address information of the first interface.

[0126] The first determining unit is used to determine a first interface group corresponding to the IP address or the domain name address.

[0127] Among them, the first interface group is one of at least one interface group, each of the interface groups includes interface addresses with the same IP address and / or the same domain name address, and the interfaces corresponding to the interface addresses in each interface group are all interfaces that the first service needs to call.

[0128] The second determining unit is used to determine whether the first interface group has an interface address that matches the address information of the first interface.

[0129] The third determining unit is configured to determine, if the access permission exists between the first host and the second host.

[0130] Optionally, the query device may further include:

[0131] The first determination module is used to determine the address of the first host and the address of the second host when there is no interface address matching the address information of the first interface in the first interface group.

[0132] The second determination module is used to determine whether the first host and the second host have access rights according to the address of the first host and the address of the second host in the pre-recorded access rights relationship information between the hosts.

[0133] Optionally, the query module 502 may include:

[0134] The second acquisition unit is used to acquire at least one interface group corresponding to the second service when the query information includes the address information of the host to be added.

[0135] Among them, each of the interface groups includes interface addresses with the same IP address and / or the same domain name address, and the host address information to which the interface address belongs. The interfaces corresponding to the interface addresses in each of the interface groups are the interfaces that the second service needs to call.

[0136] The fourth determining unit is used to determine, according to the interface grouping, the address information of the second host to which the second interface called by the second service belongs.

[0137] The fifth determining unit is used to determine whether the host to be added has access rights with the second host according to the address information of the host to be added and the address information of the second host in the pre-recorded access rights relationship information between the hosts.

[0138] Optionally, the query device may further include:

[0139] The third determination module is used to determine whether the second interface corresponding to the second host is a key interface when it is determined that there is no access permission between the host to be added and the second host, and add the determination result to the query result.

[0140] The query device provided in the embodiment of the present application can achieve Figure 1 To avoid repetition, the various processes implemented by the query device in the illustrated method embodiment will not be described again here.

[0141] In an embodiment of the present application, before the internal interface of the service call changes, first, based on the interface address to be configured for the service, query whether there is a problem of no access rights between the host to which the service belongs and the host to which the interface to be configured for the service belongs, and output the query results for relevant personnel to view. Or before adding a new host to the cloud platform, based on the address of the host to be added, query whether there is a problem of no access rights between the host to be added and the host to which the interface of the service call that can be deployed on the host to be added belongs, and output the query results for relevant personnel to view. In this way, relevant personnel can open access rights when it is determined according to the query results that there is no access right between the relevant hosts, so as to avoid the problem that the service instance cannot obtain host resource support in time due to the lack of access right between the hosts, resulting in the failure of the service instance to run. The technical solution provided in the embodiment of the present application is a pre-query verification solution, which performs query verification on the availability of the internal interface called by the service, which is conducive to improving the health maintenance effect of the service.

[0142] An embodiment of the present application also provides an electronic device, including a processor and a memory, wherein the memory stores programs or instructions that can be executed on the processor. When the program or instructions are executed by the processor, the various steps of the above-mentioned query method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, they are not repeated here.

[0143] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned query method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0144] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0145] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM, RAM, disk, CD, etc., including a number of instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.

[0146] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A query method, characterized in that: The method comprises: Receive input query information; wherein the query information includes: address information of a first interface or address information of a host to be added, the first interface being a calling interface to be configured for a first service; According to the query information, query whether there is access permission between the first host and at least one second host to obtain a query result; wherein, in the case where the query information includes the address information of the first interface, the first host is the host to which the first interface belongs, and the second host is the host to which the first service belongs; in the case where the query information includes the address information of the host to be added, the first host is the host to be added, and the second host is the host to which the second interface called by the second service that can be deployed on the host to be added belongs, and according to the relationship between the called interface and the host to which the interface belongs, form standardized configuration information, the standardized configuration information includes an interface grouping label, a KEY value of the interface address within the interface group, a host resource where the service corresponding to the interface within the interface group is located, a transmission protocol adopted by the host and a classification basis of the interface address within the interface group, wherein the KEY value is used to identify whether the interface address affects the integrity of the business process; Output the query results.

2. The query method according to claim 1, characterized in that: After outputting the query result, the query method further includes: When the query result indicates that there is no access permission between the first host and the second host, sending the query result to the first account; Among them, when the query information includes the address information of the first interface, the first account is an operation and maintenance personnel account, and the address information of the first interface is input through a developer account; when the query information includes the address information of the host to be added, the first account is a developer account, and the address information of the host to be added is input through an operation and maintenance personnel account.

3. The query method according to claim 1, characterized in that: In a case where the query information includes the address information of the first interface, determining whether the first host has access rights with at least one second host according to the query information includes: Obtaining the IP address or domain name address in the address information of the first interface; Determine a first interface group corresponding to the IP address or the domain name address; wherein the first interface group is one of at least one interface group, each of the interface groups includes interface addresses having the same IP address and / or the same domain name address, and the interfaces corresponding to the interface addresses in each of the interface groups are all interfaces that need to be called by the first service; Determining whether the first interface group has an interface address that matches the address information of the first interface; If so, it is determined that the first host and the second host have access rights.

4. The query method according to claim 3, characterized in that: After determining whether the first interface group has an interface address that matches the address information of the first interface, the query method further includes: In the case that there is no interface address in the first interface group that matches the address information of the first interface, determining the address of the first host and the address of the second host; In the pre-recorded access permission relationship information between hosts, it is determined whether the first host and the second host have access permission based on the address of the first host and the address of the second host.

5. The query method according to claim 1, characterized in that: In a case where the query information includes the address information of the host to be added, determining whether the first host has access rights with at least one second host according to the query information includes: Obtain at least one interface group corresponding to the second service; wherein each of the interface groups includes interface addresses having the same IP address and / or the same domain name address, and host address information to which the interface addresses belong, and the interfaces corresponding to the interface addresses in each of the interface groups are all interfaces that the second service needs to call; Determine, according to the interface grouping, address information of a second host to which the second interface called by the second service belongs; In the pre-recorded access permission relationship information between hosts, it is determined whether the host to be added has access permission with the second host according to the address information of the host to be added and the address information of the second host.

6. The query method according to claim 5, characterized in that: After determining whether the host to be added has access rights with the second host according to the address information of the host to be added and the address information of the second host in the pre-recorded access rights relationship information between the hosts, the query method further includes: In the case where it is determined that there is no access permission between the host to be added and the second host, it is determined whether the second interface corresponding to the second host is a key interface, and the determination result is added to the query result.

7. A query device, characterized in that: The device comprises: A receiving module, configured to receive input query information; wherein the query information includes: address information of a first interface or address information of a host to be added, wherein the first interface is a calling interface to be configured for a first service; A query module, used to query whether there is access permission between the first host and at least one second host according to the query information, and obtain a query result; wherein, when the query information includes the address information of the first interface, the first host is the host to which the first interface belongs, and the second host is the host to which the first service belongs; when the query information includes the address information of the host to be added, the first host is the host to be added, and the second host is the host to which the second interface called by the second service that can be deployed on the host to be added belongs, and according to the relationship between the calling interface and the host to which the interface belongs, form standardized configuration information, the standardized configuration information includes an interface grouping label, a KEY value of the interface address within the interface group, a host resource where the service corresponding to the interface within the interface group is located, a transmission protocol adopted by the host and a classification basis of the interface address within the interface group, wherein the KEY value is used to identify whether the interface address affects the integrity of the business process; Output module, used to output query results.

8. The query device according to claim 7, characterized in that: The query device also includes: A sending module, configured to send the query result to the first account if the query result indicates that there is no access permission between the first host and the second host; Among them, when the query information includes the address information of the first interface, the first account is an operation and maintenance personnel account, and the address information of the first interface is input through a developer account; when the query information includes the address information of the host to be added, the first account is a developer account, and the address information of the host to be added is input through an operation and maintenance personnel account.

9. The query device according to claim 7, characterized in that: The query module includes: A first acquiring unit, configured to acquire an IP address or a domain name address in the address information of the first interface when the query information includes the address information of the first interface; A first determining unit is used to determine a first interface group corresponding to the IP address or the domain name address; wherein the first interface group is one of at least one interface group, each of the interface groups includes interface addresses having the same IP address and / or the same domain name address, and the interfaces corresponding to the interface addresses in each of the interface groups are interfaces that need to be called by the first service; a second determining unit, configured to determine whether the first interface group has an interface address that matches the address information of the first interface; The third determining unit is configured to determine, if the access permission exists between the first host and the second host.

10. The query device according to claim 9, characterized in that: The query device also includes: a first determining module, configured to determine the address of the first host and the address of the second host when there is no interface address matching the address information of the first interface in the first interface group; The second determination module is used to determine whether the first host and the second host have access rights according to the address of the first host and the address of the second host in the pre-recorded access rights relationship information between the hosts.

11. The query device according to claim 7, characterized in that: The query module includes: A second acquisition unit is used to acquire at least one interface group corresponding to the second service when the query information includes the address information of the host to be added; wherein each of the interface groups includes interface addresses with the same IP address and / or the same domain name address, and the host address information to which the interface address belongs, and the interfaces corresponding to the interface addresses in each of the interface groups are all interfaces that need to be called by the second service; a fourth determining unit, configured to determine, according to the interface grouping, address information of a second host to which the second interface called by the second service belongs; The fifth determining unit is used to determine whether the host to be added has access rights with the second host according to the address information of the host to be added and the address information of the second host in the pre-recorded access rights relationship information between the hosts.

12. The query device according to claim 11, characterized in that: The query device also includes: The third determination module is used to determine whether the second interface corresponding to the second host is a key interface when it is determined that there is no access permission between the host to be added and the second host, and add the determination result to the query result.

13. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the query method according to any one of claims 1 to 6 are implemented.

14. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the query method according to any one of claims 1 to 6 are implemented.