Microservice calling method and device, storage medium and gateway server

By packaging functional modules into integrated microservices and deploying them in cloud resources, the problem of complex version control logic in the traditional microservice development model is solved, efficient resource utilization and simplified deployment and operation are achieved, and the stability of the system is improved. and flexibility.

CN118819902APending Publication Date: 2024-10-22YGSOFT INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411042758.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-10-22

AI Technical Summary

Technical Problem

The traditional microservice development model leads to complex version control logic during the frequent iteration of functional modules, increases the complexity and error probability of the system, and reduces the stability and reliability of the system.

Method used

Package the specified version of the functional module into a fusion microservice, configure a version identifier for it, deploy it in a cloud resource container, query the target container through the user ID, and use the fusion microservice in the target container to respond to the request message to realize the microservice Flexible combination and version management.

Benefits of technology

It improves service response speed and resource utilization, simplifies deployment and operation and maintenance, reduces operation and maintenance costs, and improves system flexibility and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118819902A_ABST
    Figure CN118819902A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a micro-service calling method and device, a storage medium and a gateway server, and relates to the field of network communication. According to the application, on the basis of not changing a traditional deployment structure, one or more functional modules of the specified version are packaged into the fused micro-services, and the version identifier is configured for each fused micro-service, so that flexible combination and version management of the micro-services are realized. The converged micro-services are deployed in a container of cloud resources, so that the services can utilize the cloud resources more efficiently. According to the technical scheme, the request message carrying the user identifier is received, and the container identifier corresponding to the user is queried according to the pre-configured available version information, so that the fused micro-service in the target container can be accurately positioned. The request message is responded by using the fusion micro-service in the target container, and the response message is returned to the user, so that the response speed of the service is improved, the resource utilization rate can be effectively improved by configuring applicable crowds of different versions of micro-services, and the service capability beyond the conventional version can be provided for specific crowds.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network communications, and in particular to a microservice invocation method, device, storage medium and gateway server. Background Art

[0002] In the wave of cloud computing, with the significant improvement of resource utilization efficiency and the widespread adoption of microservices combined with DDD (domain-driven design) concepts, software architecture has ushered in unprecedented flexibility and modularity. A complex module is delicately disassembled into multiple independent small functional units, each of which is deployed in the cloud as an independent microservice, which not only promotes the rapid iteration and deployment of functions, but also enhances the scalability and maintainability of the system.

[0003] However, this advantage also exposes significant defects of the traditional microservice development model in the process of frequent iteration of software functional modules. Specifically, when a module in the system is subdivided into multiple microservices, each microservice often needs to work closely together to complete the overall function. However, as the version is constantly updated, some small functions may only be compatible with specific system versions, which forces developers to embed complex version judgment logic in the microservice code.

[0004] In traditional practices, if a module contains ten microservice functions, and each function needs to be differentiated according to the version, the maintenance cost will rise sharply. Each microservice needs to add version control logic independently, which not only violates the high cohesion and low coupling principle advocated by DDD, but also increases the overall complexity and error probability of the system. The spread of version logic not only makes the code difficult to understand and maintain, but also may introduce potential compatibility issues, thereby reducing the stability and reliability of the system. Summary of the invention

[0005] The embodiments of the present application provide a method, device, storage medium and gateway server for calling a microservice, which can solve the problem of complicated maintenance and poor system reliability caused by the change of microservice version in the functional module in the prior art. The technical solution is as follows:

[0006] In a first aspect, an embodiment of the present application provides a method for calling a microservice, the method comprising:

[0007] Packing one or more functional modules of a specified version into a fusion microservice, and configuring a version identifier for the fusion microservice;

[0008] Deploy the packaged converged microservices in containers on cloud resources;

[0009] Receiving a request message from a user; the request message carries a user identifier;

[0010] Querying the container identifier corresponding to the user identifier according to pre-configured available version information;

[0011] Determine the target container indicated by the container identifier in the cloud resource; a plurality of fusion microservices with different version identifiers are deployed in the cloud resource;

[0012] The fusion microservice in the target container is used to respond to the request message, and a response message is returned to the user.

[0013] In a second aspect, an embodiment of the present application provides a microservice invocation device, the device comprising:

[0014] A packaging unit, used to package one or more functional modules of a specified version into a fusion microservice, and configure a version identifier for the fusion microservice;

[0015] A deployment unit, used to deploy the packaged converged microservices in a container of cloud resources;

[0016] A transceiver unit, configured to receive a request message from a user; the request message carries a user identifier;

[0017] A query unit, used to query the container identifier corresponding to the user identifier according to pre-configured available version information;

[0018] A determination unit, configured to determine a target container indicated by the container identifier in the cloud resource; a plurality of fusion microservices with different version identifiers are deployed in the cloud resource;

[0019] The transceiver unit is further configured to respond to the request message using the fusion microservice in the target container, and return a response message to the user.

[0020] In a third aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the above-mentioned method steps.

[0021] In a fourth aspect, an embodiment of the present application provides a gateway server, which may include: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the above-mentioned method steps.

[0022] The beneficial effects brought about by the technical solutions provided by some embodiments of the present application include at least:

[0023] Without changing the traditional deployment structure, this technical solution realizes the flexible combination and version management of microservices by packaging one or more functional modules of a specified version into a fused microservice and configuring a version identifier for each fused microservice. These fused microservices are deployed in containers of cloud resources, so that services can use cloud resources more efficiently. By receiving a request message carrying a user identifier and querying the container identifier corresponding to the user based on the pre-configured available version information, this technical solution can accurately locate the fused microservice in the target container. By using the fused microservice in the target container to respond to the request message and return a response message to the user, it not only improves the response speed of the service, but also effectively improves resource utilization by configuring the applicable population of different versions of microservices, and can provide specific populations with service capabilities that exceed conventional versions. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the embodiments of the present application 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 of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0025] Figure 1 It is a schematic diagram of the network architecture provided by the embodiment of the present application;

[0026] Figure 2 It is a flowchart of a method for calling a microservice provided in an embodiment of the present application;

[0027] Figure 3 It is a schematic diagram of the principle of deploying and calling fusion microservices provided in an embodiment of the present application;

[0028] Figure 4 It is a structural diagram of a microservice calling device provided by the present application;

[0029] Figure 5 It is a structural diagram of a gateway server provided by this application. DETAILED DESCRIPTION

[0030] In order to make the objectives, technical solutions and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.

[0031] It should be noted that the microservice calling method provided in the present application is generally executed by a gateway server, and correspondingly, the microservice calling device is generally set in the gateway server.

[0032] Figure 1An exemplary system architecture that can be applied to a microservice invocation method or a microservice invocation device of the present application is shown.

[0033] like Figure 1 As shown, the system architecture may include: a gateway server 101 and a terminal device 102. The gateway server 101 and the terminal device 102 may communicate with each other through a network, and the network is used as a medium for providing communication links between the above-mentioned units. The network may include various types of wired communication links or wireless communication links, for example: a wired communication link includes an optical fiber, a twisted pair or a coaxial cable, etc., and a wireless communication link includes a Bluetooth communication link, a wireless fidelity (WIreless-FIdelity, Wi-Fi) communication link or a microwave communication link, etc.

[0034] Among them, the terminal device 102 stores real-time data of bonds, and the real-time data includes real-time bond issuance data, real-time bond issuer data and real-time news data. The gateway server 101 can obtain real-time data from the terminal device 102, and then use the current model to predict the real-time data to obtain the prediction results of the bonds.

[0035] It should be noted that the gateway server 101 and the terminal device 102 can be hardware or software. When the gateway server 101 and the terminal device 102 are hardware, they can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the gateway server 101 and the terminal device 102 are software, they can be implemented as multiple software or software modules (for example, for providing distributed services), or as a single software or software module, which is not specifically limited here.

[0036] Various communication client applications can be installed on the gateway server of the present application, such as: video recording applications, video playback applications, voice interaction applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0037] The terminal device of the present application may be any terminal device with a display screen, including but not limited to a smart phone, a tablet computer, a laptop computer, a desktop computer, etc. When the terminal device is software, it may be installed in the terminal device listed above. It may be implemented as multiple software or software modules (for example, to provide distributed services), or as a single software or software module, which is not specifically limited here.

[0038] It should be understood that Figure 1 The number of gateway servers, networks and terminal devices in the figure is only for illustration. Any number of gateway servers, networks and terminal devices may be used as required.

[0039] The following will be combined with the attached Figure 2, the calling method of the microservice provided in the embodiment of the present application is described in detail. Among them, the calling device of the microservice in the embodiment of the present application can be Figure 1 The gateway server shown.

[0040] See also Figure 2 , which is a flowchart of a microservice calling method provided in the present application embodiment. Figure 2 As shown, the method of the embodiment of the present application may include the following steps:

[0041] S201. Package one or more functional modules of a specified version into a fusion microservice, and configure a version identifier for the fusion microservice.

[0042] Among them, ensure that all functional modules are stored in a version control system (such as Git), so that the specified version of the code can be accurately tracked and obtained. According to business requirements or project plans, determine the functional modules and their version numbers that need to be included in the current fusion microservice. Use the checkout or pull command of the version control system (such as Git) to download the functional module code of the specified version to the working directory of the local computer device. Integrate the downloaded functional module code into a new or existing microservice project. This may include adjusting the project structure, modifying the configuration file to include all required dependencies, etc. Use dependency management tools (such as Maven, Gradle, or npm) to manage project dependencies. Ensure that all required libraries and frameworks are correctly declared and the versions are compatible. Configure the build tool (such as Maven's pom.xml or Gradle's build.gradle file) to include all required compilation and packaging settings. This may include specifying the main class, setting the resource file path, configuring the plug-in, etc. Run the build command (such as mvn package or gradle build) to package the microservice project into a deployable unit, such as a JAR file or a Docker image. During the packaging process, a unique version identifier is assigned to the Fusion Microservice. This is usually achieved by specifying the version number in the build configuration. For JAR files, the version number may be included in the file name; for Docker images, the version number is used as the image tag. Record the microservice version information in the version control system for tracking and auditing. This can be achieved by creating a tag in the code repository or submitting a special commit containing the version information.

[0043] S202. Deploy the packaged fusion microservice in a container of cloud resources.

[0044] Among them, verify whether the integrated microservice image packaged in step S201 is complete and correct, which usually includes checking whether the image file exists and whether the size is reasonable. Upload the packaged microservice image to the container image repository (such as DockerHub, Alibaba Cloud Container Image Service ACR, Amazon ECR, etc.). Use the tools provided by the image repository or command line tools (such as docker push) to push the image to the specified warehouse and tag location. Select a suitable cloud service provider (such as Alibaba Cloud, Tencent Cloud, AWS, Azure, etc.) according to your needs. In the console of the cloud service provider, create necessary cloud resources, such as virtual machine instances, container clusters (such as Kubernetes clusters), load balancers, etc. Configure appropriate network access rules and security group settings for cloud resources to ensure that microservices can securely access external resources and be accessed externally.

[0045] Write or modify container deployment configuration files (such as Kubernetes' Deployment, StatefulSet, or Pod definition files) based on the cloud resource environment. Specify the container image's warehouse address, labels, resource limits, environment variables, and so on in the configuration file. Use the command line tools (such as kubectl, aws-cli, az, etc.) or console interface provided by the cloud service provider to apply the deployment configuration file to the cloud resources. This causes the cloud resource manager (such as the Kubernetes master node) to create and manage container instances based on the configuration file. Check the deployment status of the container instances through the cloud service provider's console or command line tools to ensure that they have been created and run correctly.

[0046] Create a Kubernetes Service resource for the microservice. The Service resource provides a stable access address (Cluster IP) for the Pod and can distribute incoming traffic to one or more Pods on the backend. If you need to access the microservice from outside the cluster, you can configure a Service of type LoadBalancer, which will automatically create an entry on the cloud service provider's load balancer and forward traffic to the Cluster IP of the Service. If the microservice needs to be accessed via a domain name, you can update the corresponding record in the DNS server to resolve the domain name to the public IP of the load balancer or the entry IP of the Ingress controller. Use tools (such as curl, Postman) or write scripts to send requests to the access address of the microservice to verify that the service responds as expected. Check the log output of the microservice and the monitoring data provided by the cloud service provider to confirm that there are no errors or performance bottlenecks in the service.

[0047] Through the above steps, the packaged converged microservices can be successfully deployed in the container of cloud resources, and the services can be ensured to run normally and be accessible.

[0048] S203: Receive a request message from the user.

[0049] Among them, the gateway server configures and listens to one or more network ports to receive request messages from the client. The port can be a standard port of the HTTP or HTTPS protocol, such as 80 or 443. When the request arrives, the gateway server uses its built-in HTTP server (such as Nginx, Apache, Spring Boot embedded Tomcat, etc.) to parse the request message. This includes parsing the request line, request header, and request body. The gateway server extracts the user ID from the request message. The user ID may be stored in a specific field in the request header (such as Authorization, X-User-ID, etc.) or the request body.

[0050] S204: Query the container identifier corresponding to the user identifier according to the pre-configured available version information.

[0051] Among them, the gateway server reads the pre-configured available version information from its local file system, environment variables, database or configuration center (such as Consul, etcd, Spring Cloud Config Server, etc.). The information usually includes the service name, version number, corresponding container identifier (such as Pod name, instance ID, etc.) and the mapping relationship between the user identifier and the version or container. The gateway server parses the read configuration information and loads it into the data structure in memory (such as Map, HashMap, Dictionary, etc.). The gateway server uses the extracted user identifier as the key (Key) to query the corresponding value (Value) in the configuration information data structure in memory. This value may directly point to the container identifier.

[0052] S205: Determine the target container indicated by the container identifier in the cloud resources.

[0053] Among them, before forwarding the request to the target container, the gateway server can perform a health check to ensure that the target container is available. This can be done by calling the health check endpoint of the container or using the health check API provided by the cloud service provider. If the target container is not available, the gateway server can choose to forward the request to another available container instance of the same service, or return an error response to the client. The gateway server builds a forwarding request based on the determined container identifier (including IP address, port, etc.). Send the constructed request to the address of the target container.

[0054] S206: Utilize the fusion microservice in the target container to execute the request message, and return a response message to the user.

[0055] The gateway server establishes a network connection with the target container to transmit requests and receive responses. The gateway server waits for the response from the target container and reads the response message, which includes a response status code, a response header, and a response body.

[0056] The gateway server can verify the validity of the response, such as checking whether the response status code is within the expected range, or verifying certain fields in the response body. If the response data needs to be processed or transformed (such as formatting, encryption, decryption, compression, decompression, etc.), the gateway server will do it in this step. If the response indicates an error (such as HTTP status code 4xx or 5xx), the gateway server can decide whether to forward the error response directly to the client or implement some error recovery strategies (such as retry, fallback to the default service version, etc.). The gateway server builds the final response to be sent to the client based on the processed response data (if processing is required). This includes setting the correct HTTP status code, response header, and response body. The gateway server sends the constructed response to the client of the original request through the network protocol. The gateway server records key performance indicators during the request processing process, such as request response time, throughput, error rate, etc., for monitoring and performance analysis. The gateway server records detailed information of the request and response, including request time, target container identifier, response status code, response size, etc., for troubleshooting and auditing when problems occur.

[0057] If any temporary resources (such as database connections, file handles, etc.) are allocated during the request processing, the gateway server should clean up these resources at this time. If the caching mechanism is enabled, the gateway server can decide whether to cache the response data so that the same request in the future can get the response directly from the cache without calling the fusion microservice in the target container again. Through the above steps, the gateway server can effectively use the fusion microservice in the target container to process the request and return the response message to the user. In this process, the gateway server plays the role of request forwarder, response processor and resource manager, ensuring the reliability and efficiency of the system.

[0058] The process of this application is described below with reference to a specific example.

[0059] See also Figure 3As shown, module A and module B are two functional modules. Module A is associated with function 1 and function 2, where function is the abbreviation of function point. Function 1 is associated with microservice 1, and function 2 is associated with microservice 2. The version of function 1 is V1, and the version of function 2 is V2. Module B is associated with function 1 and function 2, and function 1 is associated with microservice 3 with version number V2. Function point 2 is associated with microservice 4 with version number V2. Fusion process: package function 1 of module A, function 1 and function 2 of module B into fused microservice 1, package function 1 of module A into fused microservice 2, package function 1 and function 2 of module B into fused microservice 3, package function 2 of module A, function 1 and function 2 of module B into fused microservice 4, and then deploy the above fused microservices in the container of cloud resources. The configuration represents the available version information between the container identifier and the user identifier. When the gateway server receives the user's request message, it queries the corresponding container identifier in the available version information according to the user identifier carried in the request message, then sends a request message to the corresponding container and returns a response message to the user, thereby realizing the distribution of different users to different versions of converged microservices.

[0060] The embodiments of the present application specifically include the following beneficial effects:

[0061] This application greatly improves the utilization rate of cloud computing resources by combining one or more modules of a specified version into a fusion microservice and intelligently using rules to determine which container the current user's request should use to run. In the traditional way, each version of the microservice needs to be deployed independently and occupies a dedicated container space and IP port, which leads to a large waste and fragmentation of resources. This solution can dynamically manage and allocate resources, so that resources can be used more efficiently.

[0062] Simplified deployment: In traditional microservice architecture, every time a new version is released, a lot of deployment work is required, including configuring the environment, allocating resources, starting services, etc. In this application, due to the adoption of the concept of fusion microservices, it is only necessary to combine the updated modules into the existing fusion microservices without deploying each microservice separately. This greatly simplifies the deployment process and reduces the time and labor costs required for deployment.

[0063] Reduced operation and maintenance costs: As the number of microservices increases, operation and maintenance work becomes more and more complex and arduous. In traditional methods, each microservice needs to be monitored, log collected, and troubleshooted separately. In this application, due to the existence of integrated microservices, operation and maintenance personnel can manage these services more centrally, reducing a lot of repetitive work. At the same time, due to the improvement of resource utilization, operation and maintenance problems caused by insufficient resources are also reduced.

[0064] Improved flexibility and scalability: This application uses rules to determine the distribution of requests, so that the system can flexibly adjust the deployment and expansion of services according to actual needs. When the number of requests for a service increases, the corresponding container resources can be quickly added to cope with it; when the number of requests decreases, excess resources can be released to save costs. This flexibility and scalability enable the system to better adapt to business changes and developments.

[0065] Improve user experience: By intelligently assigning requests to appropriate containers, this application can ensure that user requests are responded to promptly and accurately. At the same time, it also improves the overall user experience by reducing service interruptions or delays caused by insufficient resources.

[0066] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0067] See also Figure 4 , which shows a schematic diagram of the structure of a microservice invocation device provided by an exemplary embodiment of the present application, hereinafter referred to as device 4. The device 4 can be implemented as all or part of the gateway server through software, hardware or a combination of both. The device 4 includes: a packaging unit 401, a deployment unit 402, a transceiver unit 403, a query unit 404, and a determination unit 405.

[0068] The packaging unit 401 is used to package one or more functional modules of a specified version into a fusion microservice, and configure a version identifier for the fusion microservice;

[0069] A deployment unit 402 is used to deploy the packaged fusion microservice in a container of cloud resources;

[0070] The transceiver unit 403 is used to receive a request message from a user; the request message carries a user identifier;

[0071] A query unit 404, configured to query the container identifier corresponding to the user identifier according to pre-configured available version information;

[0072] A determination unit 405 is configured to determine a target container indicated by the container identifier in the cloud resource; a plurality of fusion microservices with different version identifiers are deployed in the cloud resource;

[0073] The transceiver unit 403 is further configured to respond to the request message using the fusion microservice in the target container, and return a response message to the user.

[0074] In one or more possible embodiments, packaging one or more functional modules of a specified version into a fusion microservice includes:

[0075] Determine one or more functional modules according to the specified version number; wherein each functional module is associated with one or more microservices of functional points;

[0076] Add dependencies between functional modules and functional points to the project object model POM file;

[0077] One or more functional modules are built into a fused microservice image according to the POM file.

[0078] In one or more possible embodiments, deploying the packaged fusion microservice in a container of cloud resources includes:

[0079] Performing integrity verification on the fusion microservice image;

[0080] If the verification is successful, the fusion microservice image is uploaded to the container image repository;

[0081] A container is created in the cloud resources, and the fused microservice image is deployed in the container.

[0082] In one or more possible embodiments, the receiving a request message from a user includes:

[0083] The specified one or more network ports are listened to, and request messages from the user's client are received through the specified one or more network ports.

[0084] In one or more possible embodiments, querying the container identifier corresponding to the user identifier according to the pre-configured available version information includes:

[0085] Read pre-configured available version information from the registry;

[0086] Load the read available version information into memory;

[0087] Using the user ID as a key, the corresponding container ID is searched in memory.

[0088] In one or more possible embodiments, before determining the target container indicated by the container identifier in the cloud resource, the method further includes:

[0089] A health check is performed on the target container to ensure that the target container is in an available state.

[0090] In one or more possible embodiments, the response message includes a response status code, a response header, and a response body.

[0091] It should be noted that the device 4 provided in the above embodiment only uses the division of the above functional modules as an example when executing the microservice calling method. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above functions. In addition, the microservice calling device provided in the above embodiment and the microservice calling method embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.

[0092] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0093] The present application also provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded and executed by a processor as described above. Figure 2 The method steps of the embodiment shown in the figure can be found in the specific implementation process. Figure 2 The specific description of the illustrated embodiment will not be repeated here.

[0094] The present application also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the microservice calling method described in the above embodiments.

[0095] See also Figure 5 , which is a schematic diagram of the structure of a gateway server provided in the embodiment of the present application. Figure 5 As shown, the gateway server 500 may include: at least one processor 501 , at least one network interface 504 , a user interface 503 , a memory 505 , and at least one communication bus 502 .

[0096] The communication bus 502 is used to realize the connection and communication between these components.

[0097] The user interface 503 may include a display screen (Display) and a camera (Camera), and the optional user interface 503 may also include a standard wired interface and a wireless interface.

[0098] The network interface 504 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).

[0099] Among them, the processor 501 may include one or more processing cores. The processor 501 uses various interfaces and lines to connect various parts within the entire gateway server 500, and executes various functions and processes data of the gateway server 500 by running or executing instructions, programs, code sets or instruction sets stored in the memory 505, and calling data stored in the memory 505. Optionally, the processor 501 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 501 can integrate one or more combinations of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 501, and it can be implemented separately through a chip.

[0100] Among them, the memory 505 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 505 includes a non-transitory computer-readable storage medium. The memory 505 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 505 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 505 may also be optionally at least one storage device located away from the aforementioned processor 501. As Figure 5 As shown, the memory 505 as a computer storage medium may include an operating system, a network communication module, a user interface module and an application program.

[0101] exist Figure 5In the gateway server 500 shown in FIG. 1 , the user interface 503 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 501 can be used to call the application stored in the memory 505 and specifically execute the following steps: Figure 2 The specific process can be referred to Figure 2 As shown, no further description is given here.

[0102] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[0103] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. A method for calling a microservice, characterized in that: include: Packing one or more functional modules of a specified version into a fusion microservice, and configuring a version identifier for the fusion microservice; Deploy the packaged converged microservices in containers on cloud resources; Receive user's request message; The request message carries a user identifier; Querying the container identifier corresponding to the user identifier according to pre-configured available version information; Determine the target container indicated by the container identifier in the cloud resource; a plurality of fusion microservices with different version identifiers are deployed in the cloud resource; The fusion microservice in the target container is used to respond to the request message, and a response message is returned to the user.

2. The method according to claim 1, characterized in that The step of packaging one or more functional modules of a specified version into a fusion microservice includes: Determine one or more functional modules according to the specified version number; wherein each functional module is associated with one or more microservices of functional points; Add dependencies between functional modules and functional points to the project object model POM file; One or more functional modules are built into a fused microservice image according to the POM file.

3. The method according to claim 2, characterized in that The step of deploying the packaged fusion microservice in a container of cloud resources includes: Performing integrity verification on the fusion microservice image; If the verification is successful, the fusion microservice image is uploaded to the container image repository; A container is created in the cloud resources, and the fused microservice image is deployed in the container.

4. The method according to claim 1, 2 or 3, characterized in that: The receiving a request message from a user comprises: The specified one or more network ports are listened to, and request messages from the user's client are received through the specified one or more network ports.

5. The method according to claim 4, characterized in that The querying of the container identifier corresponding to the user identifier according to the pre-configured available version information includes: Read pre-configured available version information from the registry; Load the read available version information into memory; Using the user ID as a key, the corresponding container ID is searched in the memory.

6. The method according to claim 1 or 2 or 3 or 5, characterized in that: Before determining the target container indicated by the container identifier in the cloud resource, the method further includes: A health check is performed on the target container to ensure that the target container is in an available state.

7. The method according to claim 6, characterized in that The response message includes a response status code, a response header and a response body.

8. A microservice calling device, characterized in that: include: A packaging unit, used to package one or more functional modules of a specified version into a fusion microservice, and configure a version identifier for the fusion microservice; A deployment unit, used to deploy the packaged converged microservices in a container of cloud resources; A transceiver unit, used for receiving a request message from a user; The request message carries a user identifier; A query unit, used to query the container identifier corresponding to the user identifier according to pre-configured available version information; A determination unit, configured to determine a target container indicated by the container identifier in the cloud resource; a plurality of fusion microservices with different version identifiers are deployed in the cloud resource; The transceiver unit is further configured to respond to the request message using the fusion microservice in the target container, and return a response message to the user.

9. A computer storage medium, characterized in that The computer storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the method steps according to any one of claims 1 to 7.

10. A gateway server, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method steps as claimed in any one of claims 1 to 7.