Java-based cloud service integration method and integration system
By adopting a Java-based cloud service integration method, the problems of excessive API exposure, limited functionality, and complex integration of heterogeneous languages in cloud services are solved, thereby improving security, flexibility, and scalability.
Patent Information
- Application Number
- CN202411157701.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2025-01-07
AI Technical Summary
Existing cloud services suffer from issues such as excessive API exposure, limited service functionality, and complex integration with heterogeneous languages, which impact security, flexibility, and scalability.
This paper provides a Java-based cloud service integration method, which achieves secure API management and flexible API invocation by building a service architecture, encapsulating cloud service APIs into Java classes, creating configuration files, and deploying them to a package management repository.
It improves the security and flexibility of cloud services, promotes the integration of heterogeneous languages, and enhances the availability and scalability of services.
Smart Images

Figure CN119271258A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer software technology, and in particular to a Java-based cloud service integration method and integration system. Background Art
[0002] With the rapid development of cloud computing and Internet technologies, enterprises and service providers are increasingly in need of providing efficient, reliable and easy-to-integrate cloud services. However, existing cloud services face some challenges, such as excessive exposure of APIs, single service functions, and complex integration of heterogeneous languages. These issues not only affect the security and flexibility of services, but also limit the scalability and cross-language interoperability of services.
[0003] 1. API over-exposure problem: Traditional cloud services usually expose all APIs to the outside world, which may lead to security risks such as unauthorized access and data leakage.
[0004] 2. Single service function problem: Many cloud services only provide limited functions and cannot meet diverse needs, which limits the scope of application of the services.
[0005] 3. Complex issues in integrating heterogeneous languages: Since different services may use different programming languages and technology stacks, there is a high level of complexity in implementing cross-language service calls.
[0006] Therefore, it is necessary to provide a Java-based cloud service integration method and integration system to solve the above technical problems. Summary of the invention
[0007] To solve the above technical problems, the present invention provides a Java-based cloud service integration method and integration system, providing a flexible, secure and easy-to-use API encapsulation and management framework to promote collaboration between different development languages and improve the overall availability and scalability of services.
[0008] The present invention provides a Java-based cloud service integration method, which includes the following steps:
[0009] S1: Building a service architecture based on multiple defined API definitions of cloud service APIs, wherein the API definitions include functional requirements and interface parameters of the cloud service APIs;
[0010] S2: Build multiple Java projects and integrate multiple cloud service APIs of the built service architecture into multiple Java projects;
[0011] S3: Encapsulate the cloud service API as a Java class in the corresponding Java project, and create a configuration file for specifying the access path and parameters of the cloud service API;
[0012] S4: Package all the packaged Java projects into archive files, and deploy all the archive files to the package management repository;
[0013] S5: Add the archive file obtained from the package management repository as a dependency in the target client project, and call the cloud service API encapsulated in the Java project through the corresponding configuration file.
[0014] Preferably, step S1 comprises the following steps:
[0015] S11: Analyze the functional requirements of the cloud service API to obtain a functional requirement list for each API;
[0016] S12: Obtain an interface parameter list of each API by designing the interface parameters of the cloud service API;
[0017] S13: Obtain an API definition list by combining the function requirement list and the interface parameter list.
[0018] Preferably, step S2 comprises the following steps:
[0019] S21: Create an independent Java project for each cloud service API to obtain multiple Java projects;
[0020] S22: Integrate the cloud service API in the obtained API definition list into each Java project to obtain an integrated Java project.
[0021] Preferably, step S3 comprises the following steps:
[0022] S31: Encapsulate the cloud service API in the integrated Java project to obtain an encapsulated Java class;
[0023] S32: Create a configuration file to specify the access path and parameters of the cloud service API.
[0024] Preferably, step S4 comprises the following steps:
[0025] S41: using a build tool to package the obtained Java project including the encapsulated Java class to obtain an archive file;
[0026] S42: Deploy the archive file to obtain the archive file deployed into the package management warehouse, wherein the package management warehouse includes a private Maven warehouse and a public Maven warehouse.
[0027] Preferably, step S5 comprises the following steps:
[0028] S51: Adding a dependency in the target client project, wherein the dependency is used to point to the deployed archive file;
[0029] S52: Parse the configuration file to obtain the access path and parameters of the corresponding cloud service API;
[0030] S53: Use the parsed access path and parameters to call the encapsulated cloud service API to obtain a service response.
[0031] Preferably, the construction tools include Maven tools and Gradle tools.
[0032] Preferably, the integration method further comprises:
[0033] In each Java project, a security mechanism is added for each cloud service API, wherein the security mechanism includes HTTPS authentication and OAuth authentication.
[0034] Preferably, the integration method further comprises:
[0035] In each Java project, the number of API instances is automatically adjusted according to a predefined strategy based on load indicators monitored in real time, wherein the adjustment includes expanding or reducing the number of API instances.
[0036] The present invention also provides a Java-based cloud service integration system for executing the Java-based cloud service integration method. The integration system includes:
[0037] An architecture design module, used to build a service architecture based on multiple defined API definitions of cloud service APIs, wherein the API definitions include functional requirements and interface parameters of the cloud service APIs;
[0038] Integration module, used to build multiple Java projects and integrate multiple cloud service APIs of the built service architecture into multiple Java projects;
[0039] The API encapsulation and configuration module is used to encapsulate the cloud service API as a Java class in the corresponding Java project and create a configuration file for specifying the access path and parameters of the cloud service API;
[0040] The project packaging and deployment module is used to package all the encapsulated Java projects into archive files and deploy all the archive files to the package management warehouse;
[0041] The client integration and calling module is used to add the archive file obtained from the package management warehouse as a dependency in the target client project, and call the cloud service API encapsulated in the Java project through the corresponding configuration file.
[0042] Compared with the related art, the Java-based cloud service integration method and integration system provided by the present invention have the following beneficial effects:
[0043] 1. Improved API security: By carefully defining the functional requirements and interface parameters of the cloud service API and implementing security mechanisms (such as HTTPS authentication and OAuth authentication) in each Java project, the security of cloud services is significantly enhanced and the risk of unauthorized access is reduced.
[0044] 2. Enhanced service flexibility: By encapsulating the cloud service API as a Java class and creating a configuration file to specify the API access path and parameters, API calls become more flexible and convenient, and also easier to maintain and upgrade.
[0045] 3. Promotes the integration of heterogeneous languages: By packaging the encapsulated Java projects into archive files and deploying them to the package management repository, client projects can easily add dependencies and call cloud service APIs, achieving seamless integration even if the client projects use different programming languages. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 A flowchart of a Java-based cloud service integration method provided by the present invention;
[0047] Figure 2 A module structure diagram of a Java-based cloud service integration system provided by the present invention. DETAILED DESCRIPTION
[0048] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only the parts related to the present invention, rather than all structures, are shown in the accompanying drawings. In addition, the embodiments of the present invention and the features in the embodiments may be combined with each other without conflict.
[0049] It should also be noted that, for ease of description, only the part relevant to the present invention but not all the content is shown in the accompanying drawings. It should be mentioned before discussing the exemplary embodiments in more detail that some exemplary embodiments are described as the processing or method described as a flow chart. Although the flow chart describes each operation (or step) as being processed sequentially, many operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. When its operation is completed, the processing can be terminated, but it can also have additional steps not included in the accompanying drawings. The processing can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
[0050] Embodiment 1
[0051] The present invention provides a Java-based cloud service integration method, which includes the following steps:
[0052] S1: Building a service architecture based on multiple defined API definitions of cloud service APIs, wherein the API definitions include functional requirements and interface parameters of the cloud service APIs.
[0053] Specifically, step S1 includes the following steps:
[0054] S11: Analyze the functional requirements of the cloud service API to obtain a functional requirement list for each API.
[0055] In this embodiment, the steps are specifically as follows:
[0056] a. Requirements collection:
[0057] Conduct meetings with business teams to discuss business requirements.
[0058] Review the business requirements document to understand the intended use of the cloud service API.
[0059] Identify the target user groups of the API, including but not limited to front-end developers and external partners.
[0060] b. Demand Analysis:
[0061] According to the business requirements document, list the functional points of each API.
[0062] Each function point has clear inputs and outputs, as well as expected behaviors.
[0063] Document any boundary conditions and exception handling strategies that exist.
[0064] c. Documentation writing:
[0065] Write a detailed requirements specification, including a description of the API's functionality and expected outcomes.
[0066] The requirements specification contains all the necessary technical details to ensure that the development team can develop accordingly.
[0067] S12: Obtain an interface parameter list of each API by designing the interface parameters of the cloud service API.
[0068] In this embodiment, the steps are specifically as follows:
[0069] a. Input parameter design:
[0070] For GET requests, parameters are usually passed as a query string.
[0071] For POST / PUT / PATCH requests, parameters are usually placed in the request body.
[0072] Determine the data type (for example, integer, string), whether it is required, the default value, etc. for each parameter.
[0073] For security reasons, sensitive data should be transmitted encrypted and clearly stated in the documentation.
[0074] b. Output parameter design:
[0075] Determines the format of the API response, typically JSON or XML.
[0076] Design the output structure, including data fields and status codes.
[0077] Defines error responses, including error codes and error messages.
[0078] c. Documentation writing:
[0079] Write a detailed interface parameter specification, including parameter name, type, description, and example.
[0080] If applicable, you can also add some example requests and responses to aid understanding.
[0081] S13: Obtain an API definition list by combining the function requirement list and the interface parameter list.
[0082] In this embodiment, the steps are specifically as follows:
[0083] a.API specification document writing:
[0084] Write API documentation using the Open API Specification.
[0085] Document each API in detail, including path, method, parameters, response, etc.
[0086] Use tools including but not limited to Swagger to assist in generating and maintaining documentation.
[0087] b.Automation tool preparation:
[0088] Set up automated tools, including but not limited to Swagger Codegen, to automatically generate client libraries and server code skeletons from API documentation.
[0089] The generated code can be used as a basic template for development.
[0090] S2: Build multiple Java projects and integrate multiple cloud service APIs of the built service architecture into multiple Java projects.
[0091] Specifically, step S2 includes the following steps:
[0092] S21: Create an independent Java project for each cloud service API to obtain multiple Java projects.
[0093] In this embodiment, the steps are specifically as follows:
[0094] a. Project initialization:
[0095] Create a new Java project using a build tool including but not limited to Maven and Gradle.
[0096] Specify the project's group ID and artifact ID to distinguish different cloud service API projects.
[0097] Configure the version number of the project for easy tracking and management.
[0098] b. Dependency Management:
[0099] Add required dependency libraries, including but not limited to HTTP client libraries (such as Apache HttpClient or OkHttp), for making network requests.
[0100] Add JSON processing libraries (including but not limited to Jackson and Gson) to parse the data returned by the cloud service API.
[0101] c. Directory structure planning:
[0102] Set up directories for source code, resource files, test code, etc. according to project requirements.
[0103] Create a specific package structure to organize the code, including but not limited to com.example.cloudservice.client for storing client code.
[0104] d.Environment configuration:
[0105] Set the project's build configuration, including but not limited to compiler version and JVM parameters.
[0106] Create a gitignore file to exclude unnecessary files from being tracked by the version control system.
[0107] S22: Integrate the cloud service API in the obtained API definition list into each Java project to obtain an integrated Java project.
[0108] In this embodiment, the steps are specifically as follows:
[0109] a.API client implementation:
[0110] Create a Java class to simulate the call of the cloud service API based on the functional requirements and interface parameters in the API definition list.
[0111] Implement methods to construct HTTP requests, send them to the cloud service API, and process the returned responses.
[0112] b. Exception handling:
[0113] Implement exception handling mechanisms, such as capturing network errors, timeout errors, etc.
[0114] Provide appropriate error information or exception to the caller.
[0115] c.Unit testing:
[0116] Write unit tests to verify the correctness and robustness of each cloud service API client.
[0117] Use the Mock framework to simulate HTTP requests and responses to ensure test isolation.
[0118] d. Document writing:
[0119] Write Javadoc documentation for each client class and method to make it easier for other developers to understand and use.
[0120] Create a README file that outlines the steps for installing, configuring, and using the project.
[0121] S3: Encapsulate the cloud service API as a Java class in the corresponding Java project, and create a configuration file for specifying the access path and parameters of the cloud service API.
[0122] Specifically, step S3 includes the following steps:
[0123] S31: Encapsulate the cloud service API in the integrated Java project to obtain an encapsulated Java class.
[0124] In this embodiment, the steps are specifically as follows:
[0125] a. Select the packaging mode:
[0126] Decide which design pattern to use for API encapsulation. Common ones include factory pattern, singleton pattern, etc.
[0127] For example, you can choose to use the factory pattern to create an API client instance, or use the singleton pattern to ensure the uniqueness of the API client in the entire application.
[0128] b. Define the interface:
[0129] Create an interface to define the main operations of the cloud service API.
[0130] The interface should include basic methods, including but not limited to HTTP methods such as GET, POST, PUT, and DELETE.
[0131] c. Implementation class:
[0132] For each cloud service API, create an implementation class that implements the interface defined previously.
[0133] The implementation class is responsible for handling specific HTTP request logic, including but not limited to building URLs, setting HTTP headers, serializing / deserializing request and response data, etc.
[0134] d.Exception handling:
[0135] Implementing classes should catch network errors and other exceptional conditions and throw custom exceptions so that callers can do appropriate error handling.
[0136] The exception should contain sufficient information, such as HTTP status code, error message, etc.
[0137] e. Testing:
[0138] Unit test the encapsulated Java classes to ensure that they work as expected.
[0139] Tests should cover both normal and abnormal situations.
[0140] S32: Create a configuration file to specify the access path and parameters of the cloud service API.
[0141] In this embodiment, the steps are specifically as follows:
[0142] a. Select the configuration file format:
[0143] Select an appropriate configuration file format, including but not limited to properties, XML, and YAML.
[0144] Among them, YAML has become a common choice for modern projects due to its simplicity and readability.
[0145] b. Define configuration items:
[0146] Define the basic information of the cloud service API in the configuration file, including but not limited to the base URL, authentication information, and timeout limit.
[0147] c. Read configuration:
[0148] Add a method to read the configuration file in the Java class. You can use the Java built-in Properties class or other third-party libraries such as Apache Commons Configuration to parse the configuration file.
[0149] d.Configuration injection:
[0150] At runtime, the values in the configuration file are injected into the corresponding Java class through a dependency injection framework (such as Spring). This avoids hard-coding API URLs and parameters and improves the flexibility of the code. S4: Package all encapsulated Java projects into archive files and deploy all archive files to the package management repository.
[0151] Specifically, step S4 includes the following steps:
[0152] S41: Use a build tool to package the obtained Java project including the encapsulated Java class to obtain an archive file.
[0153] In this embodiment, the steps are specifically as follows:
[0154] a. Select the build tool:
[0155] Build tools include but are not limited to Maven and Gradle. Maven is widely adopted due to its rich plugin ecosystem and project management capabilities, while Gradle is favored for its flexibility and speed advantages.
[0156] b. Configure the build script:
[0157] Create or edit the pom.xml file in the root directory of the project. This is the Maven project configuration file. Configure the project's dependencies, build lifecycle, and plug-ins in pom.xml. Use Maven's jar plug-in and maven-assembly-plugin to package the project.
[0158] c. Execute the build command:
[0159] Open a terminal or command line window and go to the root directory of the project.
[0160] d. Generate archive files:
[0161] After the build is complete, an archive file will be generated in the target directory of the project.
[0162] S42: Deploy the archive file to obtain the archive file deployed into the package management warehouse, wherein the package management warehouse includes a private Maven warehouse and a public Maven warehouse.
[0163] In this embodiment, the steps are specifically as follows:
[0164] a. Select the package management repository:
[0165] Decide whether to use a private Maven repository, a public Maven repository, or both.
[0166] Private repositories are typically used for internal projects, while public repositories such as Maven Central can be used for publicly released libraries.
[0167] b. Configure warehouse information:
[0168] Add the release configuration of the warehouse in pom.xml, including the warehouse URL, user name, password and other information, and use Maven's deploy plug-in for deployment.
[0169] c. Execute the deployment command:
[0170] Run the deployment command in a terminal or command line window.
[0171] d. Verify the deployment:
[0172] Log in to the package management repository to check whether the archive file is successfully deployed and ensure that the version number is correct so that subsequent projects can reference it correctly.
[0173] S5: Add the archive file obtained from the package management repository as a dependency in the target client project, and call the cloud service API encapsulated in the Java project through the corresponding configuration file.
[0174] Specifically, step S5 includes the following steps:
[0175] S51: Adding a dependency in the target client project, wherein the dependency is used to point to the deployed archive file.
[0176] In this embodiment, the steps are specifically as follows:
[0177] a. Select the build tool:
[0178] Determine the build tool used by the target client project, such as Maven or Gradle.
[0179] b. Add dependency declaration:
[0180] Maven: Add the dependency in the project's pom.xml file.
[0181] Gradle: Add dependencies in build.gradle file.
[0182] c. Synchronous dependency:
[0183] Run the corresponding command to synchronize dependencies.
[0184] Maven: Use the mvn clean install command.
[0185] Gradle: Use the gradle build command.
[0186] d. Verify dependencies:
[0187] Check the project's dependency tree to confirm that the added dependency has been resolved correctly.
[0188] Maven: Use the mvn dependency:tree command.
[0189] Gradle: Use the gradledependencies command.
[0190] S52: Parse the configuration file to obtain the access path and parameters of the corresponding cloud service API.
[0191] In this embodiment, the steps are specifically as follows:
[0192] a. Configuration file format:
[0193] Choose the format of the configuration file, including but not limited to properties, YAML, or XML.
[0194] b. Read the configuration file:
[0195] Use the classes provided by Java to read configuration files. Properties: applicable to properties files. YAML: you can use third-party libraries such as SnakeYAML.
[0196] c. Parsing configuration:
[0197] Extract the access path and parameters of the cloud service API from the configuration file.
[0198] S53: Use the parsed access path and parameters to call the encapsulated cloud service API to obtain a service response.
[0199] In this embodiment, the steps are specifically as follows:
[0200] a. Create a client:
[0201] Create a client object using a Java HTTP client library (including but not limited to Apache HttpClient, OkHttp, and Spring Web Client).
[0202] b. Initiate a request:
[0203] Use the client object to send a request to the cloud service API. For a GET request, create an HttpGet object and set the URL. For a POST request, create an HttpPost object, set the URL, and attach a request body.
[0204] c. Process the response:
[0205] Parse the response and process the returned data.
[0206] Specifically, the integration method further includes:
[0207] In each Java project, a security mechanism is added for each cloud service API, wherein the security mechanism includes HTTPS authentication and OAuth authentication.
[0208] In this embodiment, in each Java project, a security mechanism is added to each cloud service API, where the security mechanism includes HTTPS authentication and OAuth authentication.
[0209] HTTPS is a secure HTTP protocol that uses SSL / TLS encryption to protect the security of communications. To enable HTTPS authentication, you need to ensure that the server is configured with an SSL certificate and handle HTTPS connections appropriately in the client code.
[0210] The specific implementation steps are:
[0211] a. Server side: Configure SSL certificate and enable HTTPS support.
[0212] b. Client side: Use an HTTP client library that supports HTTPS. If you need to trust a self-signed certificate or a specific certificate authority, you can do so by configuring the TrustManager.
[0213] OAuth Authentication
[0214] OAuth is an open standard authorization protocol that allows applications to gain limited access to a user's account data without revealing the user's password.
[0215] The specific implementation steps are:
[0216] a. Obtain OAuth Token: Send a request to the OAuth authorization server to obtain the Access Token. At the same time, you need to implement the OAuth client and handle the authorization process (such as authorization code flow, implicit flow, etc.).
[0217] b. Use OAuth Token: Add the Access Token to the HTTP request header, usually using the "Authorization" header field, and carry the Access Token in each request.
[0218] Specifically, the integration method further includes:
[0219] In each Java project, the number of API instances is automatically adjusted according to a predefined strategy based on load indicators monitored in real time, wherein the adjustment includes expanding or reducing the number of API instances.
[0220] In this embodiment, in each Java project, the number of API instances is automatically adjusted according to a predefined strategy based on load indicators monitored in real time.
[0221] Implementation steps
[0222] a. Load monitoring: integrated monitoring tools, including but not limited to Prometheus, Grafana, and New Relic.
[0223] Monitor key performance indicators (KPIs), including but not limited to CPU usage, memory usage, response time, and request volume.
[0224] b. Define the strategy:
[0225] Set thresholds. For example, scaling out is triggered when CPU usage reaches 70%, and scaling down is triggered when it drops to 30%. Define scaling out and scaling down rules, such as increasing or decreasing a certain number of instances.
[0226] c. Automatic scaling:
[0227] Use the auto-scaling feature of a container orchestration platform (such as Kubernetes) or a cloud service provider to automatically adjust the number of instances based on monitoring data. Considering the cold start time and resource warm-up, you may need to reserve a certain buffer time.
[0228] The working principle of a Java-based cloud service integration method provided by the present invention is as follows:
[0229] First, by analyzing the functional requirements of the cloud service API, we get a functional requirement list for each API; then, by designing the interface parameters of the cloud service API, we get an interface parameter list for each API; finally, by combining the functional requirement list and the interface parameter list, we get an API definition list. These steps ensure that the functional requirements and interface parameters of the cloud service API are accurately defined and designed.
[0230] Create an independent Java project for each cloud service API to obtain multiple Java projects; then, integrate the cloud service API in the API definition list in each Java project to obtain an integrated Java project. These steps ensure that each cloud service API is implemented in an independent Java project and remains separate from other APIs for easy management and maintenance.
[0231] Encapsulate the cloud service API in the integrated Java project to obtain the encapsulated Java class; then create a configuration file to specify the access path and parameters of the cloud service API. These steps ensure that the cloud service API is encapsulated into a reusable Java class, and the configuration file provides the client with the path and parameter information required to access the API.
[0232] Use a build tool (such as Maven or Gradle) to package the Java project including the encapsulated Java class to obtain an archive file; then, deploy the archive file to obtain an archive file deployed to a package management repository (such as a private Maven repository and a public Maven repository). These steps ensure that the Java project is packaged into an archive file and can be easily integrated by other projects by adding dependencies.
[0233] Add a dependency to the target client project, where the dependency is used to point to the deployed archive file; then, parse the configuration file to obtain the access path and parameters of the corresponding cloud service API; finally, use the parsed access path and parameters to call the encapsulated cloud service API to obtain the service response. These steps ensure that the client project can easily call the cloud service API and can correctly initiate requests based on the information in the configuration file.
[0234] In addition, the present invention also provides the following additional steps to enhance the security and scalability of cloud services:
[0235] Security mechanism: In each Java project, add security mechanisms to each cloud service API, including HTTPS authentication and OAuth authentication, to improve the security of cloud services.
[0236] Dynamic load management: In each Java project, the number of API instances is automatically adjusted according to predefined policies based on real-time monitored load indicators to ensure high availability and performance of the service.
[0237] Embodiment 2
[0238] The present invention also provides a Java-based cloud service integration system for executing the Java-based cloud service integration method. Figure 2 As shown, the integrated system comprises:
[0239] The architecture design module 100 is used to construct a service architecture based on multiple defined API definitions of cloud service APIs, wherein the API definitions include functional requirements and interface parameters of the cloud service APIs.
[0240] The integration module 200 is used to construct multiple Java projects and integrate multiple cloud service APIs of the constructed service architecture into the multiple Java projects accordingly.
[0241] The API encapsulation and configuration module 300 is used to encapsulate the cloud service API as a Java class in the corresponding Java project and create a configuration file for specifying the access path and parameters of the cloud service API.
[0242] The project packaging and deployment module 400 is used to package all packaged Java projects into archive files respectively, and deploy all archive files to the package management warehouse.
[0243] The client integration and calling module 500 is used to add the archive file obtained from the package management repository as a dependency in the target client project, and call the cloud service API encapsulated in the Java project through the corresponding configuration file.
[0244] The present application is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0245] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0246] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device that includes a series of elements includes not only those elements, but also other elements that are not explicitly listed, or includes elements that are inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device that includes the elements.
Claims
1. A Java-based cloud service integration method, characterized in that: The integration method comprises the following steps: S1: Building a service architecture based on multiple defined API definitions of cloud service APIs, wherein the API definitions include functional requirements and interface parameters of the cloud service APIs; S2: Build multiple Java projects and integrate multiple cloud service APIs of the built service architecture into multiple Java projects; S3: Encapsulate the cloud service API as a Java class in the corresponding Java project, and create a configuration file for specifying the access path and parameters of the cloud service API; S4: Package all the packaged Java projects into archive files, and deploy all the archive files to the package management repository; S5: Add the archive file obtained from the package management repository as a dependency in the target client project, and call the cloud service API encapsulated in the Java project through the corresponding configuration file.
2. The Java-based cloud service integration method according to claim 1, characterized in that: Step S1 includes the following steps: S11: Analyze the functional requirements of the cloud service API to obtain a functional requirement list for each API; S12: by designing the interface parameters of the cloud service API, an interface parameter list of each API is obtained; S13: Obtain an API definition list by combining the function requirement list and the interface parameter list.
3. The Java-based cloud service integration method according to claim 1, characterized in that: Step S2 includes the following steps: S21: Create an independent Java project for each cloud service API, obtaining multiple Java projects; S22: Integrate the cloud service API in the obtained API definition list into each Java project to obtain an integrated Java project.
4. The Java-based cloud service integration method according to claim 1, characterized in that: Step S3 includes the following steps: S31: Encapsulate the cloud service API in the integrated Java project to obtain an encapsulated Java class; S32: Create a configuration file to specify the access path and parameters of the cloud service API.
5. The Java-based cloud service integration method according to claim 1, characterized in that: Step S4 includes the following steps: S41: using a build tool to package the obtained Java project including the encapsulated Java class to obtain an archive file; S42: Deploy the archive file to obtain the archive file deployed into the package management warehouse, wherein the package management warehouse includes a private Maven warehouse and a public Maven warehouse.
6. The Java-based cloud service integration method according to claim 1, characterized in that: Step S5 includes the following steps: S51: Adding a dependency in the target client project, wherein the dependency is used to point to the deployed archive file; S52: Parse the configuration file to obtain the access path and parameters of the corresponding cloud service API; S53: Use the parsed access path and parameters to call the encapsulated cloud service API to obtain a service response.
7. The Java-based cloud service integration method according to claim 5, characterized in that: The construction tools include Maven and Gradle.
8. The Java-based cloud service integration method according to claim 1, characterized in that: The integration method further comprises: In each Java project, a security mechanism is added for each cloud service API, wherein the security mechanism includes HTTPS authentication and OAuth authentication.
9. The Java-based cloud service integration method according to claim 1, characterized in that: The integration method further comprises: In each Java project, the number of API instances is automatically adjusted according to a predefined strategy based on load indicators monitored in real time, wherein the adjustment includes expanding or reducing the number of API instances.
10. A Java-based cloud service integration system, used to execute a Java-based cloud service integration method according to any one of claims 1 to 9, characterized in that: The integrated system comprises: An architecture design module, used to build a service architecture based on multiple defined API definitions of cloud service APIs, wherein the API definitions include functional requirements and interface parameters of the cloud service APIs; Integration module, used to build multiple Java projects and integrate multiple cloud service APIs of the built service architecture into multiple Java projects; The API encapsulation and configuration module is used to encapsulate the cloud service API as a Java class in the corresponding Java project and create a configuration file for specifying the access path and parameters of the cloud service API; The project packaging and deployment module is used to package all the encapsulated Java projects into archive files and deploy all the archive files to the package management warehouse; The client integration and calling module is used to add the archive file obtained from the package management warehouse as a dependency in the target client project, and call the cloud service API encapsulated in the Java project through the corresponding configuration file.
Citation Information
Cited By
Method, device and equipment for realizing application access control by modularization, and storage medium
CN121441549A