CN111984484A - Non-invasive micro-service access method and system - Google Patents

Non-invasive micro-service access method and system Download PDF

Info

Publication number
CN111984484A
CN111984484A CN202010910686.3A CN202010910686A CN111984484A CN 111984484 A CN111984484 A CN 111984484A CN 202010910686 A CN202010910686 A CN 202010910686A CN 111984484 A CN111984484 A CN 111984484A
Authority
CN
China
Prior art keywords
service interface
interface
service
data
state
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
CN202010910686.3A
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.)
OneConnect Smart Technology Co Ltd
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
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 OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN202010910686.3A priority Critical patent/CN111984484A/en
Publication of CN111984484A publication Critical patent/CN111984484A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/2221Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test input/output devices or peripheral units
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles

Abstract

The embodiment of the invention provides a non-invasive micro-service access method, which comprises the following steps: acquiring service interface data corresponding to the microservice, wherein the service interface data is request data of a service interface or log data of the interface or request chain data of the interface; judging the state of a service interface according to service interface data, wherein the state of the service interface comprises normal service interface and abnormal service interface; when the service interface state is that the service interface is normal, identifying the registration state of the service interface, wherein the registration state of the service interface comprises that the service interface is registered and the service interface is not registered; when the registration state of the service interface is that the service interface is not registered, the interface is registered according to the registration information of the service interface so as to complete the access of the micro-service corresponding to the service interface, thereby reducing the risks of micro-service modification and access.

Description

Non-invasive micro-service access method and system
Technical Field
The embodiment of the invention relates to the field of micro-service architecture, in particular to a non-invasive micro-service access method and a system.
Background
With the rapid development of the internet, more and more systems are provided in the enterprise group, and the business becomes more and more complex. A single system cannot fulfill the business needs of a company. And mutual calling among systems is required to complete the realization of the service. Currently, newly developed systems in the industry gradually adopt the architecture and concept of microservices, which may be, for example, a Spring Cloud framework. In the spring cloud framework, different business departments in an enterprise group are respectively used as micro service units to be managed in a unified way, and information between different micro service units is transmitted through a business interface. In particular, in the financial industry, once a problem occurs due to the modification of a business system, extremely serious consequences can be caused, and the modification risk is high.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, a system, a computer device, and a computer-readable storage medium for accessing a non-intrusive microservice, which are used to solve the problem of high risk when an existing business system performs microservice transformation.
The embodiment of the invention solves the technical problems through the following technical scheme:
a non-intrusive microservice access method, comprising:
acquiring service interface data corresponding to the microservice, wherein the service interface data is request data of a service interface or log data of the interface or request chain data of the interface;
judging the state of a service interface according to service interface data, wherein the state of the service interface comprises normal service interface and abnormal service interface;
when the service interface state is that the service interface is normal, identifying the registration state of the service interface, wherein the registration state of the service interface comprises that the service interface is registered and the service interface is not registered;
and when the registration state of the service interface is that the service interface is not registered, registering the interface according to the registration information of the service interface so as to complete the micro-service access corresponding to the service interface.
Further, the determining a service interface state according to the service interface data, where the service interface state includes a normal service interface and an abnormal service interface includes:
acquiring a service interface configuration file, wherein the service interface configuration file is preset according to service interface data, when the service interface data is request data of a service interface, the configuration file comprises a response keyword, when the service interface data is log data of the service interface, the configuration file comprises a log sensitive word rule, and when the service interface data is request chain data of the service interface, the configuration file comprises an error code;
and detecting the service interface data according to the service interface configuration file to acquire a service interface state.
Further, pre-configuring a response keyword, when the service interface data is request data of a service interface, the detecting the service interface data according to the service interface configuration file, and acquiring a service interface state includes:
and calling the service interface through the service calling request, confirming that the service interface is in a normal state when receiving a response keyword fed back by the service interface, and confirming that the service interface is in an abnormal state when the keyword fed back by the service interface is not received or the keyword fed back by the service interface is different from a preset response keyword.
Further, pre-configuring a log sensitive word rule, and when the service interface data is log data of a service interface, detecting the service interface data according to the service interface configuration file to obtain a service interface state includes:
and when the log data hit the log sensitive word rule, confirming that the service interface is in an abnormal state, otherwise, confirming that the service interface is in a normal state.
Further, pre-configuring a request chain data error code, and when the service interface data is request chain data of a service interface, detecting the service interface data according to the service interface configuration file to obtain a service interface state includes:
and when the request chain data contains an error code, confirming that the micro service is in an abnormal state, otherwise, confirming that the service interface is in a normal state.
Further, the method further comprises:
when the service interface state is that the service interface is abnormal, identifying the service interface as an abnormal service interface;
and acquiring interface service data of the abnormal service interface in a preset period to determine the service interface state of the abnormal service interface again.
Further, registering an interface according to the registration information of the service interface when the registration state of the service interface is that the service interface is unregistered, so as to complete the micro-service access corresponding to the service interface, includes:
when the service interface registration state is that the service interface is not registered, sending a registration invitation to the service interface;
receiving service interface registration information returned by the service interface based on the registration invitation;
and registering the service interface according to the service interface registration information so as to complete the micro-service access corresponding to the service interface.
In order to achieve the above object, an embodiment of the present invention further provides a non-intrusive microservice access system, including:
the system comprises a service interface data acquisition module, a service interface data acquisition module and a service interface data processing module, wherein the service interface data acquisition module is used for acquiring service interface data corresponding to the micro-service, and the service interface data is service interface request data or interface log data or interface request chain data;
the service interface state judging module is used for judging the state of a service interface according to service interface data, wherein the state of the service interface comprises normal service interface and abnormal service interface;
a service interface registration state identification module, configured to identify a registration state of a service interface when the service interface state is a service interface normal state, where the registration state of the service interface includes a registered service interface and an unregistered service interface;
and the micro-service access module is used for registering an interface according to the registration information of the service interface when the registration state of the service interface is that the service interface is unregistered so as to complete micro-service access corresponding to the service interface.
In order to achieve the above object, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor implements the steps of the non-intrusive microservice access method as described above when executing the computer program.
To achieve the above object, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, where the computer program is executable by at least one processor, so as to cause the at least one processor to execute the steps of the non-intrusive microservice access method as described above.
According to the non-invasive micro-service access method, the system, the computer equipment and the computer readable storage medium, the micro-service corresponding to the interface with the normal business interface state can be accessed, management and monitoring of the interface corresponding to the micro-service are achieved, the micro-service provider can automatically access the system without modifying codes, and risks of micro-service modification and access are reduced.
The invention is described in detail below with reference to the drawings and specific examples, but the invention is not limited thereto.
Drawings
FIG. 1 is a flowchart illustrating steps of a method for non-intrusive micro-service access according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a step of determining a service interface status according to service interface data, where the service interface status includes a normal service interface and an abnormal service interface according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a step of determining an abnormal service interface status according to a first embodiment of the present invention;
fig. 4 is a flowchart illustrating steps of a method for registering an interface according to registration information of a service interface to complete a micro service access corresponding to the service interface when the registration status of the service interface is that the service interface is unregistered according to an embodiment of the present invention;
FIG. 5 is a block diagram of a second embodiment of the present invention;
fig. 6 is a schematic hardware structure diagram of a computer device according to a third embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Technical solutions between various embodiments may be combined with each other, but must be realized by those skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
Example one
Referring to fig. 1, a flowchart illustrating steps of a method for non-intrusive microservice access according to an embodiment of the present invention is shown. It is to be understood that the flow charts in the embodiments of the present method are not intended to limit the order in which the steps are performed. The following description is given by taking a computer device as an execution subject, specifically as follows:
as shown in fig. 1, the non-intrusive microservice access method may include steps S100 to S400, wherein:
step S100: and acquiring service interface data corresponding to the microservice, wherein the service interface data is request data of a service interface or log data of the interface or request chain data of the interface.
Specifically, micro service means that a large single application and service are split into tens of support services, the split services are micro services, and each micro service system has a corresponding service interface. The request data of the interface refers to data information returned after the interface is called. In some embodiments of this embodiment, the calling frequency of the interface is preset, and the interface is called according to the calling frequency to obtain the data information returned by the called interface. In this embodiment, the calling frequency of the interface is determined by an experienced developer according to the performance of the system, and the present solution is not limited herein.
The log data of the interface refers to an interface log generated by the service system in response to the interface call request, and service personnel can write a script file in the system, so that each micro-service system can upload the interface log corresponding to the micro-service system to the unified interface log management server, wherein the interface log comprises the log of the interface and the log generated by the system calling the interface, for example, when the calling interface has an ERROR at a certain time node, a keyword recorded in the interface log is "ERROR".
The request chain data of the interface means that the nodes of each micro service through which the request passes are recorded to form the request chain data. The request chain data comprises a request chain identifier, a span identifier and attached information, wherein the request chain identifier is that a globally unique identifier for identifying the request chain identifier is generated in a request at the beginning of the request, the request chain identifier is kept unchanged no matter how many micro service nodes pass through, and the micro service systems called by the request can be completely chained by the request chain identifier after being continuously transmitted along with the calling of each layer.
Step S200: and judging the state of the service interface according to the service interface data, wherein the state of the service interface comprises normal service interface and abnormal service interface.
In an exemplary embodiment, referring to fig. 2, step S200 may further include:
step S201: the method comprises the steps of obtaining a service interface configuration file, wherein the service interface configuration file is preset according to service interface data, when the service interface data is request data of a service interface, the configuration file comprises a response keyword, when the service interface data is log data of the service interface, the configuration file comprises a log sensitive word rule, and when the service interface data is request chain data of the service interface, the configuration file comprises an error code.
Step S202: and detecting the service interface data according to the service interface configuration file to acquire a service interface state.
In an exemplary embodiment, the response keyword is configured in advance, and when the service interface data is request data of a service interface, step S202 may further include:
and calling the service interface through the service calling request, confirming that the service interface is in a normal state when receiving a response keyword fed back by the service interface, and confirming that the service interface is in an abnormal state when the keyword fed back by the service interface is not received or the keyword fed back by the service interface is different from a preset response keyword.
Specifically, the request data of the service interface may be a keyword corresponding to the service request, and determine whether the request data of the interface is different from preset interface request data, where the preconfigured response keyword is a keyword returned when the service interface is in a normal state, for example, the interface is a face recognition interface, and the corresponding micro-service is a face recognition service, when a face is recognized by using a picture instead of using a face, the returned keyword should be recognized as failed under a normal condition, when the response keyword of the interface is not different from the preset response keyword, the service interface is in a normal state, and when the response keyword of the interface is different from the preset response keyword or the response keyword is not returned, the service interface is in an abnormal state.
In some embodiments of the present embodiment, the request data of the interface is obtained by setting a heartbeat frequency, a retry number, and a retry frequency in a configuration file. The heartbeat frequency is a frequency for calling a service interface, for example, 1 time for 1 second or 3 times for 1 second or other frequencies determined according to actual needs; the retry number refers to the number of times required for successfully calling the service interface, for example, if some interfaces are unsuccessfully called once, the calls need to be performed for many times to be successful; the retry frequency refers to the number of retries in a unit time, and in some embodiments of this embodiment, the service interface state can be comprehensively determined by setting a threshold of the heartbeat frequency, a threshold of the retry frequency, and combining request data of the interface, so as to improve the accuracy of determining the service interface state. The threshold of the heartbeat frequency, the threshold of the retry number, and the threshold of the retry frequency are determined by an experienced developer, and the present solution is not limited herein.
In an exemplary embodiment, a log sensitive word rule is configured in advance, and when the service interface data is log data of a service interface, step S202 may further include:
and when the log data hit the log sensitive word rule, confirming that the service interface is in an abnormal state, otherwise, confirming that the service interface is in a normal state.
Specifically, when the interface data information is log data of an interface, the interface state is determined according to a preset sensitive word rule, in some embodiments of this embodiment, the log sensitive word may be "ERROR", the keyword "ERROR" is screened out by setting the sensitive word rule, when the sensitive word rule hits the log sensitive word, the interface state is abnormal, otherwise, the interface state is normal.
In an exemplary embodiment, a request chain data error code is configured in advance, and when the service interface data is request chain data of a service interface, step S202 may further include:
and when the request chain data contains an error code, confirming that the micro service is in an abnormal state, otherwise, confirming that the service interface is in a normal state.
Specifically, a request chain data ERROR code is configured in advance, where the ERROR code may also be set to "ERROR", in some embodiments of this embodiment, when the interface data information is request chain data of an interface, an ERROR statement keyword and an ERROR frequency threshold may also be set in the configuration file to determine a service interface state, where the ERROR frequency refers to the number of times that an interface has an ERROR in a unit time, and when an unavailable interface is found in a service response and the ERROR frequency threshold is exceeded, the interface state is determined as an interface abnormal, otherwise, the interface state is determined as an interface normal, and similarly, the ERROR frequency threshold may also be determined by an experienced developer.
In an implementation manner of this embodiment, the interface state may be determined through a single interface data message, for example, the interface state is determined only through log data of the interface; in another embodiment of this embodiment, the interface state may be determined by integrating a plurality of pieces of interface data information, so as to improve the accuracy of the interface state determination.
In another embodiment, referring to fig. 3, the method further includes:
step S210: when the service interface state is that the service interface is abnormal, identifying the service interface as an abnormal service interface;
step S211: and acquiring interface service data of the abnormal service interface in a preset period to determine the service interface state of the abnormal service interface again.
Specifically, when the finally determined service interface state is an interface abnormality, the abnormal service interface is identified, because the interface state abnormality may be caused by some emergency situations, for example, power failure or network line interruption, and the micro-service corresponding to the service interface is not a problem, the abnormal service interface is detected again by setting a preset period, so that the situation that some normal service personnel interfaces are missed in the process of accessing the service interface is avoided.
Step S300: and when the service interface state is the service interface normal state, identifying the registration state of the service interface, wherein the registration state of the service interface comprises the registered service interface and the unregistered service interface.
Specifically, the interface is registered, that is, the interface is registered in the service registry, and the interface is unregistered or the interface is not registered in the service registry.
Step S400: and when the registration state of the service interface is that the service interface is not registered, registering the interface according to the registration information of the service interface so as to complete the micro-service access corresponding to the service interface.
In an exemplary embodiment, referring to fig. 4, step S400 may further include:
step S401: and when the service interface registration state is that the service interface is not registered, sending a registration invitation to the service interface.
Specifically, the service registration center sends a registration invitation to the service interface, so that the service interface feeds back interface registration information to the service registration center.
Step S402: and receiving the service interface registration information returned by the service interface based on the registration invitation.
Specifically, the interface registration information may include an interface name, an interface method, an interface IP, an interface port number, an interface state, and an interface owner of the interface, and of course, other settings may be performed according to actual needs, and the scheme is not limited herein.
Step S403: and registering the service interface according to the service interface registration information so as to complete the micro-service access corresponding to the service interface.
Specifically, the registration information of the service interface is registered at the service end to complete the registration of the service interface, and the corresponding micro-service is accessed according to the interface, for example, when the service interface is a face recognition interface, the face recognition micro-service is accessed.
The method comprises the steps of obtaining service interface data corresponding to the micro service, wherein the service interface data are request data of a service interface or log data of the interface or request chain data of the interface; judging the state of a service interface according to service interface data, wherein the state of the service interface comprises normal service interface and abnormal service interface; when the service interface state is that the service interface is normal, identifying the registration state of the service interface, wherein the registration state of the service interface comprises that the service interface is registered and the service interface is not registered; and when the registration state of the service interface is that the service interface is not registered, registering the interface according to the registration information of the service interface so as to complete the micro-service access corresponding to the service interface. Under the condition that the micro-service provider does not need to modify codes, the micro-service provider can automatically access the system, the risks of micro-service modification and access are reduced, meanwhile, the interface state is judged from multiple dimensions, and the accuracy of service interface state judgment is improved.
Example two
With continued reference to FIG. 5, a block diagram of the program modules of the non-intrusive microservice access system of the present invention is shown. In this embodiment, the non-intrusive microservice access system 20 may include or be partitioned into one or more program modules that are stored in a storage medium and executed by one or more processors to implement the present invention and implement the non-intrusive microservice access methods described above. The program modules referred to in the embodiments of the present invention refer to a series of computer program instruction segments that can perform specific functions, and are better suited than the program itself for describing the execution process of the non-intrusive microservice access system 20 in a storage medium. The following description will specifically describe the functions of the program modules of the present embodiment:
the service interface data obtaining module 200 is configured to obtain service interface data corresponding to the micro service, where the service interface data is request data of a service interface or log data of an interface or request chain data of an interface.
A service interface state judgment module 202, configured to judge a service interface state according to service interface data, where the service interface state includes a normal service interface and an abnormal service interface;
further, the service interface state determining module 202 is further configured to:
acquiring a service interface configuration file, wherein the service interface configuration file is preset according to service interface data, when the service interface data is request data of a service interface, the configuration file comprises a response keyword, when the service interface data is log data of the service interface, the configuration file comprises a log sensitive word rule, and when the service interface data is request chain data of the service interface, the configuration file comprises an error code;
and detecting the service interface data according to the service interface configuration file to acquire a service interface state.
Further, the service interface state determining module 202 is further configured to:
and calling the service interface through the service calling request, confirming that the service interface is in a normal state when receiving a response keyword fed back by the service interface, and confirming that the service interface is in an abnormal state when not receiving the keyword fed back by the service interface.
In an exemplary embodiment, a log sensitive word rule is configured in advance, and when the service interface data is log data of a service interface, the service interface state determination module 202 is further configured to:
and when the log data hit the log sensitive word rule, confirming that the service interface is in an abnormal state, otherwise, confirming that the service interface is in a normal state.
In an exemplary embodiment, a request chain data error code is configured in advance, and when the service interface data is request chain data of a service interface, the service interface state determining module 202 is further configured to:
and when the request chain data contains error codes, confirming that the micro service is in an abnormal state, otherwise, confirming that the service interface is in a normal state.
In another embodiment, the service interface state determining module 202 is further configured to:
step S210: when the service interface state is that the service interface is abnormal, identifying the service interface as an abnormal service interface;
step S211: and acquiring interface service data of the abnormal service interface in a preset period to determine the service interface state of the abnormal service interface again.
A service interface registration state identification module 204, configured to identify a registration state of the service interface when the service interface state is a service interface normal state, where the registration state of the service interface includes a registered service interface and an unregistered service interface.
And the micro-service access module 206 is configured to register an interface according to the registration information of the service interface when the registration state of the service interface is that the service interface is unregistered, so as to complete micro-service access corresponding to the service interface.
Further, the micro service access module 206 is further configured to:
when the service interface registration state is that the service interface is not registered, sending a registration invitation to the service interface;
receiving service interface registration information returned by the service interface based on the registration invitation;
and registering the service interface according to the service interface registration information so as to complete the micro-service access corresponding to the service interface.
EXAMPLE III
Fig. 6 is a schematic diagram of a hardware architecture of a computer device according to a third embodiment of the present invention. In the present embodiment, the computer device 2 is a device capable of automatically performing numerical calculation and/or information processing in accordance with a preset or stored instruction. The computer device 2 may be a rack server, a blade server, a tower server or a rack server (including an independent server or a server cluster composed of a plurality of servers), and the like. As shown in FIG. 6, the computer device 2 includes, but is not limited to, at least a memory 21, a processor 22, a network interface 23, and a non-intrusive microservice access system 20 communicatively coupled to each other via a system bus. Wherein:
in this embodiment, the memory 21 includes at least one type of computer-readable storage medium including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the storage 21 may be an internal storage unit of the computer device 2, such as a hard disk or a memory of the computer device 2. In other embodiments, the memory 21 may also be an external storage device of the computer device 2, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like provided on the computer device 2. Of course, the memory 21 may also comprise both internal and external memory units of the computer device 2. In this embodiment, the memory 21 is generally used for storing an operating system installed on the computer device 2 and various types of application software, such as the program codes of the non-intrusive microservice access system 20 of the above-mentioned embodiment. Further, the memory 21 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 22 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 22 is typically used to control the overall operation of the computer device 2. In this embodiment, the processor 22 is configured to run the program codes stored in the memory 21 or process data, for example, run the non-intrusive microservice access system 20, so as to implement the non-intrusive microservice access method of the above embodiment.
The network interface 23 may comprise a wireless network interface or a wired network interface, and the network interface 23 is generally used for establishing communication connection between the computer device 2 and other electronic apparatuses. For example, the network interface 23 is used to connect the computer device 2 to an external terminal through a network, establish a data transmission channel and a communication connection between the computer device 2 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, Bluetooth (Bluetooth), Wi-Fi, and the like.
It is noted that fig. 6 only shows the computer device 2 with components 20-23, but it is to be understood that not all shown components are required to be implemented, and that more or less components may be implemented instead.
In this embodiment, the non-intrusive microservice access system 20 stored in the memory 21 can also be divided into one or more program modules, and the one or more program modules are stored in the memory 21 and executed by one or more processors (in this embodiment, the processor 22) to complete the present invention.
For example, fig. 5 is a schematic diagram of program modules of a second embodiment of implementing the non-intrusive microservice access system 20, in this embodiment, the non-intrusive-based microservice access system 20 may be divided into a service interface data obtaining module 200, a service interface state judging module 202, a service interface registration state identifying module 204, and a microservice access module 206. The program modules referred to herein are a series of computer program instruction segments that can perform specific functions, and are more suitable than programs for describing the execution of the non-intrusive microservice access system 20 on the computer device 2. The specific functions of the program module service interface data acquisition module 200 and the micro service access module 206 have been described in detail in the second embodiment, and are not described herein again.
Example four
The present embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application mall, etc., on which a computer program is stored, which when executed by a processor implements corresponding functions. The computer readable storage medium of the present embodiment is used for storing the non-intrusive micro service access system 20, and when being executed by a processor, the non-intrusive micro service access method of the above embodiment is implemented.
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.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner.
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 method for non-intrusive microservice access, comprising:
acquiring service interface data corresponding to the microservice, wherein the service interface data is request data of a service interface or log data of the interface or request chain data of the interface;
judging the state of a service interface according to service interface data, wherein the state of the service interface comprises normal service interface and abnormal service interface;
when the service interface state is that the service interface is normal, identifying the registration state of the service interface, wherein the registration state of the service interface comprises that the service interface is registered and the service interface is not registered;
and when the registration state of the service interface is that the service interface is not registered, registering the interface according to the registration information of the service interface so as to complete the micro-service access corresponding to the service interface.
2. The non-invasive microservice access method according to claim 1, wherein said determining a traffic interface status based on traffic interface data, said traffic interface status comprising normal traffic interface and abnormal traffic interface comprises:
acquiring a service interface configuration file, wherein the service interface configuration file is preset according to service interface data, when the service interface data is request data of a service interface, the configuration file comprises a response keyword, when the service interface data is log data of the service interface, the configuration file comprises a log sensitive word rule, and when the service interface data is request chain data of the service interface, the configuration file comprises an error code;
and detecting the service interface data according to the service interface configuration file to acquire a service interface state.
3. The non-invasive microservice access method according to claim 2, wherein a response keyword is pre-configured, and when the service interface data is request data of a service interface, the detecting the service interface data according to the service interface configuration file and acquiring a service interface state comprises:
and calling the service interface through the service calling request, confirming that the service interface is in a normal state when receiving a response keyword fed back by the service interface, and confirming that the service interface is in an abnormal state when the keyword fed back by the service interface is not received or the keyword fed back by the service interface is different from a preset response keyword.
4. The non-invasive microservice access method according to claim 2, wherein a log sensitive word rule is pre-configured, and when the service interface data is log data of a service interface, the detecting the service interface data according to the service interface configuration file and acquiring a service interface state comprises:
and when the log data hit the log sensitive word rule, confirming that the service interface is in an abnormal state, otherwise, confirming that the service interface is in a normal state.
5. The non-invasive microservice access method according to claim 2, wherein a request chain data error code is preconfigured, and when the service interface data is request chain data of a service interface, the detecting the service interface data according to the service interface configuration file and acquiring a service interface status comprises:
and when the request chain data contains an error code, confirming that the micro service is in an abnormal state, otherwise, confirming that the service interface is in a normal state.
6. The non-intrusive microservice access method of claim 5, the method further comprising:
when the service interface state is that the service interface is abnormal, identifying the service interface as an abnormal service interface;
and acquiring interface service data of the abnormal service interface in a preset period to determine the service interface state of the abnormal service interface again.
7. The non-invasive microservice access method according to claim 6, wherein the registering an interface according to the registration information of the service interface to complete microservice access corresponding to the service interface when the service interface registration status is that the service interface is unregistered comprises:
when the service interface registration state is that the service interface is not registered, sending a registration invitation to the service interface;
receiving service interface registration information returned by the service interface based on the registration invitation;
and registering the service interface according to the service interface registration information so as to complete the micro-service access corresponding to the service interface.
8. A non-intrusive microservice access system, comprising:
the system comprises a service interface data acquisition module, a service interface data acquisition module and a service interface data processing module, wherein the service interface data acquisition module is used for acquiring service interface data corresponding to the micro-service, and the service interface data is service interface request data or interface log data or interface request chain data;
the service interface state judging module is used for judging the state of a service interface according to service interface data, wherein the state of the service interface comprises normal service interface and abnormal service interface;
a service interface registration state identification module, configured to identify a registration state of a service interface when the service interface state is a service interface normal state, where the registration state of the service interface includes a registered service interface and an unregistered service interface;
and the micro-service access module is used for registering an interface according to the registration information of the service interface when the registration state of the service interface is that the service interface is unregistered so as to complete micro-service access corresponding to the service interface.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the non-intrusive microservice access method of any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, having stored therein a computer program executable by at least one processor to cause the at least one processor to perform the steps of the non-intrusive microservice access method of any of claims 1-7.
CN202010910686.3A 2020-09-02 2020-09-02 Non-invasive micro-service access method and system Pending CN111984484A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010910686.3A CN111984484A (en) 2020-09-02 2020-09-02 Non-invasive micro-service access method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010910686.3A CN111984484A (en) 2020-09-02 2020-09-02 Non-invasive micro-service access method and system

Publications (1)

Publication Number Publication Date
CN111984484A true CN111984484A (en) 2020-11-24

Family

ID=73448455

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010910686.3A Pending CN111984484A (en) 2020-09-02 2020-09-02 Non-invasive micro-service access method and system

Country Status (1)

Country Link
CN (1) CN111984484A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108306917A (en) * 2017-01-13 2018-07-20 中国移动通信集团江西有限公司 The register method and device of data processing method and device, micro services module
CN109842637A (en) * 2017-11-24 2019-06-04 武汉斗鱼网络科技有限公司 A kind of Distributed Services register method and device
CN110505219A (en) * 2019-08-12 2019-11-26 南京莱斯信息技术股份有限公司 Micro services service registration Control management system and method based on dubbo
CN110990081A (en) * 2019-12-10 2020-04-10 北京懿医云科技有限公司 Microservice registration and discovery method and device, storage medium and electronic equipment
CN111158786A (en) * 2019-12-30 2020-05-15 武汉佰钧成技术有限责任公司 Micro-service project access method and platform

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108306917A (en) * 2017-01-13 2018-07-20 中国移动通信集团江西有限公司 The register method and device of data processing method and device, micro services module
CN109842637A (en) * 2017-11-24 2019-06-04 武汉斗鱼网络科技有限公司 A kind of Distributed Services register method and device
CN110505219A (en) * 2019-08-12 2019-11-26 南京莱斯信息技术股份有限公司 Micro services service registration Control management system and method based on dubbo
CN110990081A (en) * 2019-12-10 2020-04-10 北京懿医云科技有限公司 Microservice registration and discovery method and device, storage medium and electronic equipment
CN111158786A (en) * 2019-12-30 2020-05-15 武汉佰钧成技术有限责任公司 Micro-service project access method and platform

Similar Documents

Publication Publication Date Title
CN110222535B (en) Processing device, method and storage medium for block chain configuration file
CN108038039B (en) Method for recording log and micro-service system
CN110308880B (en) Log printing method, system, computer device and computer readable storage medium
CN112506755B (en) Log acquisition method, device, computer equipment and storage medium
CN110969417B (en) Government affair item synchronization method, device, system, computer equipment and storage medium
CN112039900B (en) Network security risk detection method, system, computer device and storage medium
CN111679968A (en) Interface calling abnormity detection method and device, computer equipment and storage medium
CN111831365A (en) Interface route forwarding method, system, computer equipment and readable storage medium
CN110896362B (en) Fault detection method and device
CN110069217B (en) Data storage method and device
CN111586022A (en) Firewall opening verification method, electronic device, computer equipment and storage medium
CN112328363B (en) Cloud hard disk mounting method and device
CN110866834B (en) Execution method and system of batch processing program
CN109905407B (en) Management method, system, equipment and medium for accessing intranet based on VPN server
CN115037653B (en) Service flow monitoring method, device, electronic equipment and storage medium
CN114880194B (en) Service abnormity monitoring method and device, electronic equipment and computer storage medium
CN111506641A (en) Data management method, data acquisition platform, data management system and storage medium
CN116932072A (en) Service configuration method, device, computer readable storage medium and terminal equipment
CN114500249B (en) Root cause positioning method and device
CN111984484A (en) Non-invasive micro-service access method and system
CN114490196A (en) Database switching method, system, device and medium
CN114298830A (en) Batch service processing method and device and batch service processing platform
CN110177077B (en) Account system offline processing method, device, equipment and storage medium
CN109408485B (en) Distributed lock implementation method and system
CN111324654A (en) Interface calling method, system, computer device and computer readable storage medium

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
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20201124