Information processing method and system applied to micro service

By building tools to manage dependency packages and splitting business modules, configuring abstract interfaces and proxy modules, and writing deployment scripts, we solve the problem of switching between monolithic and microservice architectures, achieve codeless switching and flexible deployment, and reduce costs.

CN118778930AInactive Publication Date: 2024-10-15BEIJING TAIJI FAZHIYI TECH CO LTD

Patent Information

Application Number
CN202410861860.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-10-15
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing technology makes it difficult to switch between monolithic and microservice architectures without modifying the code, resulting in high development and maintenance costs and difficulty in meeting different deployment needs.

Method used

Manage dependency packages through building tools, split business modules, configure abstract interface modules and internal proxy modules, and write monolithic and microservice deployment scripts to achieve code-free switching between the two architectures.

Benefits of technology

It enables switching between monolithic and microservice architectures without modifying the code, reducing development and maintenance costs and providing flexibility to meet different deployment needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118778930A_ABST
    Figure CN118778930A_ABST
Patent Text Reader

Abstract

The invention relates to the field of information processing, and discloses an information processing method and system applied to micro-services, and the method comprises the steps that software engineering uses a construction tool to manage a dependency package; modules are reasonably split according to requirements, and a multi-module project is constructed; setting an abstract interface module for the associated service of each module; defining an internal agent module required by the micro-service architecture, and agenting an associated service interface required by each module; two construction scripts are compiled, an agent module of a module association service is introduced into the micro-service architecture construction script, and the agent module does not need to be introduced during single architecture; meanwhile, deployment packages of two architectures are output and can be switched at any time, and the deployment requirements of different scales can be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information processing, and in particular to an information processing method and system applied to microservices. Background Art

[0002] Monolithic architecture and microservice architecture are the two most widely used designs at present. In response to different customer requirements, such as technical architecture requirements, deployment hardware limitations, performance expansion, operation and maintenance costs, etc., one of the deployment methods will eventually be selected. In practice, the deployment method of software is generally determined by the software architecture design. If the software has been developed, switching the deployment method will cost a lot, and may even require overturning and redevelopment, so software architecture design is very important.

[0003] At present, common architecture designs can only meet one of the requirements, and cannot take into account both monolithic and microservices at the same time, nor can they achieve the requirement of switching between the two architectures at any time without modifying the code. The scenario method in the existing technology is to transform from one architecture to another architecture solution, which makes it difficult to develop a set of software products to meet different deployment requirements. At present, common switching deployment architecture solutions are: only one of the architectures is considered before the development of software projects or products. If it is necessary to upgrade from a monolithic application architecture to a microservice architecture, or from a microservice architecture to a monolithic application architecture, the code is modified on the basis of the already developed software, which increases the development cost, and once the customer requires to change back to the original architecture, the code migration development is required, which cannot respond quickly. Or before the development of software projects or products, both architectures are taken into account, and two sets of software architectures are made. Whichever architecture the customer needs to use is used. Although this meets the needs of responding to customers quickly, the initial development cost is almost doubled, the maintenance cost is also doubled, and there are many repetitive tasks, and the development efficiency is not high. How to achieve the system architecture design and processing efficiency of the coexistence of monolithic and microservices is a problem that needs to be solved. Summary of the invention

[0004] To solve one of the above problems, the present invention provides an information processing method applied to microservices.

[0005] The method includes: building a tool to manage dependency packages, using the building tool to perform dependency management, and distinguishing between jar packages required by both the monolith and the microservice and jar packages required by the microservice;

[0006] Configure the related dependencies and engineering codes of microservices required by microservices into a separate basic module; split the business modules according to business needs, and each different business becomes an independent business module. The business module is composed of various application microservices in the microservice deployment architecture;

[0007] Configure the association relationship between each business module. When there are related business requirements between the business modules, set the external association relationship abstract interface module of the business module. The abstract interface module is implemented in the external API interface of the corresponding business module.

[0008] Configure an internal proxy module for each business module. The internal proxy module is used to proxy the associated business interfaces required by each business module and configure the microservice implementation of the association relationship abstract interface module for introduction and use in the subsequent microservice deployment;

[0009] Compile the scripts for monolithic deployment and microservice deployment.

[0010] Preferably, the single deployment script includes: each business module, which needs to exclude the basic module of the microservice and the proxy module of the associated business.

[0011] Preferably, different single business application microservice deployment scripts are constructed according to different business modules.

[0012] Preferably, the business module further includes business proxy modules associated with other business modules and a basic module of microservices, and the business proxy modules associated with other business modules further include an association relationship abstract interface module.

[0013] Preferably, a proxy module for the business module-associated business is introduced into the microservice architecture construction script, and there is no need to introduce a proxy module in a monolithic architecture.

[0014] Preferably, a unified inter-microservice communication mechanism is established, each microservice runs independently as a separate process, and a unified inter-process communication mechanism is configured to realize the interaction between the microservices.

[0015] Preferably, a unique API description identifier is set for each microservice call to accept access or update requests from the user end.

[0016] Preferably, a configuration file is set according to task requirements, and a microservice interruption mechanism is set for calls between microservices. When a microservice call fails within a set periodic event, the service is interrupted and isolated.

[0017] Preferably, a computer storage medium is provided, on which computer program instructions are stored for implementing the above method.

[0018] Preferably, a system is provided, the system comprising a memory and a processor, the memory storing a computer program, the computer program being executed by the processor to implement the above method.

[0019] The present invention discloses an information processing method and system applied to microservices, the method comprising: using a construction tool in software engineering to manage dependency packages; reasonably splitting modules according to requirements to construct a multi-module project; setting an abstract interface module for the associated business of each module; each module's external API interface layer relies on the abstract interface module to complete the implementation of the associated business interface; defining an internal proxy module required by a microservice architecture to proxy the associated business interface required by each module; writing two construction scripts, introducing the proxy module of the module-associated business in the microservice architecture construction script, and not needing to introduce the proxy module in a monolithic architecture; using different construction scripts to compile deployment packages according to deployment requirements, based on which, no code needs to be modified, and the deployment packages of the two architectures are output simultaneously, and can be switched at any time to meet the deployment requirements of different scales. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The features and advantages of the present invention will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present invention in any way.

[0021] Figure 1 It is a schematic flow chart of the method of the present invention;

[0022] Figure 2 It is a schematic diagram of the microservice deployment and construction process of the present invention;

[0023] Figure 3 It is the monolithic deployment construction process of the present invention. DETAILED DESCRIPTION

[0024] These or other features and characteristics of the present invention, methods of operation, functions of related elements of the structure, combinations of parts, and economies of manufacture may be better understood with reference to the following description and drawings, which form a part of the specification. However, it is clearly understood that the drawings are used for illustration and description purposes only and are not intended to limit the scope of protection of the present invention. It is understood that the drawings are not drawn to scale. A variety of structural diagrams are used in the present invention to illustrate various variations according to embodiments of the present invention.

[0025] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0026] It should be noted that the “ / ” in this article means or, for example, A / B can mean A or B; the “and / or” in this article is only a way to describe the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0027] It should be noted that, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second", etc. are used to distinguish the same items or similar items with basically the same functions or effects. Those skilled in the art can understand that the words "first", "second", etc. do not limit the quantity and execution order. For example, the first information and the second information are used to distinguish different information, rather than to describe a specific order of information.

[0028] It should be noted that, in the embodiments of the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0029] Example 1

[0030] like Figure 1 As shown, the present invention provides an information processing method applied to microservices, wherein the method includes, firstly, building a tool management dependency package, splitting it into subtasks to build a multi-module project according to the user's task requirements; according to the associated business abstract interface module of each module, each module relies on the abstract interface module for the external API interface layer to complete the implementation of the associated business interface, and then defining the internal proxy module required by the microservice architecture to proxy the associated business interface required by each module; writing two build scripts, introducing the proxy module of the module-associated business in the microservice architecture build script, and no need to introduce the proxy module in the monolithic architecture; finally, using different build scripts to compile the deployment package according to the deployment requirements.

[0031] In a preferred implementation, a build tool manages dependency packages and builds a multi-module project: Software engineering requires the use of a build tool for dependency management to distinguish between jar packages required by both monolithic and microservices and jar packages required by microservices.

[0032] Configure the related dependencies and engineering codes required by the microservice into a separate basic module for introduction and use in subsequent microservice deployment.

[0033] Business modules are split according to business needs. Each different business becomes an independent module, which constitutes the various application microservices in the microservice deployment architecture.

[0034] Process the association relationship between each module. When there are related business requirements between business modules, set the module's external association relationship abstract interface module, and the implementation of the abstract interface is implemented in the module's external API interface.

[0035] After each business module forms a microservice, in order to realize the internal call of the mutual association relationship, an internal proxy module is configured. The internal proxy module is used to proxy the associated business interface required by each module, configure the microservice implementation of the association relationship abstract interface module, and introduce it for use in the subsequent microservice deployment.

[0036] like Figure 2-3 As shown, compile different build scripts to complete deployment packaging: write two build scripts, one for monolithic deployment and one for microservice deployment.

[0037] The single deployment script includes: each business module, which needs to exclude the basic module of microservices and the proxy module of related businesses.

[0038] Different business modules form different single business application microservice deployment scripts. A certain application microservice deployment script includes: the business module, which contains the business proxy module associated with other business modules and the basic module of microservices. The business proxy module associated with other business modules contains the abstract interface module of the association relationship. You can select different scripts according to your needs, compile and package them to form the final deployment package you need.

[0039] In an exemplary implementation, the method further includes that the server manages and sets the deployed microservices and monomers. The basic modules of the microservices are stored on the server, and the client sets the configuration file according to the task requirements, and sets the microservice interruption mechanism for the calls between microservices. The system interrupts the service according to the cascaded hierarchical call relationship in the configuration file, and when a service call fails within the set periodic event, the service is fed back to the server, and the server informs the calling end of the failure. The server automatically schedules the microservice replica according to the feedback message to reply to the cascaded users.

[0040] In an optional way, if the microservice is judged to be abnormal, the key corresponding to the microservice will be removed from the service discovery key value, preventing subsequent cascade calls, and the microservice copy will be configured in the server's configuration file. In an exemplary way, when a registered microservice fails, the microservice will be immediately deregistered by another process after the set timeout. The server executes a heartbeat mechanism for the microservice to ensure its own survival status. The called microservice instance communicates with the server in the form of a heartbeat packet. If the heartbeat packet is not received within the specified time, the microservice will be deactivated or removed after the set timeout. The above timeout setting is adapted to the deployment configuration method of the microserver. When the same microservice is deployed to multiple service nodes, the corresponding timeout is longer than the configuration duration of a single service node.

[0041] The server further provides a unified entry point for external access to microservices, simplifies the call logic, provides dynamic routing and monitoring, and configures a load balancing mechanism during the call process. Microservices can be deployed as independent processes, multiple identical microservices can be deployed on different service nodes, or multiple microservice instances can be deployed on one service node, so that when a microservice fails, it will not cause the entire system to crash.

[0042] In an exemplary implementation, the server establishes a unified inter-service communication mechanism for different services. Each microservice runs independently as a separate process, and a unified inter-process communication mechanism is configured to realize the interaction between the microservices. A unique API description identifier is set for each microservice call, and the server accepts access and update requests from the user end, and monitors the basic modules corresponding to different microservices.

[0043] In a preferred implementation, the asynchronous communication mode between the server and the user terminal is based on a message queue, and messages are cached by the message middleware to achieve loose coupling between the client and the server. The AMQP protocol can be used as an example to support a request / asynchronous response communication mechanism, thereby improving the system microservice call performance.

[0044] The server monitors the calling status of each microserver, each microserver is registered and discovered in the server, the server stores the user's configuration file relationship, the user terminal configures the hierarchical calling relationship of each microservice according to the calling relationship of the server, the server stores and stores the logical calling relationship of each user terminal, the user terminal asynchronously feeds back the result of each call, the server obtains the access status of different microservices in each business module according to different microserver API descriptors, obtains the overlapping microservice description identifiers in each business module according to the feedback information of the user terminal, and locates the fault information of the abnormal microservice.

[0045] The present invention also provides a system, which includes a server and a user terminal. The server user executes the above-mentioned monolithic and microservice deployment method and manages the deployed microservices. The user terminal calls the microservices by accessing the server.

[0046] Example 2

[0047] Taking the development of the enterprise's contract and legal management system as an example, the deployment requirements of the system can be deployed as a single service, or it can be split into contract microservices and legal microservices for deployment. In order to meet the deployment requirements of the system, the system adopts multi-module construction when building the code project. The business modules are divided into contract business module and legal business module according to the coarse granularity of the requirements. The legal business module will use the contract query function in the contract business module. The final code project consists of: microservice basic module, contract module, contract abstract interface module, contract proxy module, and legal module. Maintain the mutual reference relationship of the modules in the deployment script, and the microservice script reference relationship: Among them, contract microservice: the contract module references the microservice basic module and the contract abstract interface module; legal microservice: the legal module references the microservice basic module and the contract proxy module; the contract proxy module references the contract abstract interface module.

[0048] The reference relationship of the single script: contract module and legal module, the contract module references the contract abstract interface module. Finally, after compiling the two scripts separately, two deployment packages are generated.

[0049] Example 3

[0050] The present invention provides a computer storage medium, on which computer program instructions are stored, for implementing the above method. The present invention provides a system, which includes a memory and a processor, on which a computer program is stored, and which is executed by the processor to implement the above method.

[0051] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant 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. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.

[0052] As used in this application, the terms "component", "module", "system", etc. are intended to refer to a computer-related entity, which can be hardware, firmware, a combination of hardware and software, software, or software in operation. For example, a component can be, but is not limited to: a process running on a processor, a processor, an object, an executable file, a thread in execution, a program, and / or a computer. As an example, an application running on a computing device and the computing device can both be components. One or more components can exist in a process and / or thread in execution, and a component can be located in a computer and / or distributed between two or more computers. In addition, these components can be executed from various computer-readable media having various data structures thereon. These components can communicate in a local and / or remote process manner, such as according to a signal having one or more data packets (e.g., data from a component that interacts with another component in a local system, a distributed system, and / or interacts with other systems in a signal manner through a network such as the Internet).

[0053] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. An information processing method applied to microservices, characterized in that: The method comprises: Build tools to manage dependency packages. Use build tools to manage dependencies and distinguish between the jar packages required by both monolithic and microservices and the jar packages required by microservices. Configure the dependencies required by microservices and the engineering code of microservices into separate basic modules; split the business modules according to business needs, and each different business becomes an independent business module. The business module is composed of various application microservices in the microservice deployment architecture; Configure the association relationship between each business module. When there are associated business requirements between the business modules, set the business module's external association relationship abstract interface module, which is implemented in the external API interface of the corresponding business module; configure an internal proxy module for each business module, which is used to proxy the associated business interface required by each business module; Compile the single deployment script and microservice deployment script, and complete the packaging.

2. The method according to claim 1, further characterized in that: The single deployment script includes: each business module, which needs to exclude the basic module of microservices and the proxy module of related businesses.

3. The method according to claim 2, further characterized in that: The microservice deployment script includes: different single business application microservice deployment scripts are constructed according to different business modules.

4. The method according to claim 3, further characterized in that: The business module includes the business proxy modules associated with other business modules and the basic modules of the corresponding microservices, and the business proxy modules associated with other business modules include the association relationship abstract interface modules.

5. The method according to claim 4, further characterized in that: Introduce the proxy module of the business module-associated business in the microservice architecture construction script. There is no need to introduce the proxy module in the monolithic architecture.

6. The method according to claim 5, further characterized in that: Each microservice runs independently as a separate process, and a unified inter-process communication mechanism is configured to enable interaction between microservices.

7. The method according to claim 6, further characterized in that: Set a unique API description identifier for each microservice call and accept access or update requests from the user.

8. The method according to claim 7, further characterized in that: Set up configuration files according to task requirements, set up microservice interruption mechanisms for calls between microservices, and when a microservice call fails within a set periodic event, the service will be interrupted and isolated.

9. A computer storage medium having computer program instructions stored thereon for implementing any of the methods in claims 1-8.

10. An information processing system applied to microservices, the system comprising a memory and a processor, the memory storing a computer program, the computer program being executed by the processor to implement any one of the methods in claims 1-8.

Citation Information

Patent Citations

  • Monomer and micro-service integrated application management system

    CN115858008A

  • Single microservice code architecture method and device and computer readable storage medium

    CN116909583A

Cited By

  • Determination method of detachable and combinable micro-service architecture

    CN119556945A