API (Application Program Interface) scheduling method of library data center based on artificial intelligence

By optimizing the API scheduling of the library data platform using a deep reinforcement learning model, the problems of cascading failures and network resource waste caused by performance bottlenecks were solved. This enabled intelligent avoidance of high-load nodes and merging of batch requests, thereby improving scheduling efficiency.

CN121478432APending Publication Date: 2026-02-06HEFEI UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511459028.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-13
Publication Date
2026-02-06

AI Technical Summary

Technical Problem

The library's data platform suffers from several issues during API scheduling, including performance bottlenecks leading to cascading failures, a lack of dynamic awareness of service call chains, and high-frequency, low-data-volume calls resulting in wasted network resources.

Method used

An API scheduling method based on a deep reinforcement learning model is adopted. The model is trained by API call logs and service logs, and the API call strategy and interface files are adjusted to optimize the attributes and call order of API interfaces, thereby achieving intelligent avoidance of high-load nodes and batch request merging.

Benefits of technology

It effectively avoids cascading failures, improves scheduling efficiency, reduces network resource waste, and enhances the intelligence and efficiency of API scheduling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121478432A_ABST
    Figure CN121478432A_ABST
Patent Text Reader

Abstract

The invention discloses an API (Application Program Interface) scheduling method of a library data table based on artificial intelligence, which comprises the following steps of: S1, acquiring an API calling log, and extracting API calling information in the API calling log; s2, obtaining a service log, and extracting historical service information associated with API calling; s3, calculating the API calling efficiency of the API calling information and the service information to obtain the API calling efficiency; s4, inputting the API calling efficiency, the API calling information and the service information into the deep reinforcement learning model to determine an API calling strategy and an API interface file adjustment strategy for the next service demand; s5, adjusting according to the API calling strategy; and adjusting the attribute and the corresponding value of the API interface according to the API interface file adjustment strategy. According to the method and the device, the API calling strategy and the API interface file adjusting strategy needle under the next service requirement can be obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data management technology, and in particular to an API scheduling method for a library data platform based on artificial intelligence. Background Technology

[0002] The data platform aggregates read and write interfaces from various data sources and abstracts data structure-related functions, forming a unified data entry and exit point. This eliminates the need for business developers to worry about the underlying data interfaces; they only need to understand the data platform's external protocols to read, store, and modify data. It abstracts highly similar functions from various business requirements, unifying planning and construction, avoiding reinventing the wheel, and improving code reusability. Furthermore, the platform can be directly reused and rapidly iterated when expanding into new businesses, saving operational costs. With data aggregation and service sharing as its core objectives, the data platform integrates multi-source heterogeneous data through a unified interface, performing cleaning, processing, and storage to form a data asset layer—a platform for the accumulation of business and data—supporting new business innovation and application expansion. The data platform breaks down data silos: integrating cross-system and cross-departmental data resources, eliminating information barriers; realizes data assetization: transforming raw data into standardized, reusable data assets; and enhances data service capabilities: supporting business decision-making, analysis, and innovation through a unified service interface.

[0003] Existing library data platforms comprise a data service layer, a data asset layer, a data processing layer, and a data integration layer. They integrate scattered data such as book catalogs, electronic resources, and user borrowing records within the library to build a unified data asset layer, eliminating data silos between traditional library systems. A tagging system is built based on user behavior data (such as search records and borrowing preferences), providing readers with personalized services like intelligent recommendations and precise searches through API interfaces, thus improving user experience. However, current library data platforms still suffer from the following problems with API scheduling: performance bottlenecks in scheduled APIs can trigger cascading failures; general library data platforms lack dynamic awareness of service call chains, failing to intelligently avoid high-load nodes and impacting scheduling efficiency; and the lack of intelligent batch request merging mechanisms leads to high-frequency, low-data-volume calls to personalized services, resulting in wasted network resources. Summary of the Invention

[0004] To overcome the aforementioned shortcomings of existing technologies, this invention proposes an API scheduling method for a library data platform based on artificial intelligence. This method utilizes API call logs and service logs to train a deep reinforcement learning model using artificial intelligence. The resulting model obtains API call strategies and API interface file adjustment strategies for the next service request. The API call strategy adjusts the specified API interface, call frequency, call count, and call order. The API interface file adjustment strategy adjusts the attributes and corresponding values ​​of the API interface. This invention addresses the following technical problems in existing technologies: when a scheduled API experiences a performance bottleneck, it may trigger cascading failures; general library data platforms lack dynamic awareness of service call chains and cannot intelligently avoid high-load nodes, affecting scheduling efficiency; and the lack of an intelligent batch request merging mechanism leads to high-frequency, low-data-volume calls for personalized services, resulting in wasted network resources.

[0005] The technical solution adopted by this invention to solve its technical problem is: an API scheduling method for a library data platform based on artificial intelligence, comprising the following steps: S1. Obtain API call logs and extract API call information from them; S2. Obtain service logs and extract service information associated with historical API calls; S3. Calculate the API call efficiency by combining the API call information and service information; S4. Input API call efficiency, API call information and service information into the deep reinforcement learning model to determine the API call strategy and API interface file adjustment strategy for the next service requirement; S5. Adjust the specified API interface, call frequency, call count, and call order according to the API call strategy; adjust the API interface attributes and corresponding values ​​according to the API interface file adjustment strategy; The API calling strategy includes the API interface, calling frequency, number of calls, and calling order; the API interface file adjustment strategy includes the attributes and corresponding values ​​of the API interfaces in the API interface file. The states in the state space of the deep reinforcement learning model are defined based on API call efficiency, API call information, and service information. The actions in the action set of the deep reinforcement learning model are defined by API interfaces, call frequency, call count, call order, and the attributes and corresponding values ​​of API interfaces in the API interface file. The reward of the deep reinforcement learning model is defined by API call efficiency.

[0006] Furthermore, the deep reinforcement learning model adopts the DDPG model, which includes an Actor network module and a Critic network module.

[0007] Furthermore, the Actor network module is used to determine at least one transitionable API call state for the current state of service information in the state space, and to determine the corresponding state transition action based on the current state and each API call state; the current state is determined by matching the API call efficiency, API call information and service information from each state in the state space.

[0008] Furthermore, the Critic network module is used to determine the state transition reward value corresponding to each state-action pair, and to determine the API call strategy and API interface file adjustment strategy based on the state transition action with the largest corresponding state transition reward value.

[0009] Furthermore, the reward function of the Critic network module is: In the formula, Indicates the reward value. Indicates API call efficiency. This indicates the API call time when the service uses the specified call strategy. This indicates the amount of data transferred using the specified invocation strategy for this service; Indicates optimal API call efficiency. Indicates the optimal API call time. This indicates the optimal data transfer volume for the service using the specified invocation strategy.

[0010] Furthermore, the loss function of the Critic network module is: ; In the formula, Indicates the loss value. It is a preset coefficient used to determine the intensity of the penalty; This represents the target value, which is calculated from the immediate reward and the expected reward value of the next state; Indicates the first The state and action corresponding to the nth sample; representing the Critic network module's response to the nth sample. Reward value estimation for each sample state corresponding to an action pair; Indicates based on the first The weights assigned to the importance of each sample state; This represents the total number of samples used as training samples, including API call efficiency, API call information, and service information.

[0011] Furthermore, the API call information includes API call file ID, interface name, call start time, data volume, return status, and return time.

[0012] Furthermore, the service information includes service name, user ID, service content, data transmission statistics, service start time, service end time, and API call file ID.

[0013] Furthermore, the method for calculating the API call efficiency is as follows: ; In the formula, Indicates API call efficiency; Indicates the duration of the API call; Indicates the total service duration; Indicates the amount of data used in the API call; This indicates the amount of data that the service needs to transfer to this API; and These are preset time efficiency weights and data efficiency weights, respectively.

[0014] Furthermore, it also includes a batch request merging strategy; the batch request merging strategy is used to merge API call requests in batches according to the API call strategy and API interface file adjustment strategy, specifically including deleting several duplicate and useless API call requests, adjusting the API call order, setting and following the priority of API calls, and setting a call count threshold.

[0015] Compared with the prior art, the beneficial effects of the present invention are: This invention uses API call logs and service logs to extract API call information and service information, respectively, to calculate API call efficiency. The API call efficiency, API call information, and service information are then input into a deep reinforcement learning model to determine the API call strategy and API interface file adjustment strategy for the next service requirement. Adjustments can be made by modifying the API call strategy and the API interface file. The API call strategy includes the API interface, call frequency, number of calls, and call order. The API interface file adjustment strategy includes the attributes and corresponding values ​​of the API interfaces in the API interface file. Each state in the state space of the deep reinforcement learning model is defined based on the API call efficiency, API call information, and service information. Each action in the action set of the deep reinforcement learning model is defined by the API interface, call frequency, number of calls, call order, and the attributes and corresponding values ​​of the API interfaces in the API interface file. The reward of the deep reinforcement learning model is defined by the API call efficiency.

[0016] When a performance bottleneck occurs in a scheduled API, cascading failures can be avoided by adjusting the API interface file. While typical library data platforms lack dynamic awareness of service call chains, this invention intelligently avoids high-load nodes and improves scheduling efficiency by adjusting API call strategies. Furthermore, by adjusting API call strategies, this invention can establish an intelligent batch request merging mechanism, shaping services into the required call methods and merging data transmission methods, thus avoiding high-frequency, low-data-volume calls to personalized services that would otherwise waste network resources. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below.

[0018] Figure 1 This is a flowchart illustrating an API scheduling method for a library data platform based on artificial intelligence, as described in an embodiment of the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0020] In the description of this invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0021] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances. Furthermore, the technical features involved in the different embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.

[0022] like Figure 1As shown in the figure, an API scheduling method for a library data platform based on artificial intelligence according to an embodiment of the present invention includes the following steps: S1. Obtain API call logs and extract API call information from them; API call information includes API call file ID, interface name, call start time, data volume, return status, and return time.

[0023] S2. Obtain service logs and extract service information associated with historical API calls; service information includes service name, user ID, service content, data transmission statistics, service start time, service end time, and API call file ID.

[0024] S3. Calculate the API call efficiency by combining the API call information and service information; the calculation method for API call efficiency is as follows: ; In the formula, Indicates API call efficiency; Indicates the duration of the API call; Indicates the total service duration; Indicates the amount of data used in the API call; This indicates the amount of data that the service needs to transfer to this API; and These are preset time efficiency weights and data efficiency weights, respectively.

[0025] S4. Input API call efficiency, API call information, and service information into the deep reinforcement learning model to determine the API call strategy and API interface file adjustment strategy for the next service requirement. The API call strategy includes the API interface, call frequency, number of calls, and call order. The API interface file adjustment strategy includes the attributes and corresponding values ​​of the API interfaces in the API interface file.

[0026] The states in the state space of a deep reinforcement learning model are defined based on API call efficiency, API call information, and service information. The actions in the action set of a deep reinforcement learning model are defined by API interfaces, call frequency, number of calls, call order, and the attributes and corresponding values ​​of API interfaces in the API interface file. The reward of a deep reinforcement learning model is defined by API call efficiency. The deep reinforcement learning model uses the DDPG model, which includes an Actor network module and a Critic network module.

[0027] The Actor network module is used to determine at least one transitionable API call state in the state space for the current state of service information, and to determine the corresponding state transition action based on the current state and each API call state. The current state is determined by matching various states in the state space based on API call efficiency, API call information, and service information. The Critic network module is used to determine the state transition reward value corresponding to each state-action pair, and to determine the API call strategy and API interface file adjustment strategy based on the state transition action with the largest corresponding state transition reward value. The reward function for the Critic network module is: (1); In the formula, Indicates the reward value. Indicates API call efficiency. This indicates the API call time when the service uses the specified call strategy. This indicates the amount of data transferred using the specified invocation strategy for this service; Indicates optimal API call efficiency. Indicates the optimal API call time. This indicates the optimal data transfer volume for the service using the specified invocation strategy.

[0028] The loss function of the Critic network module is: (2); In the formula, Indicates the loss value. It is a preset coefficient used to determine the intensity of the penalty; This represents the target value, which is calculated from the immediate reward and the expected reward value of the next state; Indicates the first The state and action corresponding to the nth sample; representing the Critic network module's response to the nth sample. Reward value estimation for each sample state corresponding to an action pair; Indicates based on the first The weights assigned to the importance of each sample state; This represents the total number of samples in the API call efficiency, API call information, and service information sets used as training samples. λ in equation (2) can be set according to requirements. When λ is large, the DDPG model will place greater emphasis on the temporal coherence of actions during training, avoiding drastic or discontinuous action changes. When λ is small, the DDPG model focuses more on improving prediction accuracy, even if this may lead to larger temporal fluctuations in actions.

[0029] S5. Adjust the specified API call interface, call frequency, call count, and call order according to the API call strategy; adjust the attributes and corresponding values ​​of the API interface according to the API interface file adjustment strategy; also includes a batch request merging strategy; the batch request merging strategy is used to merge API call requests in batches according to the API call strategy and the API interface file adjustment strategy, specifically including deleting several duplicate and useless API call requests, adjusting the API call order, setting and following the priority of API calls, and setting a call count threshold.

[0030] The electronic devices described in this application exist in various forms, including but not limited to: (1) Mobile communication devices: These devices are characterized by their mobile communication capabilities and primarily aim to provide voice and data communication. These terminals include smartphones, multimedia phones, feature phones, and low-end phones.

[0031] (2) Ultra-mobile personal computer devices: These devices fall under the category of personal computers, possessing computing and processing capabilities, and generally also have mobile internet access features. These terminals include PDAs, MIDs, and UMPCs, etc.

[0032] (3) Portable entertainment devices: These devices can display and play multimedia content. This category includes: audio, Video players, handheld game consoles, e-books, as well as smart toys and portable car navigation devices.

[0033] (4) Other airborne electronic devices with data interaction capabilities, such as vehicle-mounted systems installed on vehicles.

[0034] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0035] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0036] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them; although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application. The components shown as units may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the solution in this embodiment according to actual needs.

[0037] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0038] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. An API scheduling method for a library data platform based on artificial intelligence, characterized in that, Includes the following steps: S1. Obtain API call logs and extract API call information from them; S2. Obtain service logs and extract service information associated with historical API calls; S3. Calculate the API call efficiency by combining the API call information and service information; S4. Input API call efficiency, API call information and service information into the deep reinforcement learning model to determine the API call strategy and API interface file adjustment strategy for the next service requirement; S5. Adjust the specified API interface, call frequency, call count, and call order according to the API call strategy; adjust the API interface attributes and corresponding values ​​according to the API interface file adjustment strategy; The API calling strategy includes the API interface, calling frequency, number of calls, and calling order; the API interface file adjustment strategy includes the attributes and corresponding values ​​of the API interfaces in the API interface file. The states in the state space of the deep reinforcement learning model are defined based on API call efficiency, API call information, and service information. The actions in the action set of the deep reinforcement learning model are defined by API interfaces, call frequency, call count, call order, and the attributes and corresponding values ​​of API interfaces in the API interface file. The reward of the deep reinforcement learning model is defined by API call efficiency.

2. The API scheduling method for a library data platform based on artificial intelligence according to claim 1, characterized in that, The deep reinforcement learning model adopts the DDPG model, which includes an Actor network module and a Critic network module.

3. The API scheduling method for a library data platform based on artificial intelligence according to claim 2, characterized in that, The Actor network module is used to determine at least one transitionable API call state for the current state of service information in the state space, and to determine the corresponding state transition action based on the current state and each API call state; the current state is determined by matching the API call efficiency, API call information and service information from each state in the state space.

4. The API scheduling method for a library data platform based on artificial intelligence according to claim 2, characterized in that, The Critic network module is used to determine the state transition reward value corresponding to each state-action pair, and to determine the API call strategy and API interface file adjustment strategy based on the state transition action with the largest corresponding state transition reward value.

5. The API scheduling method for a library data platform based on artificial intelligence according to claim 2, characterized in that, The reward function of the Critic network module is: In the formula, Indicates the reward value. Indicates API call efficiency. This indicates the API call time when the service uses the specified call strategy. This indicates the amount of data transferred using the specified invocation strategy for this service; Indicates optimal API call efficiency. Indicates the optimal API call time. This indicates the optimal data transfer volume for the service using the specified invocation strategy.

6. The API scheduling method for a library data platform based on artificial intelligence according to claim 2, characterized in that, The loss function of the Critic network module is: ; In the formula, Indicates the loss value. It is a preset coefficient used to determine the intensity of the penalty; This represents the target value, which is calculated from the immediate reward and the expected reward value of the next state; Indicates the first The state and action corresponding to the nth sample; representing the Critic network module's response to the nth sample. Reward value estimation for each sample state corresponding to an action pair; Indicates based on the first The weights assigned to the importance of each sample state; This represents the total number of samples used as training samples, including API call efficiency, API call information, and service information.

7. The API scheduling method for a library data platform based on artificial intelligence according to claim 1, characterized in that, The API call information includes the API call file ID, interface name, call start time, data volume, return status, and return time.

8. The API scheduling method for a library data platform based on artificial intelligence according to claim 1, characterized in that, The service information includes service name, user ID, service content, data transmission statistics, service start time, service end time, and API call file ID.

9. The API scheduling method for a library data platform based on artificial intelligence according to claim 1, characterized in that, The method for calculating the API call efficiency is as follows: ; In the formula, Indicates API call efficiency; Indicates the duration of the API call; Indicates the total service duration; Indicates the amount of data used in the API call; This indicates the amount of data that the service needs to transfer to this API; and These are preset time efficiency weights and data efficiency weights, respectively.

10. The API scheduling method for a library data platform based on artificial intelligence according to claim 1, characterized in that, It also includes a batch request merging strategy; the batch request merging strategy is used to merge API call requests in batches according to the API call strategy and API interface file adjustment strategy, specifically including deleting several duplicate and useless API call requests, adjusting the API call order, setting and following the priority of API calls, and setting a call count threshold.