Dynamic service interface management method and management system based on SDK (Software Development Kit)

By constructing an SDK -based interface management framework and real -time monitoring mechanism, automatically update and adjust the configuration and scale of the server interface, solve the problem of insufficient flexibility of traditional interface management methods, and achieve efficient and stable interface management and maintenance.

CN119356725APending Publication Date: 2025-01-24CICHUAN KAIWU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411157756.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

The traditional server-side interface management method has problems such as insufficient flexibility and difficulty in adapting to dynamic changes.

Method used

By building an interface management framework based on SDK, defining interface specifications and data formats, monitoring changes in server interface parameters in real time, automatically updating local interface configuration information when changes occur, and automatically expanding or reducing the size of the server to respond to load changes.

Benefits of technology

The automatic dynamic management of the service interface is realized, the flexibility and scalability of the interface are improved, the stability and security of the interface call is guaranteed, and the development and maintenance costs are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356725A_ABST
    Figure CN119356725A_ABST
Patent Text Reader

Abstract

The invention discloses a dynamic service interface management method and management system based on an SDK (Software Development Kit), and relates to the technical field of computer development. The method comprises the following steps: constructing an SDK-based interface management framework, and defining an interface specification and a data format; configuring interface related parameters at the server side, wherein the interface related parameters comprise an interface address and an access permission; the change of the interface parameters of the server is monitored in real time through the SDK; when the change of the interface parameters is monitored, the SDK automatically updates the local interface configuration information, and automatically expands or reduces the scale of the server side so as to cope with the change of the load of the server side; and the application program realizes interaction with the server by calling an interface provided by the SDK. According to the invention, automatic dynamic management of the service interface can be realized, the flexibility and the expandability of the interface are improved, the stability and the safety of interface calling are effectively guaranteed, and the development and maintenance cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer development technology, and in particular to a dynamic service interface management method and management system based on SDK. Background Art

[0002] In software development, the management of server interfaces is crucial to the stability, scalability and maintainability of the system. The traditional server interface management methods mainly include the following: ① Document management: Write interface documents to record the name, URL, request method, input and output parameters of each interface in detail, and maintain them in time as the interface changes; ② Code comments: Annotate the interface in the server code, and other developers can understand the specific situation of the interface through comments; ③ Manual configuration management: Set interface-related parameters in the server configuration file. When the parameters change, manually modify the configuration file and restart the server to take effect.

[0003] Traditional server-side interface management methods often have problems such as lack of flexibility and difficulty in adapting to dynamic changes. Summary of the invention

[0004] The present invention provides a dynamic service interface management method based on SDK, comprising:

[0005] Build an SDK-based interface management framework to define interface specifications and data formats;

[0006] Configure interface-related parameters on the server, including interface address, access rights, etc.

[0007] Monitor the changes of server interface parameters in real time through SDK;

[0008] When detecting changes in interface parameters, the SDK automatically updates the local interface configuration information and automatically expands or reduces the size of the server to cope with changes in server load;

[0009] The application interacts with the server by calling the interface provided by the SDK.

[0010] The above-mentioned SDK-based dynamic service interface management method, wherein building an SDK-based interface management framework specifically includes the following sub-steps:

[0011] Clarify business requirements and interface usage scenarios, and determine the performance requirements for the functions that need to be supported;

[0012] Define interface specifications, including interface input and output formats, interface calling methods, error handling mechanisms, and return code specifications;

[0013] Choose a suitable third-party SDK based on project requirements and technology stack. You need to choose an SDK whose stability and performance meet the project requirements.

[0014] Encapsulate the original interface provided by the SDK and abstract the general encapsulation interface to the upper-layer application;

[0015] Design access control mechanisms for interfaces to ensure that only authorized users or applications can call them;

[0016] Establish a monitoring mechanism for interface calls and record call events.

[0017] The above-mentioned SDK-based dynamic service interface management method, wherein the interface-related parameters are configured on the server side, specifically includes the following sub-steps:

[0018] Determine the purpose and requirements of the server interface, and clarify the internal and external communication interaction interfaces and the data types and business logic that the interfaces need to process;

[0019] Select a server framework based on project requirements and technology stack, set the interface address in the server code according to the server framework specifications, specify the routing address of the interface, and use environment variables to switch the interface address;

[0020] Determine access permission policies based on the purpose and security requirements of the interface, including public access, authorized access, and internal access.

[0021] A dynamic service interface management method based on SDK as described above, wherein the SDK monitors the changes of the server interface parameters in real time through a real-time monitoring mechanism; the real-time monitoring mechanism includes a polling mechanism, a long connection mechanism or an event-driven mechanism; the polling mechanism is specifically to set a timer in the SDK, and regularly send requests to the server to inquire whether the interface parameters have changed; the long connection mechanism is specifically to establish a long connection between the SDK and the server, and the server actively pushes the changes of the interface parameters to the SDK; the event-driven mechanism is specifically that when the interface parameters change, the server triggers an event, and the SDK subscribes to the event so as to be notified when the event occurs.

[0022] The above-mentioned SDK-based dynamic service interface management method, wherein when the interface parameter changes are detected, the SDK automatically updates the local interface configuration information and automatically expands or reduces the scale of the server to cope with the change of the server load, specifically includes the following sub-steps:

[0023] After receiving the response from the server, the SDK determines the interface response type;

[0024] If the interface response contains the original server flag parameter, the response information is further determined. If the response information is a reduced response from the original server, the SDK will reduce the original server. If the response information is an update response from the original server, the locally stored interface configuration information is compared with the server response information. If there is a change, the local configuration information is updated.

[0025] If the interface response contains a new server flag parameter, the SDK will configure the new server locally.

[0026] In the above-mentioned SDK-based dynamic service interface management method, the original server identification parameter is the existing server interface address, and the new server identification parameter is the unstored server interface address, that is, the newly extended server.

[0027] The above-mentioned SDK-based dynamic service interface management method, wherein the SDK automatically expands or reduces the scale of the server, specifically includes the following sub-steps:

[0028] The SDK sets appropriate load indicator thresholds to measure the server load, including CPU usage, network traffic, and request processing time.

[0029] Collect load data regularly and analyze the load change trend on the server side;

[0030] According to the server change trend and load indicator threshold, the prediction algorithm based on machine learning decides whether to expand or reduce the server scale.

[0031] Send an expansion or reduction request to the local management system and perform normal business processing after receiving a success notification.

[0032] The present invention also provides a dynamic service interface management system based on SDK, comprising: the management system executes any one of the dynamic service interface management methods based on SDK described above.

[0033] The present invention also provides a computer storage medium, characterized in that it comprises: at least one memory and at least one processor;

[0034] The memory is used to store one or more program instructions;

[0035] The processor is used to run one or more program instructions to execute any one of the above-mentioned dynamic service interface management methods based on SDK.

[0036] The beneficial effects achieved by the present invention are as follows: the present invention can realize automatic dynamic management of service interfaces, improve the flexibility and scalability of interfaces, effectively ensure the stability and security of interface calls, and reduce development and maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0038] Figure 1 This is a flow chart of a dynamic service interface management method based on SDK provided in Example 1 of the present application;

[0039] Figure 2 It is a flowchart of the specific method of building an SDK-based interface management framework;

[0040] Figure 3 It is a flowchart of the specific method of configuring interface related parameters on the server side;

[0041] Figure 4 It is a flowchart of the specific method by which the SDK automatically updates the local interface configuration information and automatically expands or reduces the scale of the server. DETAILED DESCRIPTION

[0042] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments 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 those skilled in the art without creative work are within the scope of protection of the present invention.

[0043] Embodiment 1

[0044] like Figure 1 As shown, the first embodiment of the present application provides a dynamic service interface management method based on SDK, including:

[0045] Step 110: Build an SDK-based interface management framework to define interface specifications and data formats;

[0046] Step 120: Configure interface related parameters on the server, including interface address, access rights, etc.

[0047] Step 130: Monitor the changes of server interface parameters in real time through SDK;

[0048] Real-time monitoring mechanisms include polling mechanism, long connection mechanism or event-driven mechanism, etc. The polling mechanism is to set a timer in the SDK to send requests to the server regularly to inquire whether the interface parameters have changed; the long connection mechanism is to establish a long connection between the SDK and the server, and the server can actively push the changes of interface parameters to the SDK; the event-driven mechanism is that when the interface parameters change, the server triggers an event, and the SDK subscribes to the event so that it can be notified when the event occurs.

[0049] Step 140: When detecting changes in interface parameters, the SDK automatically updates the local interface configuration information and automatically expands or reduces the size of the server to cope with changes in the server load.

[0050] Step 150: The application program interacts with the server by calling the interface provided by the SDK.

[0051] like Figure 2 As shown in the figure, building an SDK-based interface management framework includes the following sub-steps:

[0052] Step 210: clarify the business requirements and usage scenarios of the interface, and determine the performance requirements of the functions that need to be supported;

[0053] Step 220, define interface specifications, including defining interface input and output formats, formulating interface calling methods, error handling mechanisms, and return code specifications;

[0054] Step 230: Select a suitable third-party SDK based on project requirements and technology stack. You need to select an SDK whose stability and performance meet the project requirements.

[0055] Step 240: Encapsulate the original interface provided by the SDK and abstract a general encapsulation interface to the upper layer application;

[0056] Step 250: Design an access rights control mechanism for the interface to ensure that only authorized users or applications can call it;

[0057] Step 260: Establish a monitoring mechanism for interface calls and record call events.

[0058] like Figure 3 As shown, configure the interface related parameters on the server side, which includes the following sub-steps:

[0059] Step 310: Determine the purpose and requirements of the server interface, and clarify the data types and business logic used for the internal and external communication interaction interface and the interface to be processed;

[0060] Step 320: Select a server framework according to project requirements and technology stack, set the interface address in the server code according to the server framework specification, specify the routing address of the interface, and use environment variables to switch the interface address;

[0061] Step 330: Determine access rights policy based on the purpose and security requirements of the interface, including public access, authorized access, internal access, etc.

[0062] For public access, there is no need to set up an access permission mechanism; for authorized access, you can choose a suitable authentication and authorization mechanism, such as token-based authentication. On the server side, verify the token provided by the user and decide whether to allow access to the interface based on the verification result; for internal access, you can use an access control list to limit the access permissions of the interface. For example, you can determine whether to allow access to the interface based on user role, identity, IP address and other information.

[0063] like Figure 4 As shown in the figure, when the interface parameter changes are detected, the SDK automatically updates the local interface configuration information and automatically expands or reduces the size of the server to cope with the changes in the server load. The specific steps include the following:

[0064] Step 410: After receiving the response from the server, the SDK determines the interface response type;

[0065] Step 420: If the interface response contains the original server flag parameter, the response information is further determined. If the response information is a reduction response of the original server, the SDK performs reduction processing on the original server. If the response information is an update response of the original server, the locally stored interface configuration information is compared with the server response information. If there is a change, the local configuration information is updated.

[0066] The original server flag parameter may be an existing server interface address, and the new server flag parameter may be an unstored server interface address, that is, a newly extended server;

[0067] Step 430: If the interface response contains a new server identification parameter, the SDK configures the new server locally.

[0068] The SDK automatically expands or reduces the size of the server, which includes the following sub-steps:

[0069] Step S1, SDK sets appropriate load indicator thresholds to measure the load of the server, such as CPU usage, network traffic, request processing time, etc.;

[0070] Step S2: regularly collect load data and analyze the load change trend of the server;

[0071] Step S3: According to the change trend of the server and the load index threshold, a machine learning-based prediction algorithm is used to decide whether to expand or reduce the server scale;

[0072] Specifically, based on the prediction algorithm of machine learning, it is decided whether to expand or reduce the server scale, which includes the following sub-steps:

[0073] Step S31, collect historical data for a period of time, and extract key indicator data related to the server load, such as CPU usage, network traffic, request processing time, number of concurrent connections, etc.;

[0074] Step S32: using the key indicator data and the deformed data of the key indicator data (such as calculating the mean value, standard deviation, variance, etc.), training the machine prediction model and adjusting the model parameters;

[0075] Step S33: determine the load change trend (such as calculating the data variance) according to the currently collected load data, input the load change trend into the trained machine prediction model, and output the prediction of the server load;

[0076] Step S34: compare the predicted value of the server load with the load index threshold. If it is lower than or higher than the threshold, the server scale is expanded or reduced.

[0077] Step S4: Send an expansion or reduction request to the local management system, and perform normal business processing after receiving a success notification.

[0078] Embodiment 2

[0079] Embodiment 2 of the present invention provides a dynamic service interface management system based on SDK, including: a server, a local management system and an upper-layer application, wherein the SDK is configured in the local management system, and the upper-layer application calls the server through the SDK;

[0080] The server includes a server configuration module, which is used to configure interface related parameters on the server, including interface address and access rights;

[0081] Among them, the server configuration module is specifically used to: determine the purpose and requirements of the server interface, clarify the data types and business logic used for internal and external communication interaction interfaces and the interfaces that need to be processed; select the server framework according to project requirements and technology stack, set the interface address in the server code according to the server framework specifications, specify the routing address of the interface, and use environment variables to switch the interface address; determine the access permission policy according to the purpose and security requirements of the interface, including public access, authorized access, and internal access.

[0082] Local management system, including: SDK building module, SDK monitoring module, SDK update module;

[0083] SDK building module, used to build an SDK-based interface management framework and define interface specifications and data formats;

[0084] Among them, the SDK building module is specifically used to: clarify business needs and interface usage scenarios, determine the performance requirements of functions that need to be supported; define interface specifications, including defining interface input and output formats, formulating interface calling methods, error handling mechanisms and return code specifications; select a suitable third-party SDK based on project requirements and technology stack, and select an SDK whose stability and performance meet the project requirements; encapsulate the original interface provided by the SDK, and abstract a general encapsulation interface for upper-level applications; design an interface access control mechanism to ensure that only authorized users or applications can call it; establish an interface call monitoring mechanism to record call events.

[0085] The SDK monitoring module is used to monitor the changes of server interface parameters in real time through the SDK; the SDK monitors the changes of server interface parameters in real time through the real-time monitoring mechanism; the real-time monitoring mechanism includes a polling mechanism, a long connection mechanism or an event-driven mechanism; the polling mechanism is specifically to set a timer in the SDK to periodically send requests to the server to inquire whether the interface parameters have changed; the long connection mechanism is specifically to establish a long connection between the SDK and the server, and the server actively pushes the changes of interface parameters to the SDK; the event-driven mechanism is specifically that when the interface parameters change, the server triggers an event, and the SDK subscribes to the event so as to be notified when the event occurs.

[0086] SDK update module, which is used to automatically update local interface configuration information and automatically expand or reduce the server size to cope with changes in server load when changes in interface parameters are detected;

[0087] Among them, the SDK update module is specifically used for the SDK to determine the interface response type after receiving the server response; if the interface response contains the original server flag parameter, the response information is further determined. If the response information is the original server reduction response, the SDK will reduce the original server; if the response information is the original server update response, the locally stored interface configuration information is compared with the server response information. If there is a change, the local configuration information is updated; if the interface response contains a new server flag parameter, the SDK will configure the new server locally. The original server flag parameter is the existing server interface address, and the new server flag parameter is the unstored server interface address, that is, the newly extended server.

[0088] The upper-level application includes a calling module, which is used to call the interface provided by the SDK to achieve interaction with the server.

[0089] Corresponding to the above embodiment, an embodiment of the present invention provides a computer storage medium, including: at least one memory and at least one processor;

[0090] The memory is used to store one or more program instructions;

[0091] The processor is used to run one or more program instructions to execute a dynamic service interface management method based on SDK.

[0092] Corresponding to the above-mentioned embodiment, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer storage medium contains one or more program instructions, and the one or more program instructions are used by a processor to execute a dynamic service interface management method based on SDK.

[0093] The embodiment disclosed in the present invention provides a computer-readable storage medium, in which computer program instructions are stored. When the computer program instructions are executed on a computer, the computer executes the above-mentioned SDK-based dynamic service interface management method.

[0094] In the embodiment of the present invention, the processor may be an integrated circuit chip having the ability to process signals. The processor may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0095] The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor for execution, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The processor reads the information in the storage medium and completes the steps of the above method in combination with its hardware.

[0096] The storage medium may be a memory, which may be, for example, a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memory.

[0097] Among them, the non-volatile memory can be a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory.

[0098] The volatile memory may be a random access memory (RAM) which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDRSDRAM), enhanced synchronous DRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus DRAM (DRRAM).

[0099] The storage media described in the embodiments of the present invention are intended to include, but are not limited to, these and any other suitable types of memory.

[0100] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the present invention can be implemented using a combination of hardware and software. When software is used, the corresponding functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of computer programs from one place to another. Storage media can be any available media that can be accessed by general or special-purpose computers.

[0101] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. A dynamic service interface management method based on SDK, characterized in that: include: Build an SDK-based interface management framework to define interface specifications and data formats; Configure interface-related parameters on the server, including interface address and access rights; Monitor the changes of server interface parameters in real time through SDK; When detecting changes in interface parameters, the SDK automatically updates the local interface configuration information and automatically expands or reduces the size of the server to cope with changes in server load; The application interacts with the server by calling the interface provided by the SDK.

2. A method for managing a dynamic service interface based on SDK as claimed in claim 1, characterized in that: Building an SDK-based interface management framework includes the following sub-steps: Clarify business requirements and interface usage scenarios, and determine the performance requirements for the functions that need to be supported; Define interface specifications, including interface input and output formats, interface calling methods, error handling mechanisms, and return code specifications; Choose a suitable third-party SDK based on project requirements and technology stack. You need to choose an SDK whose stability and performance meet the project requirements. Encapsulate the original interface provided by the SDK and abstract the general encapsulation interface to the upper-layer application; Design access control mechanisms for interfaces to ensure that only authorized users or applications can call them; Establish a monitoring mechanism for interface calls and record call events.

3. A method for managing a dynamic service interface based on SDK as claimed in claim 1, characterized in that: Configure the interface-related parameters on the server side, including the following sub-steps: Determine the purpose and requirements of the server interface, and clarify the internal and external communication interaction interfaces and the data types and business logic that the interfaces need to process; Select a server framework based on project requirements and technology stack, set the interface address in the server code according to the server framework specifications, specify the routing address of the interface, and use environment variables to switch the interface address; Determine access permission policies based on the purpose and security requirements of the interface, including public access, authorized access, and internal access.

4. The SDK-based dynamic service interface management method according to claim 1, characterized in that: The SDK monitors the changes of the server interface parameters in real time through a real-time monitoring mechanism; the real-time monitoring mechanism includes a polling mechanism, a long connection mechanism or an event-driven mechanism; the polling mechanism is specifically to set a timer in the SDK to periodically send requests to the server to inquire whether the interface parameters have changed; the long connection mechanism is specifically to establish a long connection between the SDK and the server, and the server actively pushes the changes of the interface parameters to the SDK; the event-driven mechanism is specifically that when the interface parameters change, the server triggers an event, and the SDK subscribes to the event so that it can be notified when the event occurs.

5. The SDK-based dynamic service interface management method according to claim 1, characterized in that: When detecting changes in interface parameters, the SDK automatically updates the local interface configuration information and automatically expands or reduces the size of the server to cope with changes in server load. The specific steps include the following: After receiving the response from the server, the SDK determines the interface response type; If the interface response contains the original server flag parameter, the response information is further determined. If the response information is a reduced response from the original server, the SDK will reduce the original server. If the response information is an update response from the original server, the locally stored interface configuration information is compared with the server response information. If there is a change, the local configuration information is updated. If the interface response contains a new server flag parameter, the SDK will configure the new server locally.

6. A method for managing a dynamic service interface based on SDK as claimed in claim 5, characterized in that: The original server flag parameter is the existing server interface address, and the new server flag parameter is the unstored server interface address, that is, the newly extended server.

7. A method for managing a dynamic service interface based on SDK as claimed in claim 5, characterized in that: The SDK automatically expands or reduces the size of the server, which includes the following sub-steps: The SDK sets appropriate load indicator thresholds to measure the server load, including CPU usage, network traffic, and request processing time. Collect load data regularly and analyze the load change trend on the server side; According to the server change trend and load indicator threshold, the prediction algorithm based on machine learning decides whether to expand or reduce the server scale. Send an expansion or reduction request to the local management system and perform normal business processing after receiving a success notification.

8. A dynamic service interface management system based on SDK, characterized in that: include: The management system executes a dynamic service interface management method based on SDK as described in any one of claims 1-7.

9. A computer storage medium, characterized in that include: at least one memory and at least one processor; The memory is used to store one or more program instructions; A processor, used to run one or more program instructions to execute a dynamic service interface management method based on SDK as described in any one of claims 1-7.