CN117336350A - Micro-service calling method, device, equipment and readable storage medium - Google Patents

Micro-service calling method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN117336350A
CN117336350A CN202311235590.1A CN202311235590A CN117336350A CN 117336350 A CN117336350 A CN 117336350A CN 202311235590 A CN202311235590 A CN 202311235590A CN 117336350 A CN117336350 A CN 117336350A
Authority
CN
China
Prior art keywords
micro
service
information
call
micro service
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
CN202311235590.1A
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.)
Shanghai Xinshi Technology Co ltd
Original Assignee
Shanghai Xinshi Technology 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 Shanghai Xinshi Technology Co ltd filed Critical Shanghai Xinshi Technology Co ltd
Priority to CN202311235590.1A priority Critical patent/CN117336350A/en
Publication of CN117336350A publication Critical patent/CN117336350A/en
Pending legal-status Critical Current

Links

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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • 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/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Exchange Systems With Centralized Control (AREA)

Abstract

The application discloses a micro-service calling method, a device, equipment and a readable storage medium, wherein the method comprises the following steps: acquiring a call request of a user and global management information of each micro service; determining micro services matched with the call request according to the global management information; and distributing the calling request to the micro-service so that the user can call the corresponding micro-service. The method and the device realize that the micro-service required by the call request is determined by acquiring the call request and the global management information and matching the call request and the global management information, and then the call request can be distributed to the micro-service so as to be called by a user for the corresponding micro-service, thereby completing the effect of micro-service call.

Description

Micro-service calling method, device, equipment and readable storage medium
Technical Field
The present disclosure relates to the field of micro services, and in particular, to a method, an apparatus, a device, and a readable storage medium for invoking a micro service.
Background
Microservices solve complexity problems by breaking the entire program into a set of services, each of which can be deployed and tuned independently.
However, the micro-service architecture brings convenience to people and also provides challenges for the authority control of the system. For example, functional differences and positioning ambiguity exist between micro-service application programs, and corresponding interface authority and interface information cannot be accurately acquired, so that authority information is not uniform during micro-service call, and abnormal micro-service call is caused.
Disclosure of Invention
In view of this, the present application provides a method, apparatus, device and readable storage medium for micro-service invocation, which aims to improve unified authentication of authority information when invoking micro-services.
In order to achieve the above object, the present application provides a micro service invocation method, including the steps of:
acquiring a call request of a user and global management information of each micro service;
determining micro services matched with the call request according to the global management information;
and distributing the calling request to the micro-service so that the user can call the corresponding micro-service.
Illustratively, the step of determining the micro-service matching the call request according to the global management information includes:
extracting authority information of each corresponding micro service from the global management information;
inputting the authority information and the call request into a preset analysis model, and analyzing a request link corresponding to the call request according to the analysis model to obtain an analysis result;
and determining the micro-service matched with the calling request according to the analysis result and the authority information.
Illustratively, the step of obtaining global management information of each micro service includes:
dynamically acquiring the full interface information of each micro service according to a preset information processing node;
according to the information processing node, carding the full interface information to obtain global management information;
the preset information processing node is the forefront node of a calling link for calling the micro service, and at least comprises a gateway, wherein the gateway is used for automatically pulling the full interface information of the introducing interface when the introducing interface is newly added to the calling link.
Exemplary, the step of dynamically obtaining the full-volume interface information of each micro service according to the preset information processing node includes:
and dynamically acquiring the total interface information of each micro service by carrying out information linkage between a preset information processing node and a preset micro service safety management framework.
Exemplary, the step of carding the full-volume interface information according to the information processing node to obtain global management information includes:
extracting authority information and interface characteristic information of each corresponding micro service interface in the full interface information according to the information processing node;
and carding the full interface information according to the interface characteristic information and the authority information to obtain global management information.
Illustratively, after the step of determining the micro-service matching the call request according to the global management information, the method further includes:
acquiring historical call data of the micro service, and analyzing the call request according to the historical call data to obtain an analysis result of the micro service required by the call request;
determining whether the micro service corresponding to the scheduling of the calling request is consistent with the analysis result;
and if the call requests are inconsistent, carrying out correction processing on the global management information or reselecting the micro-service to which the call requests are to be distributed.
Illustratively, the step of determining whether the micro service scheduled by the call request is consistent with the parsing result includes:
determining whether a micro-service call record corresponding to the call request exists in the history call data according to the history call data;
if yes, acquiring a combined application record of each micro service corresponding to the micro service call record;
and determining whether the calling request is consistent with the analysis result according to the combined application record.
Illustratively, to achieve the above object, the present application further provides a micro service invocation apparatus, the apparatus including:
the acquisition module is used for acquiring a call request of a user and global management information of each micro service;
the determining module is used for determining the micro-service matched with the calling request according to the global management information;
and the distribution module is used for distributing the calling request to the micro-service so as to enable the user to call the corresponding micro-service.
Illustratively, to achieve the above object, the present application further provides a micro service invocation apparatus, the apparatus including: a memory, a processor, and a micro-service invocation program stored on the memory and executable on the processor, the micro-service invocation program configured to implement the steps of the micro-service invocation method as described above.
Illustratively, to achieve the above object, the present application further provides a computer-readable storage medium having stored thereon a micro service invocation program which, when executed by a processor, implements the steps of the micro service invocation method as described above.
In the related art, functional differences and positioning ambiguity exist between micro service application programs, and corresponding interface authorities and interface information cannot be accurately acquired, so that authority information is not uniform when micro services are called, and abnormal micro service calling is caused; determining micro services matched with the call request according to the global management information; and distributing the calling request to the micro-service so that the user can call the corresponding micro-service. That is, when the call request of the user is obtained, global management information of each micro service is also obtained, through the global management information, the micro service corresponding to the call request can be determined, and the call request is distributed to the micro service, so that the effect that the user calls the corresponding micro service is achieved, namely, all the micro services in the system are managed through the global management information, the consistency of authority information in response to the call request is ensured, and the normal call of the micro service is ensured.
Drawings
FIG. 1 is a flowchart of a first embodiment of a micro service invocation method according to the present application;
FIG. 2 is a micro-service invocation system architecture based on gateway global management in an embodiment of the present application;
FIG. 3 is a flow chart illustrating another embodiment of a micro service invocation method according to the present application;
fig. 4 is a schematic structural diagram of a hardware running environment according to an embodiment of the present application.
The realization, functional characteristics and advantages of the present application will be further described with reference to the embodiments, referring to the attached drawings.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
Referring to fig. 1, fig. 1 is a schematic flow chart of a first embodiment of a micro service invocation method of the present application.
Embodiments of the micro service invocation method provide embodiments of the micro service invocation method, it being noted that although a logical order is illustrated in the flow chart, in some cases the steps illustrated or described may be performed in an order different from that illustrated herein. For convenience of description, each step of the execution subject description micro service call method is omitted below, and the micro service call method includes:
step S110: acquiring a call request of a user and global management information of each micro service;
in this embodiment, for the micro service invocation scenario, it is required to ensure both unified management of authority information during micro service invocation and security during invocation of each micro service, but related micro service invocation systems or frameworks all generate problems such as management level due to the characteristics of micro service architecture, for example, functional differences and positioning ambiguity exist between micro service application programs, and corresponding interface authority and interface information cannot be accurately acquired, so that authority information is not uniform during micro service invocation, and thus micro service invocation is abnormal.
In addition, the rights control framework product for calling micro services on the market currently has the following defects:
1.Spring Security has a perfect safety management system, but the operation process is complex, and documents are more, so that the learning cost of a user when using the framework is higher, the difficulty of the user's hands is higher, and the later use is not facilitated;
2. complicated configuration: the complex configuration including user authentication, authorization operation and the like is required, which is difficult for beginners and brings inconvenience to users;
3. code redundancy: the configuration can increase a plurality of template codes, and lacks simple methods or tools, so that repeated codes are caused, namely when the related information of each micro service is managed, the information cannot be uniformly managed, and a management effect cannot be reasonably and quickly realized when a subsequent developer manages the micro service calling function;
4. compatibility problem: compatibility conflict problems may arise when other third party frameworks are used simultaneously.
To sum up, in order to solve the above-mentioned problems, in this embodiment, a corresponding micro-service invocation method is provided, which mainly aims to uniformly manage the micro-services that are independently arranged, collect the information of each micro-service, and avoid the situation of individually processing each micro-service, thereby ensuring the uniformity of authority information when the micro-service is invoked later, and reducing the difficulty of using the micro-service invocation framework or system.
Therefore, in this embodiment, when a corresponding call request of a user is obtained, global management information of each micro service needs to be obtained, where the call request is a request when the user needs to control a system where each micro service is located to implement each function or operation provided by the micro service, and the system adaptively calls an appropriate micro service according to the call request to implement the operation or function corresponding to the request, where the global management information is unified information for characterizing relevant information of each micro service in the system, and the global management information performs unified management on all micro services in the system, where the management process includes authority information of each micro service, and includes information such as name, type, and specific data location of each micro service.
Since the global management information manages each micro service from the overall system point of view, the authority information in the global management information is unified to authenticate the authority information of all the micro services from the global point of view of the micro service call by the system.
Step S120: determining micro services matched with the call request according to the global management information;
in this embodiment, the global management information includes related information and authority information of each micro service, so that the call request and the global management information can be matched and authenticated, and thus the micro service suitable for responding to the current call request can be screened out.
Illustratively, the step of determining the micro-service matching the call request according to the global management information includes:
step a: extracting authority information of each corresponding micro service from the global management information;
in this embodiment, authority information corresponding to each micro service may be extracted from the global management information, where the authority information is an authority setting requirement of each micro service that can respond to the call request, and it may be determined whether there is a call request that satisfies the response to the current user through the authority information.
Step b: inputting the authority information and the call request into a preset analysis model, and analyzing a request link corresponding to the call request according to the analysis model to obtain an analysis result;
in this embodiment, after obtaining the authority information, the authority information and the call request are both input into a preset analysis model, so that a request link corresponding to the call request can be analyzed according to the analysis model, and an analysis result is obtained.
The analysis process mainly analyzes service functions required by the call request, and analyzes all micro services suitable for responding to the call request by combining the authority information.
It should be noted that, through an analysis model, a request link of a call request is analyzed, and various service functions required by the link and a specific path of the request link are mainly analyzed, so that according to the analysis result, the composition form and composition effect of a plurality of call links for calling micro services can be determined by combining with the authority information.
The preset analysis model mainly sets corresponding analysis rules, analysis sequences and analysis key points, for example, the analysis model is added with the analysis rules which meet the mapping relation between each requirement in the call request and each micro-service function, and the analysis rules of the composition effect among the micro-service functions can be further increased.
It will be appreciated that the analysis rules include two types, one of which is the minimum micro-service that needs to be scheduled when the analysis gateway responds to the call request, and the other of which is the efficiency of service resource utilization when the analysis gateway responds to the micro-service that is invoked when the call request.
Specifically, when analyzing the minimum micro-services required to be scheduled when the gateway responds to the call request, taking the case that the currently initiated request needs to call three services, wherein the three services can be services of data clearing, data noise reduction processing and data conversion, when responding to the request, the gateway can be directly used for searching the services corresponding to the three functions, and the corresponding request task is scheduled to the corresponding three micro-services, so that the response action is realized.
When the task is scheduled to the corresponding micro service, the situation of the micro service to be scheduled needs to be determined, for example, the micro service A provides a data clearing function, the micro service B provides a data noise reduction processing function, the micro service C provides a data conversion function, and the micro service D provides a data processing function including data conversion and data noise reduction.
Specifically, when analyzing the utilization efficiency of service resources when the gateway responds to the micro service called when the call request is sent, taking the current initiation of three call requests as an example, wherein the quantity of resources required by the three call requests is different, for example, the condition of resources required by the request a is 10, the resources required by the request B is 1, the resources required by the request C is 2, at this time, it can be understood that the resources required by the request a are far greater than the resources required by the other two requests, when the tasks corresponding to the request a are allocated to the corresponding micro service, the condition of overlarge load may be caused to the corresponding server of the micro service, the actual effect of the subsequent response to the request a is affected, therefore, in the current analysis process, after determining that the request with larger resource requirement exists, the condition of each resource needs to be analyzed, the request is correspondingly allocated to the idle service node with low resource utilization rate, and it can be understood that each service can be correspondingly provided with a plurality of nodes, each node can provide corresponding service functions, and each node can be allocated with the same resource in the service node to the condition of the service node, and the condition of the service node can be shared by the same resources in advance, and the condition of the service node can be shared by the node to realize the intelligent network has high-pressure condition.
In summary, when the gateway intelligently distributes the call request to each service, the gateway has at least the following processing functions, distributes the control call request to the distribution effect of each service in a global angle as a whole, performs predictive analysis before distribution, and simultaneously analyzes the specific condition of the dispatch service and the resource usage condition when the service is dispatched, thereby simultaneously realizing the effects of reducing the quantity of the issuing tasks and reducing the high resource occupancy rate of each corresponding node of the service, and comprehensively realizing the effects of safe call, accurate call and intelligent call of the response of the gateway to the call request and the global service call.
Step c: and determining the micro-service matched with the calling request according to the analysis result and the authority information.
After the corresponding analysis result is obtained according to the analysis model, the information in the analysis result and the authority information can be synthesized to determine the micro-services matched with the call request, so that the effect of responding to the call request and completing the micro-service call can be further realized according to the result obtained by the determination, and in the process, the screening of each micro-service with the authority information meeting the call request is equivalent, and finally, an optimal call link is obtained.
Step S130: and distributing the calling request to the micro-service so that the user can call the corresponding micro-service.
In this embodiment, the call request is distributed to the micro service, so as to implement a call process of the system to the micro service, that is, implement an effect that the user calls the corresponding micro service.
In summary, the global management information is used as a judgment standard, so that the effect of unified management of all micro services in the system where each micro service is located can be realized.
Step S140: and if the matching result is null, intercepting the call request at the information processing node.
In this embodiment, when the matching result is empty, it is proved that the authority of each micro service in the current system cannot achieve the response effect corresponding to the call request, which is equivalent to that the authority information involved in the current global management information is insufficient to support the call request, that is, the call request of the micro service cannot be normally achieved at present, so that the call request needs to be directly intercepted at the information processing node at this time, and the system is prevented from being affected by the call request.
In summary, a corresponding micro service call system architecture based on a gateway as an information processing node may be actually set, specifically referring to fig. 2, it can be known from fig. 2 that in the micro service call system architecture, the following functions may be implemented respectively:
gateway dynamic configuration: interface information not required by each service is preconfigured to prevent pulling of dirty interface data.
Dynamically extracting interface data: and acquiring the full interface information of each service in real time and dynamically through linkage with the spring native context component.
The gateway retrieves interface data; and screening out the interface authority information of the current interface according to the path requested by the user and the global management information extracted in the last step.
Request distribution: if the request passes the verification, normally distributing the request to the service dynamically configured in the first step, and if the request does not pass the verification, directly intercepting the request.
Wherein each business service A, B, C corresponds to a different micro service.
In the related art, functional differences and positioning ambiguity exist between micro service application programs, and corresponding interface authorities and interface information cannot be accurately acquired, so that authority information is not uniform when micro services are called, and abnormal micro service calling is caused; determining micro services matched with the call request according to the global management information; and distributing the calling request to the micro-service so that the user can call the corresponding micro-service. That is, when the call request of the user is obtained, global management information of each micro service is also obtained, through the global management information, the micro service corresponding to the call request can be determined, and the call request is distributed to the micro service, so that the effect that the user calls the corresponding micro service is achieved, namely, all the micro services in the system are managed through the global management information, the consistency of authority information in response to the call request is ensured, and the normal call of the micro service is ensured.
An embodiment is provided based on the first embodiment of the micro service invocation method, in which, referring to fig. 3, the step of obtaining global management information of each micro service includes:
step S210: dynamically acquiring the full interface information of each micro service according to a preset information processing node;
in this embodiment, according to a preset information processing node, the full-volume interface information of each micro service may be dynamically obtained, where the full-volume interface information refers to all information corresponding to each micro service.
The preset information processing node is equivalent to unifying and summarizing all information of each micro service, so that the effect of unified management of all micro services can be achieved.
The full interface information mainly corresponds to all information of interfaces providing different micro services, including parameters of the interfaces, information of the interfaces corresponding to the micro services, and the like.
The process of dynamically acquiring the full interface information mainly comprises the step that when a newly added interface is accessed in a system formed by micro services, the information processing node dynamically acquires the full interface information of the newly added interface in an automatic grabbing mode, so that the integrity of information owned by the information processing node is ensured.
Exemplary, the step of dynamically obtaining the full-volume interface information of each micro service according to the preset information processing node includes:
step d: and dynamically acquiring the total interface information of each micro service by carrying out information linkage between a preset information processing node and a preset micro service safety management framework.
In this embodiment, when the full-volume interface information of each micro service is dynamically acquired, information linkage is performed between a preset information processing node and a preset micro service security management frame, that is, the information equivalent to analysis and supervision of each micro service by the micro service security management frame is used as the basis of the information required to be acquired by the information processing node, so that the uniformity of all the information in the system is ensured.
The preset micro-service Security management framework can be a Security management system corresponding to Spring Security, and when the information processing node is linked with the Security management system, the information processing node is linked with Spring native context components corresponding to each micro-service, so that the acquisition action of the full-volume interface information is realized.
Step S220: according to the information processing node, carding the full interface information to obtain global management information;
the preset information processing node is the forefront node of a calling link for calling the micro service, and at least comprises a gateway, wherein the gateway is used for automatically pulling the full interface information of the introducing interface when the introducing interface is newly added to the calling link.
In this embodiment, the preset information processing node at least includes a gateway, and the gateway is used as a starting point of a call link when the micro-service is called, and the gateway is used as the information processing node, so that an effect of quickly responding to each call request at the front end of the whole call link can be achieved, and the call request is prevented from being distributed to each micro-service midway in the call link, and each micro-service still needs to judge the authority condition of each micro-service by itself, so that maintenance points and maintenance complexity of a system related to the call link are reduced for related personnel in a later period, and the maintenance effect of the system related to the call link by related personnel in a later period is improved.
The gateway is also provided with the effect of automatically receiving the full-quantity interface information of each micro service, namely, each time an interface which is newly added and introduced into the system is arranged, the full-quantity interface information corresponding to the introduced interface can be automatically pulled, which is equivalent to automatically updating global management information under the current system.
In this embodiment, the processing node performs a carding process on the full-volume interface information, and the carding process may further include a related process of analyzing and classifying the full-volume interface information, so as to obtain corresponding global management information.
The information processing node is limited to the forefront node of the calling link for calling the micro service, so that the effect of uniformly controlling the information of the whole calling link at the front end of the link can be realized.
Exemplary, the step of carding the full-volume interface information according to the information processing node to obtain global management information includes:
step e: extracting authority information and interface characteristic information of each corresponding micro service interface in the full interface information according to the information processing node;
step f: and carding the full interface information according to the interface characteristic information and the authority information to obtain global management information.
In this embodiment, according to the information processing node, the corresponding information corresponding to each micro service interface in the full-volume interface information is processed by the node, so as to obtain global management information, where the processing process mainly includes extraction of important information and carding of information.
Specifically, after receiving the full-volume interface information, authority information and interface characteristic information corresponding to each micro service interface in the full-volume interface information are received at the information processing node.
The authority information mainly comprises authority information of calling each micro-service and a scene applicable to each micro-service, wherein the authority information of combined application among the micro-services can be used for judging whether a system in which each micro-service is positioned can normally call each micro-service or not.
The interface characteristic information mainly includes information about each micro service, for example, functions that each micro service can realize, names of each micro service, interface specific parameter information of each micro service, and the like.
In this embodiment, after the corresponding authority information and interface feature information are extracted, the extracted information may be subjected to carding processing including classification, sorting, aggregation and other processing, so that global management information may be obtained, that is, specific information of each micro service and the corresponding authority information may be reflected reversely through the global management information, so as to ensure the accuracy and safety of subsequent call.
Illustratively, after the step of determining the micro-service matching the call request according to the global management information, the method further includes:
step g: acquiring historical call data of the micro service, and analyzing the call request according to the historical call data to obtain an analysis result of the micro service required by the call request;
the history call data refers to a history record called as a server through global management information, wherein the history record corresponds to specific request content of each call request, each micro-service function required by the request, specific called micro-service and other information.
The historical call data is used as a comparison standard to compare the micro-service required by the call request, the difference between the function required by the current call request and the historical call data is determined, if the difference is consistent, the current call request can be directly called to the proper micro-service, if the difference is inconsistent, the situation that the corresponding micro-service cannot be called possibly exists, therefore, when re-analysis is needed, the key analysis is performed, whether the micro-service similar to the call request is called in the past is equivalent to being used as an intermediate verification link, and the accurate call to the proper micro-service is ensured.
Step h: determining whether the micro service corresponding to the scheduling of the calling request is consistent with the analysis result;
in this embodiment, it may be determined whether the micro-service called by the call request corresponds to the analysis result, and if so, it may be determined that the current call request can be directly called to the appropriate micro-service.
Step i: and if the call requests are inconsistent, carrying out correction processing on the global management information or reselecting the micro-service to which the call requests are to be distributed.
If the comparison result is inconsistent, it may be determined based on the history call data that the call result of the current call request has a problem, for example, the micro-service called by the current call request has a deviation, and may not correctly implement the corresponding call effect, or the function provided by the micro-service called by the current call and the history call data have a deviation, so when the comparison is inconsistent, the global management information needs to be corrected or the micro-service to be called by the call request needs to be selected again.
Illustratively, the step of determining whether the micro service scheduled by the call request is consistent with the parsing result includes:
step j: determining whether a micro-service call record corresponding to the call request exists in the history call data according to the history call data;
step k: if yes, acquiring a combined application record of each micro service corresponding to the micro service call record;
step l: and determining whether the calling request is consistent with the analysis result according to the combined application record.
When the analysis result is obtained through analysis, screening judgment is needed to be carried out on the history call data, whether a corresponding micro-service call record exists in the history call data is judged, the micro-service call record refers to the micro-service application condition corresponding to the call request when the call request is triggered, and the record contains the corresponding micro-service quantity, the micro-service type, the micro-service data and the function condition provided by the micro-service, namely, the micro-service condition of calling of different call requests related in the history call data can be locked through the call record.
Different micro services can provide different service functions, so that different application effects can be obtained after different micro services are combined according to different sequences.
In summary, the combined application record of each micro service can be used as a judgment standard, and the consistency between the micro service required to be called by the current call request and the analysis result can be realized.
In this embodiment, according to a preset information processing node, the full-volume interface information of each micro service is dynamically obtained; according to the information processing node, carding the full interface information to obtain global management information; the preset information processing node is the forefront node of a calling link for calling the micro service. The corresponding information processing nodes are set by utilizing the forefront node of the calling link for calling the micro-service, so that the total interface information of each micro-service can be collected and processed at the forefront of the calling link, and the effect of grasping the total interface information of all the micro-services in the system at the forefront of the calling link is realized, thereby facilitating the subsequent information unification authentication when the micro-service is called.
In addition, the application further provides a micro-service calling device, which comprises:
the acquisition module is used for acquiring a call request of a user and global management information of each micro service;
the determining module is used for determining the micro-service matched with the calling request according to the global management information;
the distribution module is used for distributing the calling request to the micro-service so as to enable the user to call the corresponding micro-service;
and the judging module is used for intercepting the call request at the information processing node if the matching result is null.
Illustratively, the determining module includes:
the extraction sub-module is used for extracting authority information of each corresponding micro service from the global management information;
the analysis sub-module is used for inputting the authority information and the call request into a preset analysis model, and analyzing a request link corresponding to the call request according to the analysis model to obtain an analysis result;
and the determining submodule is used for determining the micro-service matched with the calling request according to the analysis result and the authority information.
Illustratively, the acquisition module includes:
the acquisition sub-module is used for dynamically acquiring the full interface information of each micro service according to a preset information processing node;
the processing sub-module is used for carding the full interface information according to the information processing node to obtain global management information; the preset information processing node is the forefront node of a calling link for calling the micro service, and at least comprises a gateway, wherein the gateway is used for automatically pulling the full interface information of the introducing interface when the introducing interface is newly added to the calling link;
illustratively, the acquisition submodule includes:
the acquisition unit is used for dynamically acquiring the full-quantity interface information of each micro service through information linkage between the preset information processing node and the preset micro service safety management frame.
Illustratively, the processing sub-module includes:
the extraction unit is used for extracting authority information and interface characteristic information of each corresponding micro-service interface in the total interface information according to the information processing node;
and the processing unit is used for carding the full interface information according to the interface characteristic information and the authority information to obtain global management information.
Illustratively, the apparatus further comprises:
the historical data acquisition module is used for acquiring historical call data of the micro-service, analyzing the call request according to the historical call data, and obtaining an analysis result of the micro-service required by the call request;
the analysis comparison module is used for determining whether the micro service corresponding to the scheduling of the call request is consistent with the analysis result;
and the analysis judging module is used for carrying out correction processing on the global management information or reselecting the micro-service to which the call request is to be distributed if the global management information is inconsistent.
Illustratively, the analytical comparison module includes:
the record determining submodule is used for determining whether a micro-service call record corresponding to the call request exists in the history call data according to the history call data;
the record judging sub-module is used for acquiring the combined application record of each micro service corresponding to the micro service call record if the micro service call record exists;
and the record comparison sub-module is used for determining whether the calling request is consistent with the analysis result according to the combined application record.
The specific implementation manner of the micro service calling device is basically the same as that of each embodiment of the micro service calling method, and is not repeated here.
In addition, the application also provides micro-service calling equipment. As shown in fig. 4, fig. 4 is a schematic structural diagram of a hardware running environment according to an embodiment of the present application.
By way of example, fig. 4 is a schematic diagram of a hardware operating environment of a micro service invocation device.
As shown in fig. 4, the micro service invocation device may include a processor 401, a communication interface 402, a memory 403, and a communication bus 404, where the processor 401, the communication interface 402, and the memory 403 complete communication with each other through the communication bus 404, and the memory 403 is used for storing a computer program; the processor 401 is configured to implement the steps of the micro service invocation method when executing the program stored in the memory 403.
The communication bus 404 mentioned above for the micro service invocation device may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus 404 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface 402 is used for communication between the micro service invocation device and other devices described above.
The Memory 403 may include a random access Memory (Random Access Memory, RMD) or may include a Non-Volatile Memory (NM), such as at least one disk Memory. Optionally, the memory 403 may also be at least one storage device located remotely from the aforementioned processor 401.
The processor 401 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
The specific implementation manner of the micro service calling device is basically the same as that of each embodiment of the micro service calling method, and is not repeated here.
In addition, the embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores a micro service calling program, and the micro service calling program realizes the steps of the micro service calling method when being executed by a processor.
The specific embodiments of the computer readable storage medium of the present application are substantially the same as the embodiments of the foregoing micro service invocation method, and are not described herein again.
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 one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) as described above, including several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method described in the embodiments of the present application.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the claims, and all equivalent structures or equivalent processes using the descriptions and drawings of the present application, or direct or indirect application in other related technical fields are included in the scope of the claims of the present application.

Claims (10)

1. A micro service invocation method, characterized in that the micro service invocation method comprises the steps of:
acquiring a call request of a user and global management information of each micro service;
determining micro services matched with the call request according to the global management information;
distributing the calling request to the micro-service so that the user can call the corresponding micro-service;
and if the matching result is null, intercepting the call request at the information processing node.
2. The micro service invocation method of claim 1, wherein the step of determining the micro service matching the invocation request based on the global management information comprises:
extracting authority information of each corresponding micro service from the global management information;
inputting the authority information and the call request into a preset analysis model, and analyzing a request link corresponding to the call request according to the analysis model to obtain an analysis result;
and determining the micro-service matched with the calling request according to the analysis result and the authority information.
3. The micro service invocation method of claim 1, wherein the step of obtaining global management information for each micro service comprises:
dynamically acquiring the full interface information of each micro service according to a preset information processing node;
according to the information processing node, carding the full interface information to obtain global management information;
the preset information processing node is the forefront node of a calling link for calling the micro service, and at least comprises a gateway, wherein the gateway is used for automatically pulling the full interface information of the introducing interface when the introducing interface is newly added to the calling link.
4. The micro service invocation method of claim 3, wherein the step of dynamically acquiring the full-volume interface information of each micro service according to the preset information processing node comprises:
and dynamically acquiring the total interface information of each micro service by carrying out information linkage between a preset information processing node and a preset micro service safety management framework.
5. The method for invoking micro services according to claim 3, wherein said step of carding said full-scale interface information according to said information processing node to obtain global management information comprises:
extracting authority information and interface characteristic information of each corresponding micro service interface in the full interface information according to the information processing node;
and carding the full interface information according to the interface characteristic information and the authority information to obtain global management information.
6. The micro-service invocation method of claim 1, wherein after the step of determining the micro-service matching the invocation request based on the global management information, the method further comprises:
acquiring historical call data of the micro service, and analyzing the call request according to the historical call data to obtain an analysis result of the micro service required by the call request;
determining whether the micro service corresponding to the scheduling of the calling request is consistent with the analysis result;
and if the call requests are inconsistent, carrying out correction processing on the global management information or reselecting the micro-service to which the call requests are to be distributed.
7. The micro service invocation method of claim 6, wherein the step of determining whether the micro service for which the invocation request corresponds to the schedule is consistent with the resolution result comprises:
determining whether a micro-service call record corresponding to the call request exists in the history call data according to the history call data;
if yes, acquiring a combined application record of each micro service corresponding to the micro service call record;
and determining whether the calling request is consistent with the analysis result according to the combined application record.
8. A micro service invocation apparatus, the micro service invocation apparatus comprising:
the acquisition module is used for acquiring a call request of a user and global management information of each micro service;
the determining module is used for determining the micro-service matched with the calling request according to the global management information;
and the distribution module is used for distributing the calling request to the micro-service so as to enable the user to call the corresponding micro-service.
9. A micro service invocation apparatus, the apparatus comprising: a memory, a processor, and a micro service invocation program stored on the memory and executable on the processor, the micro service invocation program configured to implement the steps of the micro service invocation method of any of claims 1 to 7.
10. A computer-readable storage medium, characterized in that it has stored thereon a micro service invocation program, which when executed by a processor, implements the steps of the micro service invocation method of any of claims 1 to 7.
CN202311235590.1A 2023-09-22 2023-09-22 Micro-service calling method, device, equipment and readable storage medium Pending CN117336350A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311235590.1A CN117336350A (en) 2023-09-22 2023-09-22 Micro-service calling method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311235590.1A CN117336350A (en) 2023-09-22 2023-09-22 Micro-service calling method, device, equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN117336350A true CN117336350A (en) 2024-01-02

Family

ID=89289495

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311235590.1A Pending CN117336350A (en) 2023-09-22 2023-09-22 Micro-service calling method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN117336350A (en)

Similar Documents

Publication Publication Date Title
CN110535777B (en) Access request control method and device, electronic equipment and readable storage medium
CA2119085C (en) Adaptive communication system
CN110363026B (en) File operation method, device, equipment, system and computer readable storage medium
CN109995859A (en) A kind of dispatching method, dispatch server and computer readable storage medium
CN110532025B (en) Data processing method, device and equipment based on micro-service architecture and storage medium
CN103973770A (en) Information processing system
CN112231168A (en) Micro server control method, device, equipment and storage medium
CN110958314A (en) Grayscale publishing method and device of service and computer equipment
CN109034603B (en) Business process execution method, device and computer readable storage medium
CN112799970B (en) Test data processing method, device, electronic equipment and medium
CN113961332A (en) Method and device for realizing workflow engine, electronic equipment and storage medium
CN111447273B (en) Cloud processing system and data processing method based on cloud processing system
CN117336350A (en) Micro-service calling method, device, equipment and readable storage medium
CN111045725A (en) Control method, device and storage medium of code management system
CN111061637A (en) Interface test method, interface test device and storage medium
US7376955B1 (en) Server communication channel architecture and implementation method
CN111913784A (en) Task scheduling method and device, network element and storage medium
CN113590178B (en) API instance management method and device, storage medium and electronic equipment
CN114461230A (en) Gray scale publishing method, device, equipment and medium
CN115543491A (en) Microservice processing method and device
CN114519477A (en) Large data platform tenant management system, method, storage medium and electronic equipment
US11888944B2 (en) System and method for determination and use of workflow characteristics with an integration cloud service
CN111324472B (en) Method and device for judging garbage items of information to be detected
CN117492904A (en) Micro-service gray level publishing method, system, device and medium
CN116976613A (en) Bill combined product dispatching system, method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication