A resource management method and system for third-party interface services

By obtaining basic information about third-party interface services and calculating the maximum concurrency, combined with the length of the HTTP connection pool queue, resource management of third-party interface services is realized. This solves the problem of high complexity in resource management in existing technologies, ensures system stability, and reduces costs.

CN113608857BActive Publication Date: 2025-11-14BAIRONG FINANCIAL INFORMATION SERVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110926652.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-12
Publication Date
2025-11-14
Estimated Expiration
2041-08-12

AI Technical Summary

Technical Problem

Existing pooling technologies have repetitive management requirements when managing resources for third-party interface services, requiring additional thread pools for resource management and isolation. Furthermore, the combined use of two pooling technologies increases complexity.

Method used

By obtaining basic information about third-party interface services, calculating the maximum concurrency, expanding configuration parameters, and combining them with the queue length of the HTTP connection pool, resource management is achieved. A single pooling technique is used for resource isolation, service degradation, and rate limiting, reducing complexity.

Benefits of technology

It enables effective resource management of third-party interface services, ensures stable operation of system services, reduces learning and implementation costs, and simplifies the resource management process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113608857B_ABST
    Figure CN113608857B_ABST
Patent Text Reader

Abstract

This invention discloses a resource management method and system for third-party interface services. The method includes: obtaining basic information of the third-party interface service; obtaining the maximum concurrency of the third-party interface service based on the basic information; obtaining a first configuration expansion instruction; expanding the maximum concurrency based on the first configuration expansion instruction to obtain a first configuration parameter; obtaining a first queue length of the HTTP connection pool; obtaining a second configuration parameter based on the first configuration parameter and the first queue length; and managing the third-party interface service through the second configuration parameter. This invention solves the technical problems of existing pooling technologies having significant redundancy in resource management, requiring an additional thread pool for thread pool resource management and isolation, and the increased complexity of using two pooling technologies together.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of interfaces, and more particularly to a resource management method and system for third-party interface services. Background Technology

[0002] In actual production, many functional products require interfacing with numerous third-party interface services. Each of these services varies significantly in stability and throughput, yet they share the computer resources allocated to the system. Managing the computer resource usage of these services to ensure relative system stability is a crucial challenge. The management targets primarily include thread resources (computer system processes) and TCP connection resources. The objectives are resource isolation, service degradation and rate limiting, and resource reuse. When discussing resource isolation, service degradation, and rate limiting, Hystrix and Sentinel are commonly mentioned. For resource reuse in third-party interface services, the standard approach is HTTP connection pooling. Therefore, to implement resource management solutions for third-party interface services, the conventional approach is either Hystrix + HTTP connection pool or Sentinel + HTTP connection pool; these two solutions are equivalent.

[0003] However, in the process of implementing the inventive technical solution in the embodiments of this application, the inventors of this application discovered that the above-mentioned technology has at least the following technical problems:

[0004] Existing pooling technologies exhibit significant redundancy in resource management, requiring additional thread pools for thread pool resource management and isolation. Furthermore, the combined use of two pooling technologies increases technical complexity. Summary of the Invention

[0005] This application provides a resource management method and system for third-party interface services. It solves the technical problems of existing pooling technologies having significant redundancy in resource management, requiring additional thread pools for thread pool resource management and isolation, and the increased complexity of using two pooling technologies together. It achieves effective resource management for third-party interface services, realizes resource isolation, and quickly degrades and releases entry thread resources when service calls take too long, ensuring the stable operation of system services. By implementing resource management through a pooling technology, it solves the problems of resource reuse, resource isolation, service degradation, and rate limiting for third-party interface services, reduces complexity, and significantly reduces learning and implementation costs.

[0006] In view of the above problems, the present invention is proposed to provide a method for overcoming or at least partially solving the above problems.

[0007] In a first aspect, embodiments of this application provide a resource management method for third-party interface services. The method includes: obtaining basic information of the third-party interface service; obtaining the maximum concurrency of the third-party interface service based on the basic information; obtaining a first configuration expansion instruction; expanding the maximum concurrency based on the first configuration expansion instruction to obtain a first configuration parameter; obtaining a first queue length of an HTTP connection pool; obtaining a second configuration parameter based on the first configuration parameter and the first queue length; and managing the third-party interface service through the second configuration parameter.

[0008] On the other hand, this application also provides a resource management system for third-party interface services. The system includes: a first obtaining unit, which obtains basic information of the third-party interface service; a second obtaining unit, which obtains the maximum concurrency of the third-party interface service based on the basic information; a third obtaining unit, which obtains a first configuration expansion instruction and expands the maximum concurrency based on the first configuration expansion instruction to obtain a first configuration parameter; a fourth obtaining unit, which obtains a first queue length of an HTTP connection pool; a fifth obtaining unit, which obtains a second configuration parameter based on the first configuration parameter and the first queue length; and a first management unit, which manages the third-party interface service through the second configuration parameter.

[0009] Thirdly, embodiments of the present invention provide an electronic device, including a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor. The transceiver, the memory, and the processor are connected via the bus. When the computer program is executed by the processor, it implements the steps in the method for controlling output data as described above.

[0010] Fourthly, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps in the method for controlling output data described in any of the above claims.

[0011] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:

[0012] This approach involves obtaining basic information about third-party interface services; determining the maximum concurrency of the third-party interface services based on the basic information; obtaining a first configuration expansion instruction; expanding the maximum concurrency based on the first configuration expansion instruction to obtain a first configuration parameter; obtaining the first queue length of the HTTP connection pool; obtaining a second configuration parameter based on the first configuration parameter and the first queue length; and managing the third-party interface services through the second configuration parameter. This achieves effective resource management of the third-party interface services, realizing resource isolation, rapid degradation and release of entry thread resources when service calls take too long, ensuring the stable operation of system services. By implementing resource management through a pooling technology, it solves the problems of resource reuse, resource isolation, service degradation, and rate limiting for third-party interface services, reducing complexity and significantly lowering learning and implementation costs.

[0013] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0014] Figure 1 This is a flowchart illustrating a resource management method for third-party interface services according to an embodiment of this application;

[0015] Figure 2 This is a schematic diagram illustrating the process of obtaining the first queue length of the HTTP connection pool in a resource management method for third-party interface services according to an embodiment of this application.

[0016] Figure 3 This is a schematic diagram of a process for obtaining the length of the first queue in a resource management method for third-party interface services according to an embodiment of this application;

[0017] Figure 4 This is a flowchart illustrating the process of obtaining the first queue length calculation formula in a resource management method for third-party interface services according to an embodiment of this application.

[0018] Figure 5 This is a flowchart illustrating the process of obtaining a first error instruction in a resource management method for third-party interface services according to an embodiment of this application.

[0019] Figure 6 This is a schematic diagram of the process for managing the third-party interface service in a resource management method for third-party interface services according to an embodiment of this application;

[0020] Figure 7 This is a schematic diagram of the structure of a resource management system for third-party interface services according to an embodiment of this application;

[0021] Figure 8 This is a schematic diagram of the structure of an electronic device for executing a method for controlling output data, provided in an embodiment of this application.

[0022] Explanation of reference numerals in the attached drawings: First obtaining unit 11, second obtaining unit 12, third obtaining unit 13, fourth obtaining unit 14, fifth obtaining unit 15, first management unit 16, bus 1110, processor 1120, transceiver 1130, bus interface 1140, memory 1150, and user interface 1160. Detailed Implementation

[0023] In the description of the embodiments of the present invention, those skilled in the art should understand that the embodiments of the present invention can be implemented as methods, apparatuses, electronic devices, and computer-readable storage media. Therefore, the embodiments of the present invention can be specifically implemented in the following forms: entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software. Furthermore, in some embodiments, the embodiments of the present invention can also be implemented as a computer program product in one or more computer-readable storage media, the computer-readable storage media containing computer program code.

[0024] The aforementioned computer-readable storage medium may be any combination of one or more computer-readable storage media. Computer-readable storage media include: electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of computer-readable storage media include: portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, flash memory, optical fiber, optical disc read-only memory, optical storage devices, magnetic storage devices, or any combination thereof. In embodiments of the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0025] Application Overview

[0026] The embodiments of the present invention describe the provided methods, apparatus, and electronic devices through flowcharts and / or block diagrams.

[0027] It should be understood that each block of a flowchart and / or block diagram, as well as combinations of blocks in a flowchart and / or block diagram, can be implemented by computer-readable program instructions. These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine that, when executed by a computer or other programmable data processing apparatus, creates means for implementing the functions / operations specified in the blocks of the flowchart and / or block diagram.

[0028] These computer-readable program instructions may also be stored in a computer-readable storage medium that enables a computer or other programmable data processing device to function in a particular manner. In this way, the instructions stored in the computer-readable storage medium produce an instruction apparatus product that includes the functions / operations specified in the blocks of a flowchart and / or block diagram.

[0029] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus or other device to produce a computer-implemented process, such that the instructions that execute on the computer or other programmable data processing apparatus provide a process for implementing the functions / operations specified in the blocks of the flowchart and / or block diagram.

[0030] The embodiments of the present invention will now be described with reference to the accompanying drawings.

[0031] Example 1

[0032] like Figure 1 As shown in the figure, this application embodiment provides a resource management method for third-party interface services, wherein the method includes:

[0033] Step S100: Obtain basic information about the third-party interface service;

[0034] Step S200: Obtain the maximum concurrency of the third-party interface service based on the basic information;

[0035] Step S300: Obtain a first configuration expansion instruction, and expand the maximum concurrency according to the first configuration expansion instruction to obtain the first configuration parameter;

[0036] Specifically, the basic information of the third-party interface service includes its performance characteristics and access volume, including monitoring information from actual production. For each third-party interface service, based on its performance characteristics and access volume, the maximum concurrency of the service is obtained, i.e., the number of connections simultaneously accessing the server site. This is generally an estimated value before production deployment and can be dynamically adjusted later. The maximum concurrency is expanded according to the first configuration expansion instruction to obtain the first configuration parameter, i.e., the maximum number of connections configuration. For example, if the maximum concurrency of calling a certain third-party interface service is 50, to cope with business growth or sudden traffic surges, we can redundantly configure the maximum number of connections in the connection pool to three times the maximum concurrency, i.e., set it to 150.

[0037] Step S400: Obtain the length of the first queue of the HTTP connection pool;

[0038] like Figure 2 As shown, furthermore, in the embodiment of this application, step S400, which involves obtaining the first queue length of the HTTP connection pool, further includes:

[0039] Step S410: Obtain the first waiting time of the third-party interface service;

[0040] Step S420: Obtain the length of the first queue based on the first waiting time.

[0041] Specifically, when using an HTTP connection pool, in addition to connections within the maximum connection limit occupying the entry thread, requests in the queue waiting to acquire connections also occupy the entry thread. The theoretical approximation of the queue length is the number of requests received within the waiting time, proving that resource consumption is controllable. The first waiting time for the third-party interface service is the waiting time to acquire a connection from the connection pool, which is an influencing parameter of the first queue length and affects the final queue length value. A uniform waiting time for acquiring a connection from the connection pool is set. Since the maximum connection limit has been redundantly set, if a request enters the waiting state, it is considered that the third-party interface service is responding slowly and needs to be traffic-limited and fail quickly to release the entry thread. Therefore, this waiting time needs to be set relatively small. If necessary, the waiting time parameter value can be directly modified to achieve a more accurate calculation of the queue length value, thereby achieving the technical effect of managing computer resources.

[0042] Step S500: Obtain the second configuration parameter based on the first configuration parameter and the first queue length;

[0043] Specifically, a second configuration parameter is obtained based on the first configuration parameter and the first queue length. The third-party interface service is managed through the second configuration parameter. That is, the number of entry threads occupied by the third-party interface service with the highest access volume is the maximum number of connections configuration plus the queue length value.

[0044] Step S600: Manage the third-party interface service using the second configuration parameters.

[0045] like Figure 6 As shown, furthermore, in the step S600 of this embodiment of the application, which involves managing the third-party interface service through the second configuration parameters, the following additional steps are included:

[0046] Step S610: Configure the first HTTP connection pool using the second configuration parameters;

[0047] Step S620: Bind the first HTTP connection pool to the third-party interface service;

[0048] Step S630: Manage the third-party interface service through the first HTTP connection pool.

[0049] Specifically, the parameters of the first HTTP connection pool are configured through the second configuration parameters. Since each third-party interface service has its own dedicated connection pool, the maximum number of connections per route is set to the same value as the maximum number of connections in the connection pool, both being set to the `maxTotal` value. The first HTTP connection pool is then bound to the third-party interface service, and the service is managed through the first HTTP connection pool, i.e., resource management is achieved using HTTP connection pool technology. This achieves the technical effect of reducing complexity and ensuring stable operation of system services by using only HTTP connection pool technology for resource management.

[0050] like Figure 3 As shown, furthermore, step S420 of this application embodiment also includes:

[0051] Step S421: Obtain the number of requests per second for the third-party interface service;

[0052] Step S422: Obtain the first queue length based on the first waiting time and the number of requests per second.

[0053] Specifically, the theoretical approximation of the queue length is the number of requests received within the waiting time. The number of requests per second of the third-party interface service is the number of requests that need to be processed per second. It is an influencing parameter of the first queue length, affecting the final queue length value, thereby achieving a more accurate calculation of the queue length value and thus managing computer resources.

[0054] like Figure 4 As shown, further, wherein, in the step of obtaining the first queue length based on the first waiting time and the number of requests per second, step S422 of this application embodiment further includes:

[0055] Step S4221: Calculate the length of the first queue using the following formula:

[0056] l = at

[0057] Where l is the length of the first queue, a is the number of requests per second, and t is the first waiting time.

[0058] Specifically, the first queue length is calculated as the product of the number of requests per second and the first waiting time. For example, the number of requests per second for the most frequently accessed third-party interface service is 60 (this value is generally 2 to 3 times the maximum value in historical statistics; redundancy is to cope with business growth and sudden traffic spikes). The waiting time for obtaining a connection from the connection pool (connectionRequestTimeout in the configuration) is uniformly set to 100 milliseconds. For the above two parameter values, we can use the queue length calculation formula l = at, inputting the parameter values ​​i.e., 60 * 100 milliseconds / 1 second, to calculate the theoretical queue length as 6. This achieves a more accurate determination of the number of entry threads, thereby managing computer resources more effectively.

[0059] like Figure 5 As shown, furthermore, step S420 of this application embodiment also includes:

[0060] Step S423: Obtain the first predetermined request time threshold;

[0061] Step S424: Determine whether the first waiting time meets the first predetermined request time threshold;

[0062] Step S425: When the first waiting time meets the first predetermined request time threshold, a first error instruction is obtained;

[0063] Step S426: Manage the third-party interface service according to the first error instruction.

[0064] Specifically, the first predetermined request time threshold is a range of preset request waiting times. If the time exceeds this range, the request will take too long, resulting in an error. The system determines whether the first waiting time meets the first predetermined request time threshold. If it does, meaning the request time exceeds the preset range, a first error instruction is issued. This is because the theoretical approximation of the queue length is the number of requests received within the waiting time, but requests exceeding this time will quickly fail and return an error. Based on the first error instruction, the first third-party interface service is managed; if a request fails, resources are quickly released to prevent prolonged resource occupation due to timeout. This achieves the technical effect of ensuring stable system operation by preventing request timeouts from consuming service resources.

[0065] In summary, the resource management method and system for third-party interface services provided in this application have the following technical effects:

[0066] This approach involves obtaining basic information about third-party interface services; determining the maximum concurrency of the third-party interface services based on the basic information; obtaining a first configuration expansion instruction; expanding the maximum concurrency based on the first configuration expansion instruction to obtain a first configuration parameter; obtaining the first queue length of the HTTP connection pool; obtaining a second configuration parameter based on the first configuration parameter and the first queue length; and managing the third-party interface services through the second configuration parameter. This achieves effective resource management of the third-party interface services, realizing resource isolation, rapid degradation and release of entry thread resources when service calls take too long, ensuring the stable operation of system services. By implementing resource management through a pooling technology, it solves the problems of resource reuse, resource isolation, service degradation, and rate limiting for third-party interface services, reducing complexity and significantly lowering learning and implementation costs.

[0067] Example 2

[0068] Based on the same inventive concept as the resource management method for third-party interface services in the foregoing embodiments, this invention also provides a resource management system for third-party interface services, such as... Figure 7 As shown, the system includes:

[0069] The first obtaining unit 11 is used to obtain basic information of the third-party interface service;

[0070] The second obtaining unit 12 is used to obtain the maximum concurrency of the third-party interface service based on the basic information;

[0071] The third obtaining unit 13 is used to obtain a first configuration expansion instruction, expand the maximum concurrency according to the first configuration expansion instruction, and obtain the first configuration parameters;

[0072] The fourth obtaining unit 14 is used to obtain the first queue length of the HTTP connection pool;

[0073] The fifth obtaining unit 15 is used to obtain the second configuration parameter based on the first configuration parameter and the first queue length;

[0074] The first management unit 16 is used to manage the third-party interface service through the second configuration parameters.

[0075] Furthermore, the system also includes:

[0076] The sixth obtaining unit is used to obtain the first waiting time of the third-party interface service;

[0077] The seventh obtaining unit is used to obtain the first queue length based on the first waiting time.

[0078] Furthermore, the system also includes:

[0079] The eighth obtaining unit is used to obtain the number of requests per second of the third-party interface service;

[0080] The ninth obtaining unit is used to obtain the first queue length based on the first waiting time and the number of requests per second.

[0081] Furthermore, the system also includes:

[0082] The first calculation unit is used to calculate the length of the first queue using a formula.

[0083] Furthermore, the system also includes:

[0084] The tenth obtaining unit is used to obtain a first predetermined request time threshold.

[0085] The first judgment unit is used to determine whether the first waiting time meets the first predetermined request time threshold.

[0086] The eleventh obtaining unit is used to obtain a first error instruction when the first waiting time meets the first predetermined request time threshold.

[0087] The second management unit is used to manage the third-party interface service according to the first error instruction.

[0088] Furthermore, the system also includes:

[0089] A first configuration unit is configured to configure a first HTTP connection pool using the second configuration parameters.

[0090] The first binding unit is used to bind the first HTTP connection pool to the third-party interface service;

[0091] The third management unit is used to manage the third-party interface service through the first HTTP connection pool.

[0092] The foregoing Figure 1The various variations and specific examples of the resource management method for third-party interface services in Embodiment 1 are also applicable to the resource management system for third-party interface services in this embodiment. Through the foregoing detailed description of the resource management method for third-party interface services, those skilled in the art can clearly understand the implementation method of the resource management system for third-party interface services in this embodiment. Therefore, for the sake of brevity, it will not be described in detail here.

[0093] Furthermore, embodiments of the present invention also provide an electronic device, including a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor. The transceiver, the memory, and the processor are respectively connected via the bus. When the computer program is executed by the processor, it implements the various processes of the above-described method embodiments for controlling output data and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0094] Exemplary electronic devices

[0095] For details, see Figure 8 As shown, this embodiment of the invention also provides an electronic device, which includes a bus 1110, a processor 1120, a transceiver 1130, a bus interface 1140, a memory 1150, and a user interface 1160.

[0096] In this embodiment of the invention, the electronic device further includes a computer program stored in a memory 1150 and executable on a processor 1120, wherein the computer program, when executed by the processor 1120, implements the various processes of the method embodiment described above for controlling output data.

[0097] Transceiver 1130 is used to receive and send data under the control of processor 1120.

[0098] In this embodiment of the invention, a bus architecture (represented by bus 1110) is used. Bus 1110 may include any number of interconnected buses and bridges. Bus 1110 connects various circuits, including one or more processors represented by processor 1120 and memory represented by memory 1150.

[0099] Bus 1110 represents one or more of several types of bus architectures, including memory buses and memory controllers, peripheral buses, accelerated graphics ports, processors, or local buses using any bus architecture from various bus architectures. As an example and not a limitation, such architectures include: industry-standard architecture buses, microchannel architecture buses, extended buses, video electronics standards associations, and peripheral interconnect buses.

[0100] Processor 1120 can be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method embodiments can be completed by integrated logic circuits in the processor hardware or by instructions in software form. The processors described above include: general-purpose processors, central processing units, network processors, digital signal processors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), complex programmable logic devices (CPLs), programmable logic arrays, microcontroller units or other programmable logic devices, discrete gates, transistor logic devices, and discrete hardware components. They can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. For example, the processor can be a single-core processor or a multi-core processor, and the processor can be integrated on a single chip or located on multiple different chips.

[0101] Processor 1120 can be a microprocessor or any conventional processor. The method steps disclosed in the embodiments of the present invention can be directly executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in readable storage media known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, erasable programmable read-only memory, registers, etc. The readable storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0102] Bus 1110 can also connect various other circuits, such as peripheral devices, voltage regulators, or power management circuits. Bus interface 1140 provides an interface between bus 1110 and transceiver 1130, all of which are well known in the art. Therefore, embodiments of the present invention will not be described further.

[0103] Transceiver 1130 can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. For example, transceiver 1130 receives external data from other devices, and transceiver 1130 is used to send data processed by processor 1120 to other devices. Depending on the nature of the computer system, a user interface 1160 may also be provided, such as a touchscreen, physical keyboard, monitor, mouse, speaker, microphone, trackball, joystick, or stylus.

[0104] It should be understood that, in embodiments of the present invention, the memory 1150 may further include memory remotely configured relative to the processor 1120, and these remotely configured memories can be connected to a server via a network. One or more portions of the aforementioned network may be an ad hoc network, intranet, extranet, virtual private network, local area network, wireless local area network, wide area network, wireless wide area network, metropolitan area network, the Internet, public switched telephone network, conventional telephone network, cellular telephone network, wireless network, wireless fidelity network, and combinations of two or more of the aforementioned networks. For example, the cellular telephone network and wireless network may be a Global System for Mobile Communications (GSMO), a Code Division Multiple Access (CDMA) system, a Global System for Microwave Interconnection and Access (GSMA), a General Packet Radio Service (GPRS), a Wideband Code Division Multiple Access (WDMA) system, a Long Term Evolution (LTE) system, an LTE Frequency Division Duplex (FFD) system, an LTE Time Division Duplex (TDM) system, an Advanced Long Term Evolution (ALE) system, a Universal Mobile Communications System (UMS), an Enhanced Mobile Broadband (EMS) system, a Massive Machine-Type Communications (MMT) system, an Ultra Reliable Low Latency (ULLA) system, etc.

[0105] It should be understood that the memory 1150 in the embodiments of the present invention may be volatile memory or non-volatile memory, or may include both volatile memory and non-volatile memory. Non-volatile memory includes: read-only memory, programmable read-only memory, erasable programmable read-only memory, electrically erasable programmable read-only memory, or flash memory.

[0106] Volatile memory includes random access memory (RAM) used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SRAM), double data rate synchronous dynamic random access memory (DRAM), enhanced synchronous dynamic random access memory (ERRAM), synchronous linked dynamic random access memory (SRAM), and direct memory bus (DMB) RAM. The memory 1150 of the electronic device described in this embodiment includes, but is not limited to, the above-described and any other suitable types of memory.

[0107] In this embodiment of the invention, the memory 1150 stores the following elements of the operating system 1151 and the application 1152: executable modules, data structures, or subsets thereof, or extended sets thereof.

[0108] Specifically, the operating system 1151 includes various system programs, such as a framework layer, a core library layer, and a driver layer, used to implement various basic business functions and handle hardware-based tasks. The application program 1152 includes various applications, such as a media player and a browser, used to implement various application functions. Programs implementing the methods of this embodiment of the invention can be included in the application program 1152. The application program 1152 includes applets, objects, components, logic, data structures, and other computer system executable instructions that perform specific tasks or implement specific abstract data types.

[0109] Furthermore, embodiments of the present invention also provide a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the various processes of the above-described method embodiments for controlling output data and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0110] The above description is merely a specific implementation of the embodiments of the present invention, but the protection scope of the embodiments of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the embodiments of the present invention should be included within the protection scope of the embodiments of the present invention. Therefore, the protection scope of the embodiments of the present invention should be determined by the protection scope of the claims.

Claims

1. A resource management method for third-party interface services, wherein, The method includes: Obtain basic information about the third-party interface service, including access volume; The maximum concurrency of the third-party interface service is obtained based on the aforementioned basic information; Obtain a first configuration expansion instruction, and expand the maximum concurrency according to the first configuration expansion instruction to obtain a first configuration parameter; Obtain the first queue length of the HTTP connection pool, wherein the first queue length is determined based on the first waiting time of the third-party interface service; A second configuration parameter is obtained based on the first configuration parameter and the first queue length, wherein the second configuration parameter is the first configuration parameter and the first queue length; The third-party interface service is managed using the second configuration parameter; The method further includes: Obtain the first pre-reserved request time threshold; Determine whether the first waiting time meets the first predetermined request time threshold; When the first waiting time meets the first predetermined request time threshold, a first error instruction is obtained; The third-party interface service is managed according to the first error instruction, and the management includes request failure and resource release.

2. The resource management method for third-party interface services as described in claim 1, wherein, The process of obtaining the first queue length of the HTTP connection pool also includes: The first waiting time to obtain the third-party interface service; The length of the first queue is obtained based on the first waiting time.

3. The resource management method for third-party interface services as described in claim 2, wherein, The method further includes: Obtain the number of requests per second for the aforementioned third-party interface service; The first queue length is obtained based on the first waiting time and the number of requests per second.

4. The resource management method for third-party interface services as described in claim 3, wherein, The step of obtaining the first queue length based on the first waiting time and the number of requests per second further includes: The length of the first queue is calculated using the following formula: l = at Where l is the length of the first queue, a is the number of requests per second, and t is the first waiting time.

5. A resource management method for third-party interface services as described in claim 1, wherein, The management of the third-party interface service through the second configuration parameters also includes: Configure the first HTTP connection pool using the second configuration parameter; Bind the first HTTP connection pool to the third-party interface service; The third-party interface services are managed through the first HTTP connection pool.

6. A resource management system for third-party interface services, wherein, The system includes: The first obtaining unit is used to obtain basic information of the third-party interface service, including the number of visits. The second obtaining unit is used to obtain the maximum concurrency of the third-party interface service based on the basic information; The third obtaining unit is used to obtain a first configuration expansion instruction, and expand the maximum concurrency according to the first configuration expansion instruction to obtain the first configuration parameter; The fourth obtaining unit is used to obtain the first queue length of the HTTP connection pool, wherein the first queue length is determined based on the first waiting time of the third-party interface service. The fifth obtaining unit is used to obtain a second configuration parameter based on the first configuration parameter and the first queue length, wherein the second configuration parameter is the first configuration parameter and the first queue length; The first management unit is used to manage the third-party interface service through the second configuration parameters; The system also includes: The tenth obtaining unit is used to obtain a first predetermined request time threshold. The first judgment unit is used to determine whether the first waiting time meets the first predetermined request time threshold. The eleventh obtaining unit is used to obtain a first error instruction when the first waiting time meets the first predetermined request time threshold. The second management unit is used to manage the third-party interface service according to the first error instruction.

7. A resource management system for third-party interface services, comprising a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the transceiver, the memory, and the processor are connected via the bus, characterized in that, When the computer program is executed by the processor, it implements the steps of the resource management method for third-party interface services as described in any one of claims 1-5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the resource management method for third-party interface services as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Information synchronization method and device for configuring server

    CN110113176A