CN111953735A - System microservice transformation method, device, equipment and storage medium - Google Patents

System microservice transformation method, device, equipment and storage medium Download PDF

Info

Publication number
CN111953735A
CN111953735A CN202010681100.0A CN202010681100A CN111953735A CN 111953735 A CN111953735 A CN 111953735A CN 202010681100 A CN202010681100 A CN 202010681100A CN 111953735 A CN111953735 A CN 111953735A
Authority
CN
China
Prior art keywords
service
micro
preset
microservice
lightweight
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010681100.0A
Other languages
Chinese (zh)
Inventor
贾辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fiberhome Telecommunication Technologies Co Ltd
Original Assignee
Fiberhome Telecommunication Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fiberhome Telecommunication Technologies Co Ltd filed Critical Fiberhome Telecommunication Technologies Co Ltd
Priority to CN202010681100.0A priority Critical patent/CN111953735A/en
Publication of CN111953735A publication Critical patent/CN111953735A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/133Protocols for remote procedure calls [RPC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services

Abstract

The invention discloses a system micro-service transformation method, a device, equipment and a storage medium, wherein the method comprises the steps of acquiring control data of each running micro-service in a system to be transformed developed in a cross-language manner and communication data among the micro-services; acting control data through a preset micro-service acting process; the method is characterized in that a preset lightweight micro-service interface module is additionally arranged in a system to be modified, communication data is called according to the preset lightweight micro-service interface module, the system to be modified does not need to be directly brought into micro-service related components, the original system is not invasive, the system can be conveniently accessed into a micro-service framework of the original system only by adding the preset lightweight micro-service interface module, the micro-service framework does not need to be greatly changed, the difficulty of micro-service modification is effectively reduced, the flexibility of the system is greatly improved, the system is lighter in weight, the implementation cost is lower, the system has better expansibility, and meanwhile, systems developed by different languages can be conveniently integrated.

Description

System microservice transformation method, device, equipment and storage medium
Technical Field
The invention relates to the technical field of computer software micro-service architecture service management, in particular to a system micro-service transformation method, a device, equipment and a storage medium.
Background
A microservice is an architectural model, with a large complex software application consisting of one or more microservices; each micro service in the system can be independently deployed, and the micro services are loosely coupled; each microservice is only concerned with completing one task and well completing the task.
The microservice is the most popular application architecture at present, can solve the product iteration pressure caused by the high-speed development of the business, and enables the system to bear the access of a large number of users; in recent years, micro-service concepts and products are gradually mature, micro-services are simply and conveniently built from beginning to end, but at present, a plurality of old systems bear core services of companies, continuous maintenance and upgrading are needed, all the systems are reversed, reconstruction from beginning to end is not desirable, the investment period is long, and the risk is uncontrollable.
For the reconstruction of old systems, the following problems currently exist: 1. each old system may be developed by adopting different languages, so that the selection of micro-service components is limited, a plurality of micro-service related components need to be introduced, and the system has strong invasiveness; 2. the old system has complicated logic, and the reconstruction difficulty and the reconstruction cost are very large.
Disclosure of Invention
The invention mainly aims to provide a system micro-service transformation method, a system micro-service transformation device and a system micro-service transformation storage medium, and aims to solve the technical problems that in the prior art, a plurality of micro-service related components need to be introduced for micro-service transformation of an old system, and the transformation difficulty and the transformation cost are very high.
In order to achieve the above object, the present invention provides a system microservice modification method, which comprises the following steps:
acquiring control data of each running micro service in a cross-language developed system to be modified and communication data among the micro services;
proxying the control data through a preset micro-service proxy process;
and adding a preset lightweight microservice interface module in the system to be modified, and calling the communication data according to the preset lightweight microservice interface module.
Optionally, the newly adding a preset lightweight microservice interface module to the system to be modified, and calling the communication data according to the preset lightweight microservice interface module includes:
a preset lightweight microservice interface module is newly added in the system to be modified;
responding to a service address to be called, acquiring target control data corresponding to the service address to be called through the preset micro-service agent process, and sending the target control data to the preset lightweight micro-service interface module;
and the preset lightweight micro-service interface module calls target communication data according to the target control data.
Optionally, the responding to the service address to be called, obtaining target control data corresponding to the service address to be called through the preset micro-service agent process, and sending the target control data to the preset lightweight micro-service interface module includes:
responding to a service address to be called, and acquiring service instance information corresponding to the service address to be called from a registration center through the preset micro service agent process;
determining a target service instance from the service instance information according to a preset control strategy, and acquiring a service address and a control command corresponding to the target service instance;
and generating target control data according to the control command and the service address, and sending the target control data to the preset lightweight micro-service interface module.
Optionally, the invoking, by the preset lightweight micro-service interface module, target communication data according to the target control data includes:
the preset lightweight micro-service interface module acquires the service address and the control command from the target control data;
and the preset lightweight service interface integration module determines a target service interface according to the service address and calls target communication data of the target service interface according to the control command.
Optionally, after a preset lightweight microservice interface module is newly added to the system to be modified and the communication data is called according to the preset lightweight microservice interface module, the system microservice modification method further includes:
generating a calling result, and feeding the calling result back to the preset micro-service agent process;
and the preset micro-service agent process carries out micro-service characteristic processing on the target service according to the calling result.
Optionally, the performing, by the preset micro-service agent process, micro-service characteristic processing on the target service according to the call result includes:
the preset micro-service agent process matches the calling result with a preset fusing condition;
fusing the target service when the calling result is matched with the preset fusing condition;
and when the calling result is not matched with the preset fusing condition, the preset micro-service agent process checks the target service through a service health check interface.
Optionally, when the calling result does not match the preset fusing condition, the preset micro-service agent process checks the target service through a service health check interface, including:
when the calling result is not matched with the preset fusing condition, the preset micro-service agent process forwards a checking request to the preset lightweight service interface integration module through a service health checking interface;
the preset lightweight service interface integration module dynamically acquires the configuration information of the micro-service framework according to the service health check interface;
when detecting the change of the configuration information, the preset lightweight service interface integration module acquires configuration change information and service resources corresponding to the configuration change information, and reports the configuration change information and the service resources to the preset micro-service agent process;
and the preset micro-service agent process checks the target service according to the configuration change information and the service resources.
In addition, in order to achieve the above object, the present invention further provides a system microservice transforming apparatus, including:
the data acquisition module is used for acquiring control data of each running micro service in a system to be modified developed in a cross-language mode and communication data among the micro services;
the agent module is used for acting the control data through a preset micro-service agent process;
and the calling module is used for newly adding a preset lightweight microservice interface module in the system to be modified and calling the communication data according to the preset lightweight microservice interface module.
Furthermore, to achieve the above object, the present invention also proposes an apparatus comprising: a memory, a processor, and a system microservice modification program stored on the memory and executable on the processor, the system microservice modification program configured to implement the steps of the system microservice modification method as recited in the preceding claims.
In addition, to achieve the above object, the present invention further provides a storage medium, on which a system microservices transforming program is stored, and the system microservices transforming program, when being executed by a processor, implements the steps of the system microservices transforming method as described above.
The system micro-service transformation method provided by the invention comprises the steps of acquiring control data of each running micro-service in a system to be transformed developed in a cross-language manner and communication data among the micro-services; proxying the control data through a preset micro-service proxy process; the system to be modified is additionally provided with a preset lightweight micro-service interface module, and the communication data is called according to the preset lightweight micro-service interface module, because the system to be modified does not need to be directly brought into micro-service related components, the original system is not invasive, the micro-service related components can be conveniently accessed into a micro-service framework of the original system only by adding the preset lightweight micro-service interface module, the micro-service framework does not need to be greatly changed, the difficulty of micro-service modification is effectively reduced, the related components in the micro-service can be conveniently upgraded, the flexibility of the system is greatly increased, the system is lighter, the implementation cost is lower, the expansibility is better, and meanwhile, systems developed in different languages can be conveniently integrated.
Drawings
FIG. 1 is a schematic diagram of an apparatus architecture of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart illustrating a first embodiment of a system microservice modification method of the present invention;
FIG. 3 is a flowchart illustrating a second embodiment of the system microservice modification method of the present invention;
FIG. 4 is a flowchart illustrating a third embodiment of the system microservice modification method of the present invention;
FIG. 5 is a flowchart illustrating a fourth embodiment of the system microservice modification method of the present invention;
FIG. 6 is a flow chart illustrating a fifth embodiment of the system microservice modification method of the present invention;
FIG. 7 is a flowchart illustrating a sixth embodiment of the system microservice modification method of the present invention;
FIG. 8 is a flow chart illustrating a seventh embodiment of the system microservice modification method of the present invention;
FIG. 9 is a functional block diagram of a first embodiment of the system microservice modification apparatus of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The solution of the embodiment of the invention is mainly as follows: the method comprises the steps of acquiring control data of each running micro service in a system to be modified developed in a cross-language mode and communication data among the micro services; proxying the control data through a preset micro-service proxy process; the system to be modified is additionally provided with a preset lightweight micro-service interface module, the communication data is called according to the preset lightweight micro-service interface module, the system to be modified does not need to directly bring in micro-service related components, the original system is not invasive, the micro-service related components can be conveniently accessed into the micro-service framework of the original system only by adding the preset lightweight micro-service interface module without greatly changing the micro-service framework, the difficulty of micro-service modification is effectively reduced, the related components in micro-service can be conveniently upgraded, the flexibility of the system is greatly increased, the system is lighter, the implementation cost is lower, the system has better expansibility, meanwhile, systems developed in different languages can be conveniently integrated together, and the problem that a plurality of micro-service related components need to be introduced in the micro-service modification of the old system in the prior art is solved, the reconstruction difficulty and the reconstruction cost are very large technical problems.
Referring to fig. 1, fig. 1 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the apparatus may include: a processor 1001, such as a CPU, a communication bus 1002, a user side interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., a Wi-Fi interface). The Memory 1005 may be a high-speed RAM Memory or a Non-Volatile Memory (Non-Volatile Memory), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration of the apparatus shown in fig. 1 is not intended to be limiting of the apparatus and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, the memory 1005 as a storage medium may include an operating device, a network communication module, a user side interface module, and a system microservice modification program.
The apparatus of the present invention calls the system microservice modification program stored in the memory 1005 by the processor 1001, and performs the following operations:
acquiring control data of each running micro service in a cross-language developed system to be modified and communication data among the micro services;
proxying the control data through a preset micro-service proxy process;
and adding a preset lightweight microservice interface module in the system to be modified, and calling the communication data according to the preset lightweight microservice interface module.
Further, the processor 1001 may call the system microservice modification program stored in the memory 1005, and further perform the following operations:
a preset lightweight microservice interface module is newly added in the system to be modified;
responding to a service address to be called, acquiring target control data corresponding to the service address to be called through the preset micro-service agent process, and sending the target control data to the preset lightweight micro-service interface module;
and the preset lightweight micro-service interface module calls target communication data according to the target control data.
Further, the processor 1001 may call the system microservice modification program stored in the memory 1005, and further perform the following operations:
responding to a service address to be called, and acquiring service instance information corresponding to the service address to be called from a registration center through the preset micro service agent process;
determining a target service instance from the service instance information according to a preset control strategy, and acquiring a service address and a control command corresponding to the target service instance;
and generating target control data according to the control command and the service address, and sending the target control data to the preset lightweight micro-service interface module.
Further, the processor 1001 may call the system microservice modification program stored in the memory 1005, and further perform the following operations:
the preset lightweight micro-service interface module acquires the service address and the control command from the target control data;
and the preset lightweight service interface integration module determines a target service interface according to the service address and calls target communication data of the target service interface according to the control command.
Further, the processor 1001 may call the system microservice modification program stored in the memory 1005, and further perform the following operations:
generating a calling result, and feeding the calling result back to the preset micro-service agent process;
and the preset micro-service agent process carries out micro-service characteristic processing on the target service according to the calling result.
Further, the processor 1001 may call the system microservice modification program stored in the memory 1005, and further perform the following operations:
the preset micro-service agent process matches the calling result with a preset fusing condition;
fusing the target service when the calling result is matched with the preset fusing condition;
and when the calling result is not matched with the preset fusing condition, the preset micro-service agent process checks the target service through a service health check interface.
Further, the processor 1001 may call the system microservice modification program stored in the memory 1005, and further perform the following operations:
when the calling result is not matched with the preset fusing condition, the preset micro-service agent process forwards a checking request to the preset lightweight service interface integration module through a service health checking interface;
the preset lightweight service interface integration module dynamically acquires the configuration information of the micro-service framework according to the service health check interface;
when detecting the change of the configuration information, the preset lightweight service interface integration module acquires configuration change information and service resources corresponding to the configuration change information, and reports the configuration change information and the service resources to the preset micro-service agent process;
and the preset micro-service agent process checks the target service according to the configuration change information and the service resources.
According to the scheme, the control data of each running micro service in the system to be modified developed in a cross-language mode and the communication data among the micro services are obtained; proxying the control data through a preset micro-service proxy process; the system to be modified is additionally provided with a preset lightweight micro-service interface module, and the communication data is called according to the preset lightweight micro-service interface module, because the system to be modified does not need to be directly brought into micro-service related components, the original system is not invasive, the micro-service related components can be conveniently accessed into a micro-service framework of the original system only by adding the preset lightweight micro-service interface module, the micro-service framework does not need to be greatly changed, the difficulty of micro-service modification is effectively reduced, the related components in the micro-service can be conveniently upgraded, the flexibility of the system is greatly increased, the system is lighter, the implementation cost is lower, the expansibility is better, and meanwhile, systems developed in different languages can be conveniently integrated.
Based on the hardware structure, the embodiment of the system microservice transformation method is provided.
Referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of the system microservice modification method of the present invention.
In a first embodiment, the system microservice modification method includes the steps of:
and step S10, acquiring control data of each running micro service in the system to be modified developed in a cross-language mode and communication data among the micro services.
It should be noted that the system to be modified is a system to be prepared for micro service modification, and the control data of each micro service running in the system to be modified is data related to micro service characteristics, such as load balancing, fusing fault tolerance, configuration acquisition, service management and the like of the micro service, and the control data can be acquired and set through a single agent process; the communication data between the micro services refers to communication data invoked between the micro services, and these invocations are still processed in the system to be modified, and of course, the control data of each running micro service in the system to be modified and the communication data between the micro services may also be obtained in other manners, for example, the control data and the communication data are obtained in real time or periodically through a data obtaining process, which is not limited in this embodiment.
And step S20, the control data is proxied through the preset micro service proxy process.
It should be understood that the preset micro service agent process is a micro service agent process pre-deployed in the system to be modified, and generally one agent process may be deployed on each node in the system to be modified, and of course, other deployment manners may also be adopted, which is not limited in this embodiment; the preset micro-service agent process is used for handling the relevant characteristics of the micro-service in the system to be modified, that is, handling the relevant characteristic data of the micro-service, such as load balancing, fusing fault tolerance, configuration acquisition, service management and the like, and certainly, handling the relevant characteristic data of other micro-services, which is not limited in this embodiment; the preset micro-service agent process can be developed by using any language and any micro-service component, and is communicated with the system to be modified by adopting a Remote Procedure Call (RPC) interface or a Representational State Transfer (REST) interface.
In specific implementation, the preset micro-service agent process can be deployed independently, so that related components of the micro-service can be replaced conveniently, good micro-service characteristic support can be provided for an old system, better expansibility is achieved, and meanwhile, systems developed by different languages can be integrated together conveniently; the preset micro-service agent process provides a plurality of interfaces for the preset lightweight micro-service interface module to obtain micro-service characteristics, the provided interface can be a BeforeInvoke interface, the interface can provide a service instance for the service which the preset lightweight micro-service interface module wants to call, and the positioning information such as an IP port of the service instance is returned to the preset lightweight micro-service interface module; the provided interface can also be an AfterInvoke interface, and the interface has the function that after the preset lightweight micro-service interface module is called, whether the calling is successful or not is fed back to the proxy process, so that the proxy process carries out service statistics, and carries out processing such as service fusing, fault tolerance, degradation and the like; the improved interface can also be a GetConfig interface; the interface is used for providing a function of acquiring micro-service configuration for the preset lightweight micro-service interface module; of course, the interface provided may also be other types of interfaces, and the embodiment is not limited thereto.
Step S30, adding a preset lightweight microservice interface module in the system to be modified, and calling the communication data according to the preset lightweight microservice interface module.
It can be understood that the preset lightweight microservice Interface module is a lightweight microservice Interface module preset for different system design languages, that is, an integrated module encapsulating multiple Application Programming Interfaces (APIs), and the preset lightweight microservice Interface module mainly includes two parts, namely, a service object acquisition part and a calling result feedback part; for example, the existing three microservices a, B1, and B2, where B1 and B2 are 2 service instances of the same service, the existing service a has a FuncB method whose function needs to call the B service, and the existing processing method is: a. a selects an instance from the two instances B1 and B2 through a load balancing component (assuming that the call selects the B1 instance); b. a calls the FuncB method of the B1 instance; c. a feeds back the calling result to the fusing fault-tolerant component to control the relevant state of the B1 instance; in the three steps of abc, a and c are control flows and are related functions for controlling and calling service instances and related micro-service states, and b is a data flow and is calling of data between services; the load balancing module in the step a and the fusing fault-tolerant module in the step c are modules involved in the micro-service, and the reconstruction difficulty and the reconstruction cost are very high if an old system is accessed into the micro-service modules; for such calling, the present embodiment adopts a manner that a lightweight microservice interface module is added to the service a, and a service of the agent C is added at the same time; a. a, inquiring instance information of a calling service B from a proxy C through a lightweight microservice interface module; b. the agent C selects an instance from the two instances B1 and B2 through the load balancing component (assuming that the call selects the B1 instance), and returns the instance information to A; c. a calls the FuncB method of the B1 instance; d. a, feeding back a calling result to an agent C through a lightweight microservice interface module; e. the agent C recalls the result and feeds back the result to the fusing fault-tolerant component to control the related state of the B1 instance; it can be known that, by the method for improving micro-services of this embodiment, it is not necessary to introduce any component related to micro-services in the service a, but only a lightweight micro-service interface module needs to be added to implement the related characteristics of micro-services, and meanwhile, the agent c can use any component of micro-services, so that the flexibility is very strong; and the communication data can be called through the preset lightweight micro-service interface module.
In a specific implementation, the preset lightweight micro-service interface module is attached to the system to be modified, and a health check interface is generally encapsulated, wherein the interface is used for acquiring relevant data of a service state for a preset micro-service agent process, and the preset micro-service agent process can perform processing such as load balancing, fusing, fault tolerance, degradation and the like of services according to the interface; the preset lightweight micro-service interface module can also encapsulate an Invoke interface, and the interface is a calling interface for data interaction among micro-services; of course, the packaged interface may also be other types of interfaces, and the embodiment is not limited thereto.
According to the scheme, the control data of each running micro service in the system to be modified developed in a cross-language mode and the communication data among the micro services are obtained; proxying the control data through a preset micro-service proxy process; the system to be modified is additionally provided with a preset lightweight micro-service interface module, and the communication data is called according to the preset lightweight micro-service interface module, because the system to be modified does not need to be directly brought into micro-service related components, the original system is not invasive, the micro-service related components can be conveniently accessed into a micro-service framework of the original system only by adding the preset lightweight micro-service interface module, the micro-service framework does not need to be greatly changed, the difficulty of micro-service modification is effectively reduced, the related components in the micro-service can be conveniently upgraded, the flexibility of the system is greatly increased, the system is lighter, the implementation cost is lower, the expansibility is better, and meanwhile, systems developed in different languages can be conveniently integrated.
Further, fig. 3 is a schematic flow chart of a second embodiment of the system microservice modification method of the present invention, and as shown in fig. 3, the second embodiment of the system microservice modification method of the present invention is proposed based on the first embodiment, and in this embodiment, the step S30 specifically includes the following steps:
and step S31, adding a preset lightweight micro-service interface module in the system to be modified.
It should be noted that, by newly adding the preset lightweight microservice interface module in the system to be modified, the intrusiveness of microservice related components to the system to be modified can be avoided, the original microservice framework does not need to be greatly modified, the model selection of the microservice framework is not affected, and the difficulty of microservice modification of the system to be modified is effectively reduced.
Step S32, responding to the service address to be called, acquiring target control data corresponding to the service address to be called through the preset micro-service agent process, and sending the target control data to the preset lightweight micro-service interface module.
It can be understood that, the service interface integration module to be called requests an address of a service to be called from the preset micro-service agent process through the preset lightweight micro-service interface module for the system to be modified, and target control data corresponding to the service address to be called can be acquired through the preset micro-service agent process, so that the target control data can be sent to the preset lightweight micro-service interface module.
And step S33, the preset lightweight micro-service interface module calls target communication data according to the target control data.
It should be understood that the preset lightweight microservice interface module can call corresponding communication data through the target control data, and target communication data; the difficulty of micro-service reconstruction of the system to be reconstructed can be effectively reduced through the preset lightweight micro-service interface module; thereby introducing the relevant characteristics of the microservice into the system to be retrofitted with less cost; of course, before the micro-service is introduced, the system to be modified also has data call, but the call has no micro-service characteristic, taking load balancing as an example, the previous calls can not be selected according to the load condition of the server, all call a certain fixed service instance, but after a lightweight microservice interface module is newly added in the system to be modified, a service instance can be obtained from a preset micro-service agent process through a service name, an instance is selected through a load balancing component in the preset micro-service agent process, information such as an IP address and a port is returned to a preset lightweight micro-service interface module of the system to be modified, the preset lightweight micro-service interface module calls a designated IP and the port, thus, the calling of the system to be modified realizes the load balancing characteristic without introducing a load balancing component.
According to the scheme, the lightweight microservice interface module is additionally arranged in the system to be modified; responding to a service address to be called, acquiring target control data corresponding to the service address to be called through the preset micro-service agent process, and sending the target control data to the preset lightweight micro-service interface module; the preset lightweight micro-service interface module calls target communication data according to the target control data, so that the invasion of micro-service related components to the system to be modified is avoided, the original micro-service frame does not need to be greatly changed, the model selection of the micro-service frame is not influenced, and the difficulty of micro-service modification of the system to be modified is effectively reduced.
Further, fig. 4 is a schematic flow chart of a third embodiment of the system microservice modification method of the present invention, and as shown in fig. 4, the third embodiment of the system microservice modification method of the present invention is proposed based on the second embodiment, in this embodiment, the step S32 specifically includes the following steps:
step S321, in response to the service address to be called, obtaining service instance information corresponding to the service address to be called from a registry through the preset micro service agent process.
It should be noted that the registry is a center for storing service registration information in the system to be modified, and the preset micro service agent process may obtain corresponding range registration information and service instance information from the registry.
Step S322, determining a target service instance from the service instance information according to a preset control strategy, and acquiring a service address and a control command corresponding to the target service instance.
It can be understood that the preset control policy is a preset policy for the preset micro service agent process to perform relevant control on micro service related characteristic data, and the preset control policy may be a load balancing policy, a fusing control policy, or other control policies, such as configuration acquisition and service management policies, which are not limited in this embodiment; and determining a corresponding service instance, namely a target service instance, from the service instance information according to the preset control strategy, and acquiring a service address and a control command corresponding to the target service instance.
And step S323, generating target control data according to the control command and the service address, and sending the target control data to the preset lightweight micro-service interface module.
It should be understood that the control command and the service address may generate corresponding target control data, and the target control data may be sent to the preset lightweight micro-service interface module after being generated, and then returned to the system to be modified.
According to the scheme, the service instance information corresponding to the service address to be called is acquired from the registration center through the preset micro-service agent process by responding to the service address to be called; determining a target service instance from the service instance information according to a preset control strategy, and acquiring a service address and a control command corresponding to the target service instance; target control data are generated according to the control command and the service address, and the target control data are sent to the preset lightweight micro-service interface module, so that the speed and the efficiency of system micro-service transformation can be improved, the original micro-service framework does not need to be greatly changed, the model selection of the micro-service framework is not influenced, and the difficulty of the micro-service transformation of the system to be transformed is effectively reduced.
Further, fig. 5 is a schematic flow chart of a fourth embodiment of the system microservice modification method of the present invention, and as shown in fig. 5, the fourth embodiment of the system microservice modification method of the present invention is proposed based on the second embodiment, in this embodiment, the step S33 specifically includes the following steps:
step S331, the preset lightweight microservice interface module obtains the service address and the control command from the target control data.
It should be noted that the target control data is control data generated according to interface integration modules corresponding to different services and control commands, and relevant service addresses and control commands can be extracted from the control data.
Step S332, the preset lightweight service interface integration module determines a target service interface according to the service address, and calls target communication data of the target service interface according to the control command.
It should be noted that, a corresponding service interface, that is, the target service interface, can be determined by the service address, and then related communication data of the target service interface, that is, target communication data, can be called according to the control command, and the related characteristics of the micro service can be enabled to work by calling the target communication data without additionally introducing micro service related components, so that the micro service characteristics are realized more in a light weight manner, the realization cost is lower, the difficulty of micro service modification is reduced, and a good micro service characteristic support can be provided for a system to be modified.
According to the scheme, the service address and the control command are acquired from the target control data through the preset lightweight micro-service interface module; the preset lightweight service interface integration module determines a target service interface according to the service address, calls target communication data of the target service interface according to the control command, enables the relevant micro-service characteristics to work by calling the target communication data without additionally introducing micro-service related components, realizes the micro-service characteristics more in a lightweight mode, is lower in realization cost, reduces the difficulty of micro-service transformation, and can provide good micro-service characteristic support for a system to be transformed.
Further, fig. 6 is a schematic flow chart of a fifth embodiment of the system microservice modification method of the present invention, and as shown in fig. 6, the fifth embodiment of the system microservice modification method of the present invention is proposed based on the first embodiment, and in this embodiment, after the step S30, the microservice modification method further includes the following steps:
and step S40, generating a calling result, and feeding the calling result back to the preset micro-service agent process.
It should be noted that after the communication data is called according to the preset lightweight microservice interface module, a corresponding calling result is generated, at this time, the calling result needs to be fed back to the preset microservice proxy process, the preset microservice proxy process needs to support the relevant characteristics of microservice by means of the called data, load balancing data is fed back to the preset microservice proxy process for calling, and a result of successful or failed calling is also fed back to the preset microservice proxy process.
And step S50, the preset micro-service agent process carries out micro-service characteristic processing on the target service according to the calling result.
It can be understood that the preset micro service agent process determines which micro service characteristic processing is adopted according to the call success and the call failure of the call result, generally, the preset micro service agent process performs processing on characteristics such as fusing and fault tolerance of the service according to the call result, and may also perform other micro service characteristic processing, for example, statistical processing related to service administration, and the like, which is not limited in this embodiment.
According to the scheme, the calling result is generated and fed back to the preset micro-service agent process; the preset micro-service agent process carries out micro-service characteristic processing on the target service according to the calling result, does not need to greatly change the original micro-service framework of the system to be modified, does not influence the type selection of the micro-service framework, realizes the micro-service characteristic under the condition that micro-service related components are not required to be brought, is lighter, has lower realization cost and better expansibility, and simultaneously can conveniently integrate systems developed by different languages.
Further, fig. 7 is a schematic flow chart of a sixth embodiment of the system microservice modification method of the present invention, and as shown in fig. 7, the sixth embodiment of the system microservice modification method of the present invention is proposed based on the fifth embodiment, in this embodiment, the step S50 specifically includes the following steps:
and step S51, the preset micro service agent process matches the calling result with a preset fusing condition.
It should be noted that the preset fusing condition is a preset condition that the service fusing needs to be met, and whether fusing processing is performed on the check ring service can be determined by matching the calling result with the preset fusing condition through the preset micro-service agent process.
And step S52, fusing the target service when the calling result is matched with the preset fusing condition.
It can be understood that when it is determined that the calling result matches the preset fusing condition, the target service may be directly fused; generally, if a certain service instance is unsuccessfully called all the time, the preset micro-service agent process fuses the service instance when a certain threshold is reached according to the feedback of the calling result of the preset lightweight service interface integration module, so that the fused service instance is not sent to the preset lightweight service interface integration module when the preset lightweight service interface integration module requests the service address again.
And step S53, when the calling result is not matched with the preset fusing condition, the preset micro-service agent process checks the target service through a service health check interface.
It should be understood that, when the calling result does not match the preset fusing condition, the preset micro-service agent process may provide service health check, that is, forward the request for calling the service to the preset lightweight service interface integration module, so as to perform service health check, thereby providing high-quality micro-service feature support for the system to be modified.
According to the scheme, the calling result is matched with the preset fusing condition through the preset micro-service agent process; fusing the target service when the calling result is matched with the preset fusing condition; when the calling result is not matched with the preset fusing condition, the preset micro-service agent process checks the target service through a service health check interface, effectively reduces the difficulty of micro-service reconstruction of the old system, and provides high-quality micro-service characteristic support for the system to be reconstructed.
Further, fig. 8 is a schematic flow chart of a seventh embodiment of the system microservice modification method of the present invention, and as shown in fig. 8, the seventh embodiment of the system microservice modification method of the present invention is proposed based on the sixth embodiment, in this embodiment, the step S53 specifically includes the following steps:
step S531, when the calling result is not matched with the preset fusing condition, the preset micro-service agent process forwards the check request to the preset lightweight service interface integration module through the service health check interface.
It should be noted that the check request is a request for performing health check on a service, the preset lightweight service interface integration module is provided with a service health check interface, and the preset lightweight service interface integration module is responsible for calling between micro services and encapsulates details of the calling between the micro services, and the health check can be performed on the relevant service interfaces through the service health check interface.
And step S532, the preset lightweight service interface integration module dynamically acquires the configuration information of the micro-service framework according to the service health check interface.
It can be understood that a service health check interface is arranged in the preset lightweight service interface integration module, so that the micro-service framework can acquire a service state, and related information of micro-service administration and dynamic configuration can be acquired through the service health check interface, that is, configuration information of the micro-service framework is dynamically acquired through the service health check interface.
Step S533, when detecting the configuration information change, the preset lightweight service interface integration module obtains configuration change information and a service resource corresponding to the configuration change information, and reports the configuration change information and the service resource to the preset micro service agent process.
It should be understood that, the preset micro service agent process is responsible for configuration dynamic acquisition and monitoring of service resources, the preset lightweight service interface integration module acquires configuration information in a micro service framework through the service health check interface, when the configuration information changes, the configuration change callback can be returned to the preset lightweight service interface integration module, and meanwhile, the preset lightweight service interface integration module reports service resources corresponding to the configuration change information, and the preset micro service agent process performs subsequent processing.
And step S534, the preset micro-service agent process checks the target service according to the configuration change information and the service resource.
It can be understood that, after receiving the reported configuration change information and service resources, the preset micro-service agent process may feed back the configuration change information and the service resources to the micro-service framework of the system to be modified, so as to check the corresponding target service, perform statistics, load balancing, fusing fault tolerance and other processing operations related to service management on the target service according to the detection result, and certainly, other processing operations may also be performed, which is not limited in this embodiment.
According to the scheme, when the calling result is not matched with the preset fusing condition, the preset micro-service agent process forwards the check request to the preset lightweight service interface integration module through the service health check interface; the preset lightweight service interface integration module dynamically acquires the configuration information of the micro-service framework according to the service health check interface; when detecting the change of the configuration information, the preset lightweight service interface integration module acquires configuration change information and service resources corresponding to the configuration change information, and reports the configuration change information and the service resources to the preset micro-service agent process; the preset micro-service agent process checks the target service according to the configuration change information and the service resources, so that the safety and the accuracy of the operation of the micro-service can be ensured, the micro-service characteristics are realized more in a light weight manner, the realization cost is lower, the difficulty of micro-service transformation is reduced, and good micro-service characteristic support can be provided for a system to be transformed.
Correspondingly, the invention further provides a system microservices transformation device.
Referring to fig. 9, fig. 9 is a functional block diagram of a first embodiment of the system microservice modification apparatus of the present invention.
In a first embodiment of the system microservice modification apparatus of the present invention, the system microservice modification apparatus comprises:
the data acquisition module 10 is configured to acquire control data of each running microservice in the cross-language developed system to be modified and communication data between each microservice.
And the agent module 20 is used for acting the control data through a preset micro-service agent process.
And the calling module 30 is configured to add a preset lightweight microservice interface module in the system to be modified, and call the communication data according to the preset lightweight microservice interface module.
The steps implemented by each functional module of the system microservice modification apparatus may refer to each embodiment of the system microservice modification method of the present invention, and are not described herein again.
In addition, an embodiment of the present invention further provides a storage medium, where the storage medium may be a computer-readable non-volatile storage medium, and certainly may also be other types of storage media, which is not limited in this embodiment; the storage medium stores a system microservices transformation program, and the system microservices transformation program realizes the following operations when being executed by a processor:
acquiring control data of each running micro service in a cross-language developed system to be modified and communication data among the micro services;
proxying the control data through a preset micro-service proxy process;
and adding a preset lightweight microservice interface module in the system to be modified, and calling the communication data according to the preset lightweight microservice interface module.
Further, the system microservices transformation program when executed by the processor further implements the following operations:
a preset lightweight microservice interface module is newly added in the system to be modified;
responding to a service address to be called, acquiring target control data corresponding to the service address to be called through the preset micro-service agent process, and sending the target control data to the preset lightweight micro-service interface module;
and the preset lightweight micro-service interface module calls target communication data according to the target control data.
Further, the system microservices transformation program when executed by the processor further implements the following operations:
responding to a service address to be called, and acquiring service instance information corresponding to the service address to be called from a registration center through the preset micro service agent process;
determining a target service instance from the service instance information according to a preset control strategy, and acquiring a service address and a control command corresponding to the target service instance;
and generating target control data according to the control command and the service address, and sending the target control data to the preset lightweight micro-service interface module.
Further, the system microservices transformation program when executed by the processor further implements the following operations:
the preset lightweight micro-service interface module acquires the service address and the control command from the target control data;
and the preset lightweight service interface integration module determines a target service interface according to the service address and calls target communication data of the target service interface according to the control command.
Further, the system microservices transformation program when executed by the processor further implements the following operations:
generating a calling result, and feeding the calling result back to the preset micro-service agent process;
and the preset micro-service agent process carries out micro-service characteristic processing on the target service according to the calling result.
Further, the system microservices transformation program when executed by the processor further implements the following operations:
the preset micro-service agent process matches the calling result with a preset fusing condition;
fusing the target service when the calling result is matched with the preset fusing condition;
and when the calling result is not matched with the preset fusing condition, the preset micro-service agent process checks the target service through a service health check interface.
Further, the system microservices transformation program when executed by the processor further implements the following operations:
when the calling result is not matched with the preset fusing condition, the preset micro-service agent process forwards a checking request to the preset lightweight service interface integration module through a service health checking interface;
the preset lightweight service interface integration module dynamically acquires the configuration information of the micro-service framework according to the service health check interface;
when detecting the change of the configuration information, the preset lightweight service interface integration module acquires configuration change information and service resources corresponding to the configuration change information, and reports the configuration change information and the service resources to the preset micro-service agent process;
and the preset micro-service agent process checks the target service according to the configuration change information and the service resources.
According to the scheme, the control data of each running micro service in the system to be modified developed in a cross-language mode and the communication data among the micro services are obtained; proxying the control data through a preset micro-service proxy process; the system to be modified is additionally provided with a preset lightweight micro-service interface module, and the communication data is called according to the preset lightweight micro-service interface module, because the system to be modified does not need to be directly brought into micro-service related components, the original system is not invasive, the micro-service related components can be conveniently accessed into a micro-service framework of the original system only by adding the preset lightweight micro-service interface module, the micro-service framework does not need to be greatly changed, the difficulty of micro-service modification is effectively reduced, the related components in the micro-service can be conveniently upgraded, the flexibility of the system is greatly increased, the system is lighter, the implementation cost is lower, the expansibility is better, and meanwhile, systems developed in different languages can be conveniently integrated.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A system microservice modification method, comprising:
acquiring control data of each running micro service in a cross-language developed system to be modified and communication data among the micro services;
proxying the control data through a preset micro-service proxy process;
and adding a preset lightweight microservice interface module in the system to be modified, and calling the communication data according to the preset lightweight microservice interface module.
2. The system microservice modification method of claim 1, wherein the adding a preset lightweight microservice interface module to the system to be modified, and calling the communication data according to the preset lightweight microservice interface module comprises:
a preset lightweight microservice interface module is newly added in the system to be modified;
responding to a service address to be called, acquiring target control data corresponding to the service address to be called through the preset micro-service agent process, and sending the target control data to the preset lightweight micro-service interface module;
and the preset lightweight micro-service interface module calls target communication data according to the target control data.
3. The system microservice modification method of claim 2, wherein the step of obtaining target control data corresponding to the service address to be called through the preset microservice proxy process in response to the service address to be called, and sending the target control data to the preset lightweight microservice interface module comprises the steps of:
responding to a service address to be called, and acquiring service instance information corresponding to the service address to be called from a registration center through the preset micro service agent process;
determining a target service instance from the service instance information according to a preset control strategy, and acquiring a service address and a control command corresponding to the target service instance;
and generating target control data according to the control command and the service address, and sending the target control data to the preset lightweight micro-service interface module.
4. The system microservice transformation method of claim 3, wherein the invoking of the target communication data by the predetermined lightweight microservice interface module according to the target control data comprises:
the preset lightweight micro-service interface module acquires the service address and the control command from the target control data;
and the preset lightweight service interface integration module determines a target service interface according to the service address and calls target communication data of the target service interface according to the control command.
5. The system microservice modification method of any one of claims 1 to 4, wherein a preset lightweight microservice interface module is newly added to the system to be modified, and after the communication data is called by the preset lightweight microservice interface module, the system microservice modification method further comprises:
generating a calling result, and feeding the calling result back to the preset micro-service agent process;
and the preset micro-service agent process carries out micro-service characteristic processing on the target service according to the calling result.
6. The system microservice modification method of claim 5, wherein the pre-set microservice proxy process performs microservice feature processing on the target service according to the calling result, comprising:
the preset micro-service agent process matches the calling result with a preset fusing condition;
fusing the target service when the calling result is matched with the preset fusing condition;
and when the calling result is not matched with the preset fusing condition, the preset micro-service agent process checks the target service through a service health check interface.
7. The system microservice transformation method of claim 6, wherein the step of checking the target service through the service health check interface by the pre-set microservice agent process when the calling result does not match the pre-set fusing condition comprises:
when the calling result is not matched with the preset fusing condition, the preset micro-service agent process forwards a checking request to the preset lightweight service interface integration module through a service health checking interface;
the preset lightweight service interface integration module dynamically acquires the configuration information of the micro-service framework according to the service health check interface;
when detecting the change of the configuration information, the preset lightweight service interface integration module acquires configuration change information and service resources corresponding to the configuration change information, and reports the configuration change information and the service resources to the preset micro-service agent process;
and the preset micro-service agent process checks the target service according to the configuration change information and the service resources.
8. A system microservice modification apparatus, the system microservice modification apparatus comprising:
the data acquisition module is used for acquiring control data of each running micro service in a system to be modified developed in a cross-language mode and communication data among the micro services;
the agent module is used for acting the control data through a preset micro-service agent process;
and the calling module is used for newly adding a preset lightweight microservice interface module in the system to be modified and calling the communication data according to the preset lightweight microservice interface module.
9. A system microservice retrofit kit, the system microservice retrofit kit comprising: a memory, a processor, and a system microservice modification program stored on the memory and executable on the processor, the system microservice modification program configured to implement the steps of the system microservice modification method of any of claims 1-7.
10. A storage medium having stored thereon a system microservice modification program that, when executed by a processor, performs the steps of the system microservice modification method of any of claims 1-7.
CN202010681100.0A 2020-07-15 2020-07-15 System microservice transformation method, device, equipment and storage medium Pending CN111953735A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010681100.0A CN111953735A (en) 2020-07-15 2020-07-15 System microservice transformation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010681100.0A CN111953735A (en) 2020-07-15 2020-07-15 System microservice transformation method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111953735A true CN111953735A (en) 2020-11-17

Family

ID=73341090

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010681100.0A Pending CN111953735A (en) 2020-07-15 2020-07-15 System microservice transformation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111953735A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113067725A (en) * 2021-03-12 2021-07-02 恩亿科(北京)数据科技有限公司 Service configuration dynamic updating method, system, electronic equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106612188A (en) * 2015-10-21 2017-05-03 中兴通讯股份有限公司 Method and device for extending software function based on micro service architecture
CN110032392A (en) * 2019-04-15 2019-07-19 杭州朗和科技有限公司 Service administering method and device, storage medium and electronic equipment
CN110851278A (en) * 2019-11-08 2020-02-28 南京国电南自电网自动化有限公司 Distribution network automation master station mobile application service management method and system based on micro-service architecture
CN111221570A (en) * 2019-12-30 2020-06-02 中国平安财产保险股份有限公司 Migration method, device, equipment and storage medium of microservice framework
CN111245925A (en) * 2020-01-09 2020-06-05 北京理工大学 Communication method and system for modern distributed micro-service architecture

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106612188A (en) * 2015-10-21 2017-05-03 中兴通讯股份有限公司 Method and device for extending software function based on micro service architecture
CN110032392A (en) * 2019-04-15 2019-07-19 杭州朗和科技有限公司 Service administering method and device, storage medium and electronic equipment
CN110851278A (en) * 2019-11-08 2020-02-28 南京国电南自电网自动化有限公司 Distribution network automation master station mobile application service management method and system based on micro-service architecture
CN111221570A (en) * 2019-12-30 2020-06-02 中国平安财产保险股份有限公司 Migration method, device, equipment and storage medium of microservice framework
CN111245925A (en) * 2020-01-09 2020-06-05 北京理工大学 Communication method and system for modern distributed micro-service architecture

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113067725A (en) * 2021-03-12 2021-07-02 恩亿科(北京)数据科技有限公司 Service configuration dynamic updating method, system, electronic equipment and readable storage medium
CN113067725B (en) * 2021-03-12 2023-02-17 恩亿科(北京)数据科技有限公司 Service configuration dynamic updating method, system, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
EP3389219B1 (en) Access request conversion method and device
EP3748908A1 (en) Method, system, network device, storage medium for creating a network slice
CN109683988B (en) Micro services start method, apparatus, computer equipment and storage medium
EP2293516B1 (en) Method, apparatus and system for processing composite service and replacing service and invoking service
US6339705B1 (en) Management of multiple types of radio base stations in a telecommunication system
US7940911B2 (en) Method and apparatus for providing a specialized resource function in a telephone network
CN106453288A (en) Asynchronous mode supporting distributed micro service framework system and implementation method thereof
US7536688B2 (en) Segmented virtual machine
EP0861471A1 (en) Registry communications middleware
CN111831191A (en) Workflow configuration method and device, computer equipment and storage medium
US20220217036A1 (en) Device Management Method, Apparatus, and System, Device, and Storage Medium
US20230046979A1 (en) Microservice call method and apparatus, device, and medium
CN111552568A (en) Cloud service calling method and device
CN111953735A (en) System microservice transformation method, device, equipment and storage medium
US20090319985A1 (en) Method, system and apparatus for acquiring interface
CN101174994A (en) Network card test system and method thereof
CN114237628A (en) Microservice arranging and calling method and device, computer equipment and storage medium
US8893161B2 (en) Information processing system, information processing method and computer-readable storage medium
CN113806104A (en) Interface access request processing method, API gateway, server and system
WO2021093671A1 (en) Task processing method, system, apparatus and device, and computer readable storage medium
CN117194064A (en) Remote calling method and device
CN114615321A (en) Traffic processing method and device
CN108052380B (en) Business function docking method and device, computer equipment and storage medium
CN109922482B (en) OMC system deployment method, OMC system, electronic device and storage medium
CN112988126A (en) CDN service customization method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20201117