Interface calling management method and device

By selecting an appropriate working cluster to process the interface call results in a high-concurrency scenario and triggering elastic protection logic, the system performance degradation and asynchronous call management problems are solved, and the system's processing capability and response speed are improved.

CN119342127APending Publication Date: 2025-01-21KE COM (BEIJING) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411508896.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

In high concurrency scenarios, asynchronous calls of the main process core interface and non-core interface lead to degradation of system performance, high thread management costs, and prone to deadlocks and data aggregation delays.

Method used

Select a working cluster by task number, send the interface call result to the corresponding working cluster, and trigger elastic protection logic based on the result statistics, including circuit breaker, current limiting, downgrading, and thermal parameter processing.

Benefits of technology

It improves the system's response speed to business requests, avoids tasks being concentrated on a small number of working clusters, makes full use of the resources of each working cluster, and reduces the risk of data transmission errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119342127A_ABST
    Figure CN119342127A_ABST
Patent Text Reader

Abstract

The invention provides an interface calling management method and device, and the method comprises the steps: selecting a work cluster according to a task number corresponding to an interface calling result; wherein the interface calling result is obtained by calling a corresponding interface based on the received service calling request; and sending the interface calling result to the correspondingly selected working cluster based on the network connection identifier of the working cluster obtained from the configuration management cluster in advance, the network connection identifier of the working cluster being reported to the configuration management cluster by each working cluster. According to the method, the working clusters are quickly determined through the task numbers, the time overhead of task allocation is reduced, the network connection identifiers are actively reported to the configuration management cluster through the working clusters, and the working cluster network connection identifiers obtained from the configuration management cluster are ensured to be accurate and reliable, so that the interface calling result is sent to the accurately selected working cluster; on the basis of ensuring the accurate processing of the task, the target accuracy of data transmission is ensured, and the risk of data transmission errors is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of interface calling, and in particular to an interface calling management method and device. Background Art

[0002] In high-concurrency scenarios, the performance of the core interface of the main process is generally required to be relatively high, but the main process also needs to asynchronously call other non-core interfaces to fill in the missing data of the core interface, and finally quickly aggregate all this data and return it to the caller. For example, when using an app to query a certain house data, the core interface obtains the basic information of the house, and also needs to obtain the non-core data of education, transportation, life, medical care and other ancillary data associated with the house.

[0003] At present, the common way to handle asynchronous calls between the main process core interface and non-core interface to complete data in high-concurrency scenarios is usually to use traditional multi-threaded asynchronous processing or message queue mechanism.

[0004] However, for multi-threaded asynchronous processing, due to the high cost of thread creation and management, it may consume a lot of system resources under high concurrency, resulting in system performance degradation or even crash, and the synchronization and communication between threads are relatively complex, prone to deadlock and other problems. At the same time, it is difficult to handle the complex dependencies between non-core interfaces, making it difficult to achieve efficient call management.

[0005] In addition, although asynchronous processing can be achieved for the message queue mechanism, the introduction of the message queue will increase the complexity of the system and require additional configuration and management. At the same time, message delays may lead to untimely data aggregation, affecting user experience. Moreover, it is difficult to implement statistics such as the number of interface calls and failure rates, as well as hot parameter identification and cluster-level interface downgrade and current limiting operations based on policies. Summary of the invention

[0006] The present invention provides an interface call management method and device, which are used to solve the defects in the prior art that the call volume is large and the combination of asynchronous interface dependencies is multiple, resulting in system performance degradation or even crash, and realize asynchronous calling of non-core interfaces in the main process.

[0007] The present invention provides an interface call management method, comprising: selecting a working cluster according to a task number corresponding to an interface call result; wherein the interface call result is obtained by calling a corresponding interface based on a received business call request; based on a network connection identifier of the working cluster previously obtained from a configuration management cluster, sending the interface call result to the corresponding selected working cluster, wherein the network connection identifier of the working cluster is reported by each working cluster to the configuration management cluster.

[0008] According to an interface call management method provided by the present invention, after sending the interface call result to the corresponding selected working cluster based on the network connection identifier of the working cluster previously obtained from the configuration management cluster, the method includes: receiving result statistics sent by the working cluster, the result statistics are obtained by the working cluster based on the received interface call result statistics; according to the result statistics, triggering and executing elastic protection logic, the elastic protection logic is obtained based on the configuration data sent by the configuration management cluster, the configuration data is configured by the page control platform of the configuration management cluster based on the interface conditions when the system faces pressure, failure and abnormal conditions and sent to the configuration management cluster.

[0009] According to an interface call management method provided by the present invention, the configuration data includes fuse configuration data, current limiting configuration data, degradation configuration data and thermal parameter configuration data, and the elastic protection logic includes fuse logic, current limiting logic, degradation logic and thermal parameter processing logic; According to the result statistical data, the elastic protection logic is triggered and executed, including: when it is determined that the interface call failure rate within the first target time in the result statistical data meets the fuse threshold, the fuse logic is triggered and executed; when it is determined that the interface call failure rate within the second target time in the result statistical data meets the downgrade threshold, the downgrade logic is triggered and executed; wherein the second target time is greater than the first target time; when it is determined that the interface call frequency within the third target time in the result statistical data meets the current limiting threshold, the current limiting logic is triggered and executed; when it is determined that there are statistical data in the statistical data that meet the hot parameter trigger condition of the hot parameter configuration data, the corresponding hot parameter processing logic is triggered and executed.

[0010] According to an interface call management method provided by the present invention, the result statistical data is sent by the working cluster when there is statistical data in the result statistical data that is greater than or equal to a preset threshold.

[0011] According to an interface call management method provided by the present invention, before sending the interface call result to the corresponding selected working cluster based on the network connection identifier of the working cluster previously obtained from the configuration management cluster, the method includes: monitoring the configuration management cluster to obtain the network connection identifier and configuration data of the working cluster; and / or receiving the network connection identifier and configuration data of the working cluster pushed by the configuration management cluster.

[0012] According to an interface call management method provided by the present invention, the network connection identifier of the working cluster is the network connection identifier of the working cluster updated by the configuration management cluster based on heartbeat detection with each working cluster, and the network connection identifier includes the Internet Protocol IP address and port of the corresponding working cluster.

[0013] According to an interface call management method provided by the present invention, a working cluster is selected according to the task number corresponding to the interface call result, including: hashing the task number corresponding to the interface call result to obtain a hash value; performing a modulus operation on the hash value to obtain a modulus value; and selecting the number of the corresponding working cluster according to the modulus value to obtain the corresponding working cluster.

[0014] According to an interface call management method provided by the present invention, before selecting a working cluster according to a task number corresponding to an interface call result, the method includes: receiving a business call request; performing task scheduling according to the business call request and in combination with a previously configured asynchronous interface call relationship to obtain a task scheduling result, wherein the task scheduling result includes an interface call sequence and an interface call logic; performing a task call according to the task scheduling result to obtain an interface call result.

[0015] The present invention also provides an interface call management device, including: a cluster selection module, which selects a working cluster according to the task number corresponding to the interface call result; wherein the interface call result is obtained by calling the corresponding interface based on the received business call request; a result sending module, which sends the interface call result to the corresponding selected working cluster based on the network connection identifier of the working cluster previously obtained from the configuration management cluster, and the network connection identifier of the working cluster is reported by each working cluster to the configuration management cluster.

[0016] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the interface call management method described above is implemented.

[0017] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the interface call management method described in any one of the above methods is implemented.

[0018] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the interface call management method described above is implemented.

[0019] The interface call management method and device provided by the present invention select a working cluster by a task number so as to quickly determine the working cluster that processes the task after receiving a business call request, thereby reducing the time overhead of task allocation and improving the response speed of the system to business requests. Moreover, by reasonably allocating working clusters, it is avoided that tasks are concentrated on a small number of working clusters, so as to make full use of the resources of each working cluster and improve the processing capacity and efficiency of the overall system; each working cluster actively reports a network connection identifier to a configuration management cluster, so that the configuration management cluster can timely understand the status and availability of the working cluster, ensure that the information in the configuration management cluster is up to date, and facilitate effective cluster management; by obtaining the working cluster network connection identifier of the configuration management cluster, so as to facilitate sending the interface call result to the accurately selected working cluster, so as to ensure accurate processing of the task, while ensuring the target accuracy of data transmission and reducing the risk of data transmission errors. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0021] Figure 1 This is one of the flow charts of the interface call management method provided by the present invention; Figure 2 It is a schematic diagram of the architecture of the interface call management method provided by the present invention; Figure 3 It is an asynchronous interface call relationship diagram provided by the present invention; Figure 4 This is the second flow chart of the interface call management method provided by the present invention; Figure 5 It is a structural diagram of the interface call management device provided by the present invention; Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0023] Figure 1This is one of the flow charts of the interface call management method provided by the present invention, such as Figure 1 As shown, the execution subject of the method is the client management component, and the method includes: S11, selecting a working cluster according to the task number corresponding to the interface call result; wherein the interface call result is obtained by calling the corresponding interface based on the received business call request; S12, based on the network connection identifier of the working cluster previously obtained from the configuration management cluster, sending the interface call result to the corresponding selected working cluster, the network connection identifier of the working cluster is reported by each working cluster to the configuration management cluster.

[0024] It should be noted that the step numbers "S1N" in this manual do not represent the order of the interface call management method. Figure 2-Figure 4 The interface call management method of the present invention is described.

[0025] Step S11, selecting a working cluster according to the task number corresponding to the interface call result; wherein the interface call result is obtained by calling the corresponding interface based on the received service call request.

[0026] In this embodiment, a working cluster is selected according to the task number corresponding to the interface call result, including: hashing the task number corresponding to the interface call result to obtain a hash value; performing a modulus operation on the hash value to obtain a modulus value; and selecting the corresponding working cluster number according to the modulus value to obtain the corresponding working cluster.

[0027] It should be added that the work cluster can adopt the worker cluster under the netty architecture. In addition, through hash processing and modulo operation, a corresponding relationship is established between the task number and the work cluster number to ensure that the interface call result corresponding to the task number can be reasonably allocated to the corresponding work cluster, avoiding the situation where the load of individual work clusters is too high while other work clusters are idle, thereby maintaining load balance to a certain extent, improving the overall processing capacity of the system, and reducing the impact of a single cluster failure on the system, improving the availability of the system. When it is necessary to increase the work cluster, you only need to adjust the base of the modulo operation (that is, the number of clusters), and the new task can be automatically allocated to the newly added work cluster, so that the system can easily cope with the growing business needs.

[0028] In an alternative embodiment, reference Figure 2, before selecting the working cluster according to the task number corresponding to the interface call result, it includes: receiving the business call request; according to the business call request, combined with the previously configured asynchronous interface call relationship, performing task scheduling to obtain the task scheduling result, the task scheduling result includes the interface call sequence and the interface call logic; performing task calling according to the task scheduling result to obtain the interface call result. It should be noted that when the mainstream program uses the client management component, the client management component combines different interfaces according to the business call request, and sends the results of each interface call to the corresponding working cluster, so as to realize cluster-dimensional monitoring and availability guarantee of the interface, realize isolation between interfaces, and make the whole process efficient, controllable, simple and easy to use.

[0029] In addition, refer to Figure 3 The asynchronous interface calling relationship includes multiple interfaces executed serially in sequence, multiple interfaces executed in parallel, a single interface executed in parallel after the completion of multiple interfaces, at least two interfaces executed in parallel before executing a single interface, at least two interfaces executed after any one of them is executed, a single interface executed after a single interface is executed, at least two groups of interfaces executed after all are executed, a single interface executed after any one of at least two groups of interfaces is executed, a single interface executed after a single interface is executed, at least two interfaces executed in parallel before executing a single interface, and at least two interfaces executed in parallel before executing a single interface.

[0030] Furthermore, each interface group in at least two groups of interfaces is composed of at least two interfaces connected in series. In addition, in at least two combinations of interfaces, one combination of interfaces can be at least three interfaces connected in series, and one combination of interfaces can be a single interface executed after multiple interfaces are executed in parallel before executing a single interface, or a single interface executed after any one of multiple interfaces is executed before executing a single interface. Specifically, the asynchronous interface call relationship can be set according to the actual design task requirements, and is not further limited here.

[0031] In an optional embodiment, when calling a task according to the task scheduling result, the method further includes: performing serialization and deserialization operations to ensure that the format of the data is correct during transmission and processing.

[0032] In an optional embodiment, when calling a task according to the task scheduling result, it also includes: performing timeout control, if the interface call is not responded within the specified time, taking corresponding measures to avoid long waiting time.

[0033] It should be noted that asynchronous callbacks are supported during the call process, so that the caller can wait for the result and continue to perform other operations without blocking the main thread. In addition, task scheduling, task calling, serialization and deserialization, timeout control, and asynchronous callbacks can introduce pre-configured packages in preset file formats, such as Java archive files (JAR for short).

[0034] Step S12, based on the network connection identifier of the working cluster previously obtained from the configuration management cluster, the interface call result is sent to the corresponding selected working cluster, and the network connection identifier of the working cluster is reported by each working cluster to the configuration management cluster.

[0035] It should be noted that, according to the selected working cluster, the corresponding network connection identifier connection is selected from the network connection identifier of the working cluster reported by the working cluster to send the interface call result to the corresponding working cluster. In addition, the network connection identifier is reported to the configuration management cluster through the working cluster, so that when the working cluster needs to be increased, it is only necessary to report the network connection identifier to the configuration management cluster, so that the system has good scalability and is convenient for coping with the growing business needs and data processing volume. In addition, as a global public configuration center, the configuration management cluster can use an etcd cluster to facilitate all clients to read the same configuration data and the network connection identifier of the working cluster.

[0036] In an alternative embodiment, reference Figure 4 , after sending the interface call result to the corresponding selected working cluster based on the network connection identifier of the working cluster obtained from the configuration management cluster in advance, it includes: receiving the result statistics sent by the working cluster, the result statistics are obtained by the working cluster based on the received interface call result statistics; according to the result statistics, triggering and executing the elastic protection logic, the elastic protection logic is obtained based on the configuration data sent by the configuration management cluster in advance, and the configuration data is configured by the page control platform of the configuration management cluster based on the interface conditions when the system faces pressure, failure and abnormal conditions and sent to the configuration management cluster.

[0037] It should be added that the result statistics are sent to the client by the working cluster based on the target time interval. The target time interval can be set based on actual design requirements, such as 100ms or 1s, etc., and is not further limited here.

[0038] In addition, based on the result statistical data, the elastic protection logic is triggered and executed, including: based on the existence of statistical data in the result statistical data that is greater than or equal to the preset threshold, the elastic protection logic is triggered and executed. The preset threshold can be set according to the actual statistical data involved, such as the call failure rate reaches a certain value, or the interface call volume exceeds the load threshold, etc., which is not further limited here, and the preset threshold can be pre-configured in the configuration management cluster to facilitate centralized management of threshold settings, ensuring that it can better adapt to different business scenarios and data characteristics and reduce maintenance costs.

[0039] In addition, the working cluster is based on a preset protocol to quickly collect statistical data. The preset protocol can be defined based on the actual design format, such as reducing the message segment size to speed up data parsing.

[0040] In an optional embodiment, the configuration data includes fuse configuration data, current limiting configuration data, degradation configuration data and thermal parameter configuration data, and the elastic protection logic includes fuse logic, current limiting logic, degradation logic and thermal parameter processing logic.

[0041] It should be noted that the configuration data is configured through the page control platform and sent to the etcd cluster, so that the client component can read the configuration data from the etcd cluster and adjust its own behavior according to these configurations. For example, the frequency of interface calls can be controlled according to the current limiting configuration, and the fuse configuration can be used to determine when to trigger the fuse mechanism.

[0042] In addition, the fuse configuration data includes the fuse threshold, fuse strategy and fuse recovery time. The fuse threshold can be determined based on indicators such as the failure rate and response time of the interface; the fuse strategy includes fast failure and half-open state recovery. In the fast failure mode, once the fuse is triggered, the call to the interface is stopped immediately. In the half-open state recovery mode, after a period of time after the fuse is blown, a small number of attempts will be made to call the interface. If the call is successful, normal calls will be gradually restored, otherwise the fuse state will continue to remain; the fuse recovery time can be configured according to the actual time to start trying to restore the interface call, and the time can be adjusted according to the actual situation of the system to ensure that the interface call is restored as soon as possible under the premise of system stability.

[0043] The current limiting configuration data includes the current limiting strategy, current limiting threshold and the behavior after the current limiting is triggered. The current limiting strategy can include fixed window current limiting, sliding window current limiting, leaky bucket algorithm or token bucket algorithm, etc., which can be selected according to the actual scenario involved; the current limiting threshold can be set according to the maximum number of requests allowed per unit time of the interface based on the performance of the interface and the load of the system; the behavior after the current limiting is triggered includes directly rejecting the request, returning a specific error message or putting the request into a queue for processing. At the same time, the monitoring and alarm mechanism can be set during the current limiting period to detect and handle problems in a timely manner.

[0044] The downgrade configuration data includes the downgrade threshold, downgrade strategy and downgrade recovery mechanism. The downgrade threshold can be configured based on the failure rate, load reaching a certain level, etc. The downgrade strategy includes returning to the default value, using cached data, or calling the backup interface, which can be configured according to the actual design requirements. The downgrade recovery mechanism can apply for manual recovery and automatic recovery, which can be configured according to the actual recovery requirements after the conditions triggering the downgrade disappear.

[0045] The thermal parameter configuration data includes thermal parameter characteristics, trigger conditions corresponding to the thermal parameter characteristics, and thermal parameter processing methods. The thermal parameter characteristics can determine the thermal parameters that may cause performance problems based on the interface call situation. The thermal parameter trigger conditions can be determined based on the threshold of the actual thermal parameter characteristics affecting the performance problems. The thermal parameter processing method can be configured based on the actual thermal parameter characteristics, thermal parameter trigger conditions, and actual design requirements. For example, you can refer to the above-mentioned circuit breaker, current limiting, and degradation policy configurations, which will not be repeated here.

[0046] Correspondingly, according to the result statistical data, the elastic protection logic is triggered and executed, including: when it is determined that the interface call failure rate within the first target time in the result statistical data meets the fuse threshold, the fuse logic is triggered and executed; when it is determined that the interface call failure rate within the second target time in the result statistical data meets the downgrade threshold, the downgrade logic is triggered and executed; wherein the second target time is greater than the first target time; when it is determined that the interface call frequency within the third target time in the result statistical data meets the current limiting threshold, the current limiting logic is triggered and executed; when it is determined that there are statistical data in the statistical data that meet the hot parameter trigger condition of the hot parameter configuration data, the corresponding hot parameter processing logic is triggered and executed.

[0047] In an optional embodiment, before sending the interface call result to the corresponding selected working cluster based on the network connection identifier of the working cluster previously obtained from the configuration management cluster, it includes: monitoring the configuration management cluster to obtain the network connection identifier and configuration data of the working cluster; and / or receiving the network connection identifier and configuration data of the working cluster pushed by the configuration management cluster. It should be added that the network connection identifier and configuration data of the working cluster obtained by the client management component through monitoring, or the network connection identifier and configuration data of the working cluster pushed to the client management component by the configuration management cluster, are all stored in the (java virtual machine, abbreviated as JVM) java virtual machine memory of the client management component.

[0048] Furthermore, the network connection identifier of the working cluster is the network connection identifier of the working cluster updated by the configuration management cluster based on the heartbeat detection with each working cluster, and the network connection identifier includes the Internet Protocol IP address and port of the corresponding working cluster. Similarly, the configuration data can be the configuration data or updated data of the configuration management cluster based on the page console.

[0049] It should be added that the page console can use the control panel (dashbord) configuration center of the etcd cluster to intuitively understand the operating status of the system, discover problems in time and handle them. The page console can be configured differently based on different applications, and can also configure current limiting, degradation, fuses and thermal parameters of certain features at different interface dimensions. These configuration data come from the etcd cluster on the one hand to ensure consistency with the client configuration, and on the other hand, they also come from the interface call results, so that the configuration can be adjusted according to the actual situation.

[0050] In addition, a heartbeat detection mechanism is used between the configuration management cluster and each working cluster, so that when any working cluster loses connection, the corresponding network connection identifier is deleted in time to ensure that the client management component can obtain valid working cluster information.

[0051] In an optional embodiment, after the working cluster obtains result statistics based on the received interface call results, it includes: the working cluster stores the result statistics to a preset database. The preset database can be configured according to actual design requirements, such as a hive database, a mysql database, etc., and is not limited to only one step here.

[0052] In an optional embodiment, after the working cluster obtains statistical data based on the received interface call results, the method further includes: the working cluster sends the statistical data to the dashbord configuration center for display. Furthermore, the statistical data sent to the dashbord configuration center may be data stored in a preset database.

[0053] In summary, the embodiment of the present invention selects a working cluster by task number so as to quickly determine the working cluster for processing the task after receiving a business call request, thereby reducing the time overhead of task allocation and improving the response speed of the system to business requests. Moreover, by reasonably allocating working clusters, it is avoided that tasks are concentrated on a small number of working clusters, so as to make full use of the resources of each working cluster and improve the processing capacity and efficiency of the overall system. By each working cluster actively reporting the network connection identifier to the configuration management cluster, the configuration management cluster can timely understand the status and availability of the working cluster, ensure that the information in the configuration management cluster is up to date, and facilitate effective cluster management. By obtaining the working cluster network connection identifier of the configuration management cluster, the interface call result is sent to the accurately selected working cluster to ensure accurate processing of the task, while ensuring the target accuracy of data transmission and reducing the risk of data transmission errors.

[0054] The interface call management device provided by the present invention is described below. The interface call management device described below and the interface call management method described above can be referenced to each other.

[0055] Figure 5 A schematic diagram of the structure of an interface call management device is shown, the device comprising: The cluster selection module 51 selects a working cluster according to the task number corresponding to the interface call result; wherein the interface call result is obtained by calling the corresponding interface based on the received service call request; The result sending module 52 sends the interface call result to the corresponding selected working cluster based on the network connection identifier of the working cluster previously obtained from the configuration management cluster. The network connection identifier of the working cluster is reported by each working cluster to the configuration management cluster.

[0056] In this embodiment, the cluster selection module 51 includes: a hash processing unit, which performs hash processing on the task number corresponding to the interface call result to obtain a hash value; a modulus unit, which performs a modulus operation on the hash value to obtain a modulus value; and a selection unit, which selects the number of the corresponding working cluster according to the modulus value to obtain the corresponding working cluster.

[0057] In an optional embodiment, the device also includes: a request receiving module, which receives a business call request before selecting a working cluster according to the task number corresponding to the interface call result; a task scheduling module, which performs task scheduling according to the business call request and a previously configured asynchronous interface call relationship to obtain a task scheduling result, wherein the task scheduling result includes an interface call sequence and an interface call logic; and a task calling module, which performs a task call according to the task scheduling result to obtain an interface call result.

[0058] In an optional embodiment, the device further includes: a serialization and deserialization module, which performs serialization and deserialization operations when calling a task according to the task scheduling result to ensure that the data is in a correct format during transmission and processing.

[0059] In an optional embodiment, the device further includes: a timeout control module, which performs timeout control when calling a task according to the task scheduling result. If the interface call is not responded to within a specified time, corresponding measures are taken to avoid long waiting times.

[0060] It should be noted that asynchronous callbacks are supported during the call process, allowing the caller to wait for the result and continue to perform other operations without blocking the main thread.

[0061] In an optional embodiment, the device further includes: a result receiving module, which receives result statistics sent by the working cluster after sending the interface call result to the corresponding selected working cluster based on the network connection identifier of the working cluster previously obtained from the configuration management cluster, and the result statistics are obtained by the working cluster based on the received interface call result statistics; a logic execution module, which triggers and executes the elastic protection logic according to the result statistics, and the elastic protection logic is obtained based on the configuration data sent by the configuration management cluster, and the configuration data is configured by the page control platform of the configuration management cluster based on the interface conditions when the system faces pressure, failure and abnormal conditions and sent to the configuration management cluster.

[0062] It should be added that the result statistics are sent to the client by the working cluster based on the target time interval. In addition, the logic execution module is used to: trigger and execute the elastic protection logic based on the existence of statistics in the result statistics being greater than or equal to a preset threshold.

[0063] In an optional embodiment, the configuration data includes fuse configuration data, current limiting configuration data, degradation configuration data and thermal parameter configuration data, and the elastic protection logic includes fuse logic, current limiting logic, degradation logic and thermal parameter processing logic.

[0064] Correspondingly, the logic execution module is used to: trigger and execute the fuse logic when it is determined that the interface call failure rate within the first target time in the result statistical data meets the fuse threshold; trigger and execute the downgrade logic when it is determined that the interface call failure rate within the second target time in the result statistical data meets the downgrade threshold; wherein the second target time is greater than the first target time; trigger and execute the current limiting logic when it is determined that the interface call frequency within the third target time in the result statistical data meets the current limiting threshold; trigger and execute the corresponding hot parameter processing logic when it is determined that there are statistical data in the statistical data that meet the hot parameter trigger condition of the hot parameter configuration data.

[0065] In an optional embodiment, the device further includes: a monitoring module, which monitors the configuration management cluster to obtain the network connection identifier and configuration data of the working cluster before sending the interface call result to the corresponding selected working cluster based on the network connection identifier of the working cluster previously obtained from the configuration management cluster; and / or a data receiving module, which receives the network connection identifier and configuration data of the working cluster pushed by the configuration management cluster before sending the interface call result to the corresponding selected working cluster based on the network connection identifier of the working cluster previously obtained from the configuration management cluster.

[0066] Furthermore, the network connection identifier of the working cluster is the network connection identifier of the working cluster updated by the configuration management cluster based on the heartbeat detection with each working cluster, and the network connection identifier includes the Internet Protocol IP address and port of the corresponding working cluster. Similarly, the configuration data can be the configuration data or updated data of the configuration management cluster based on the page console.

[0067] In an optional embodiment, after the working cluster obtains result statistics based on the received interface call results, it includes: the working cluster stores the result statistics to a preset database. The preset database can be configured according to actual design requirements, such as a hive database, a mysql database, etc., and is not limited to only one step here.

[0068] In an optional embodiment, after the working cluster obtains statistical data based on the received interface call results, the method further includes: the working cluster sends the statistical data to the dashbord configuration center for display. Furthermore, the statistical data sent to the dashbord configuration center may be data stored in a preset database.

[0069] In summary, the embodiment of the present invention selects a working cluster according to the task number through a cluster selection module, so as to quickly determine the working cluster for processing the task after receiving a business call request, thereby reducing the time overhead of task allocation, improving the response speed of the system to business requests, and avoiding the concentration of tasks on a small number of working clusters by reasonably allocating working clusters, so as to make full use of the resources of each working cluster and improve the processing capacity and efficiency of the overall system; each working cluster actively reports the network connection identifier to the configuration management cluster, so that the configuration management cluster can timely understand the status and availability of the working cluster, ensure that the information in the configuration management cluster is the latest, and facilitate effective cluster management; the working cluster network connection identifier of the configuration management cluster is obtained through the result sending module, so as to send the interface call result to the accurately selected working cluster, so as to ensure the accurate processing of the task, while ensuring the target accuracy of data transmission and reducing the risk of data transmission errors.

[0070] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the interface call management method, which includes: selecting a working cluster according to the task number corresponding to the interface call result; wherein the interface call result is obtained by calling the corresponding interface based on the received service call request; based on the network connection identifier of the working cluster previously obtained from the configuration management cluster, the interface call result is sent to the corresponding selected working cluster, and the network connection identifier of the working cluster is reported by each working cluster to the configuration management cluster.

[0071] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0072] On the other hand, the present invention also provides a computer program product, which includes a computer program, and the computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the interface call management method provided by the above methods, and the method includes: selecting a working cluster according to the task number corresponding to the interface call result; wherein the interface call result is obtained by calling the corresponding interface based on the received business call request; based on the network connection identifier of the working cluster previously obtained from the configuration management cluster, sending the interface call result to the corresponding selected working cluster, and the network connection identifier of the working cluster is reported by each working cluster to the configuration management cluster.

[0073] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the interface call management method provided by the above-mentioned methods, the method comprising: selecting a working cluster according to the task number corresponding to the interface call result; wherein the interface call result is obtained by calling the corresponding interface based on the received business call request; and sending the interface call result to the corresponding selected working cluster based on the network connection identifier of the working cluster previously obtained from the configuration management cluster, the network connection identifier of the working cluster being reported by each working cluster to the configuration management cluster.

[0074] 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.

[0075] 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, 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, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0076] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention 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 invention.

Claims

1. An interface call management method, characterized in that: include: Selecting a working cluster according to the task number corresponding to the interface call result; wherein the interface call result is obtained by calling the corresponding interface based on the received service call request; The interface call result is sent to the corresponding selected working cluster based on the network connection identifier of the working cluster previously obtained from the configuration management cluster, where the network connection identifier of the working cluster is reported by each working cluster to the configuration management cluster.

2. The interface call management method according to claim 1, characterized in that: After sending the interface call result to the corresponding selected working cluster based on the network connection identifier of the working cluster previously obtained from the configuration management cluster, the method includes: Receiving result statistics sent by the working cluster, where the result statistics are obtained by the working cluster based on statistics of received interface call results; According to the result statistical data, the elastic protection logic is triggered and executed. The elastic protection logic is obtained based on the configuration data sent by the configuration management cluster. The configuration data is configured by the page control platform of the configuration management cluster based on the interface conditions when the system faces pressure, failure and abnormal conditions and sent to the configuration management cluster.

3. The interface call management method according to claim 2, characterized in that: The configuration data includes fuse configuration data, current limiting configuration data, degradation configuration data and thermal parameter configuration data, and the elastic protection logic includes fuse logic, current limiting logic, degradation logic and thermal parameter processing logic; According to the statistical data of the result, the elastic protection logic is triggered and executed, including: When it is determined that the interface call failure rate within the first target time in the result statistical data meets the fuse threshold, triggering and executing the fuse logic; When it is determined that the interface call failure rate within the second target time in the result statistical data meets the degradation threshold, the degradation logic is triggered and executed; wherein the second target time is greater than the first target time; When it is determined that the interface call frequency within the third target time in the result statistical data meets the current limiting threshold, triggering and executing the current limiting logic; Determine whether there is statistical data in the statistical data that meets the hot parameter triggering condition of the hot parameter configuration data, and trigger and execute the corresponding hot parameter processing logic.

4. The interface call management method according to claim 2, characterized in that: The result statistical data is sent by the working cluster when there is statistical data in the result statistical data that is greater than or equal to a preset threshold.

5. The interface call management method according to claim 1, characterized in that: Before sending the interface call result to the corresponding selected working cluster based on the network connection identifier of the working cluster previously obtained from the configuration management cluster, the method includes: Monitor the configuration management cluster to obtain the network connection identifier and configuration data of the working cluster; and / or, Receive the network connection identifier and configuration data of the working cluster pushed by the configuration management cluster.

6. The interface call management method according to claim 5, characterized in that: The network connection identifier of the working cluster is the network connection identifier of the working cluster updated by the configuration management cluster based on the heartbeat detection with each of the working clusters, and the network connection identifier includes the Internet Protocol IP address and port of the corresponding working cluster.

7. The interface call management method according to claim 1, characterized in that: The step of selecting a working cluster according to the task number corresponding to the interface call result includes: Perform hash processing on the task number corresponding to the interface call result to obtain a hash value; Performing a modulus operation on the hash value to obtain a modulus value; According to the modulus value, the number of the corresponding working cluster is selected to obtain the corresponding working cluster.

8. The interface call management method according to claim 1, characterized in that: Before selecting a working cluster according to the task number corresponding to the interface call result, the following steps are included: Receive business call requests; According to the service call request, combined with the previously configured asynchronous interface call relationship, task scheduling is performed to obtain a task scheduling result, wherein the task scheduling result includes an interface call sequence and an interface call logic; Perform task calling according to the task scheduling result to obtain an interface calling result.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the interface call management method according to any one of claims 1 to 8 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the interface call management method according to any one of claims 1 to 8 is implemented.