CN117632538A - Service calling method, device, equipment and storage medium of self-adaptive structure - Google Patents

Service calling method, device, equipment and storage medium of self-adaptive structure Download PDF

Info

Publication number
CN117632538A
CN117632538A CN202311599743.0A CN202311599743A CN117632538A CN 117632538 A CN117632538 A CN 117632538A CN 202311599743 A CN202311599743 A CN 202311599743A CN 117632538 A CN117632538 A CN 117632538A
Authority
CN
China
Prior art keywords
service
information
target
proxy
interface
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
CN202311599743.0A
Other languages
Chinese (zh)
Inventor
陈晓明
龙喜洋
刘海东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Merchants Finance Technology Co Ltd
Original Assignee
China Merchants Finance 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 China Merchants Finance Technology Co Ltd filed Critical China Merchants Finance Technology Co Ltd
Priority to CN202311599743.0A priority Critical patent/CN117632538A/en
Publication of CN117632538A publication Critical patent/CN117632538A/en
Pending legal-status Critical Current

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The invention relates to a system architecture technology and discloses a service calling method, a device, equipment and a storage medium of a self-adaptive structure. The method comprises the following steps: basic information of a target call service is obtained, and the basic information is structured to obtain a service statement annotation table; analyzing the service statement annotation table by utilizing a pre-constructed remote procedure call frame to generate interface information of the target call service; configuring the interface information by utilizing a pre-constructed proxy generation service to obtain a proxy service; and calling the target calling service by using the proxy service, and feeding back a response result generated by the target calling service to the pre-constructed client. The invention can reduce code redundancy through service annotation in a remote procedure call scene, and improves service call efficiency by realizing automatic generation of call interfaces between internal and external services.

Description

Service calling method, device, equipment and storage medium of self-adaptive structure
Technical Field
The present invention relates to the field of system architecture technologies, and in particular, to a service calling method, apparatus, device and computer readable storage medium for an adaptive architecture.
Background
Some micro services, such as service a and service B, use the same technology architecture, and rely more between the two services, so as to facilitate inter-service interface call and reduce repeated code writing, and thus API communication between service a and service B is performed by using RPC. However, when it is desired to provide an interface to a third party calling external cross-languages, the third party will generally expect that service a provides an interface to the HTTP protocol, rather than an interface in the form of RPC.
The prior art solves the problems that two sets of codes are prepared in a system frame, and besides the RPC codes, a set of code interface based on an http protocol is provided again, so that a lot of repeated workload and complicated codes are brought.
Disclosure of Invention
The invention provides a service calling method, a device, equipment and a storage medium with a self-adaptive structure, which mainly aim to reduce code redundancy through service annotation in a remote procedure calling scene and improve service calling efficiency by realizing automatic generation of calling interfaces between internal and external services.
In order to achieve the above object, the present invention provides a service calling method of an adaptive structure, including:
basic information of a target call service is obtained, and the basic information is structured to obtain a service statement annotation table;
analyzing the service statement annotation table by utilizing a pre-constructed remote procedure call frame to generate interface information of the target call service;
configuring the interface information by utilizing a pre-constructed proxy generation service to obtain a proxy service;
and calling the target calling service by using the proxy service, and feeding back a response result generated by the target calling service to the pre-constructed client.
Optionally, the obtaining basic information of the target call service and performing structural processing on the basic information to obtain a service statement annotation table includes:
declaring a target annotation and defining an attribute of the target annotation;
marking the target annotation to the target calling service, and acquiring basic information in the class of the target calling service by utilizing a reflection mechanism;
and screening and filling the basic information according to the attribute of the target annotation to obtain a service statement annotation table.
Optionally, the analyzing the service statement annotation table by using the pre-constructed remote procedure call framework, generating the interface information of the target call service includes:
inquiring whether each class of the target call service contains annotation marks or not by utilizing traversal inquiry service in a pre-constructed remote procedure call framework;
when the annotation mark is detected, a service statement annotation table corresponding to the target annotation mark is obtained;
analyzing each field information in the service statement annotation table, filling the field information into a preset data structure, and respectively obtaining interface routing information and service information;
and carrying out aggregate output on the interface route information and the service information to obtain the interface information of the target calling service.
Optionally, before the service is generated by using the pre-constructed agent, the method further includes:
configuring a communication mode for transmitting information between each service by using an HTTP protocol;
configuring a data transmission type in the communication mode by using a JSON format;
configuring a request service and a response service according to the communication mode and the data transmission type, and constructing an interface routing information configuration service;
and packaging the sending request service, the receiving response service and the interface routing information configuration service to obtain the proxy generation service.
Optionally, the generating the service by using the pre-constructed proxy, configuring the interface information, and obtaining the proxy service includes:
invoking a pre-constructed proxy generation service, and automatically generating a proxy service class;
analyzing the interface information, and filling the analysis result into the proxy service class by using the interface route information configuration service in the proxy generation service to obtain the proxy service.
Optionally, the calling request for the target calling service by using the proxy service includes:
constructing request information by using the proxy service;
and transmitting the request information to the target calling service by using a transmission request service in the proxy service.
Optionally, an HTTP interface capable of customizing paths and parameters may be further configured in the remote procedure call framework.
In order to solve the above-mentioned problem, the present invention also provides a service invocation apparatus of adaptive architecture, the apparatus comprising:
the service information acquisition module is used for acquiring basic information of a target call service, and carrying out structural processing on the basic information to obtain a service statement annotation table;
the annotation table analysis module is used for analyzing the service statement annotation table by utilizing a pre-constructed remote procedure call frame and generating interface information of the target call service;
the proxy service construction module is used for generating a service by utilizing the pre-constructed proxy, configuring the interface information and obtaining the proxy service;
and the service calling module is used for calling the target calling service by utilizing the proxy service and feeding back a response result generated by the target calling service to the pre-constructed client.
In order to solve the above-mentioned problems, the present invention also provides an electronic apparatus including:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the service invocation method of the adaptive architecture described above.
In order to solve the above-mentioned problems, the present invention also provides a computer-readable storage medium having stored therein at least one computer program that is executed by a processor in an electronic device to implement the service invocation method of the adaptive architecture described above.
According to the embodiment of the invention, the Service statement annotation table is added in the Service layer of each Service, so that remote procedure call among each Service in the system is supported; the invention automatically generates the corresponding HTTP protocol interface by configuring the proxy service, wherein the proxy service comprises an interface routing information configuration service, a sending request service and a receiving response service, the sending request service and the receiving response service are responsible for connection communication with the called service, and the interface routing information configuration service can automatically generate interface routing information according to key information in the annotation of the called service, thereby realizing the adaptive change of the interface called by the called service. Therefore, the service call method, the device, the equipment and the storage medium with the self-adaptive structure provided by the embodiment of the invention can reduce code redundancy through service annotation in a remote procedure call scene, and improve service call efficiency by realizing automatic generation of call interfaces between internal and external services.
Drawings
FIG. 1 is a flowchart of a service invocation method of an adaptive architecture according to an embodiment of the present invention;
FIG. 2 is a detailed flowchart of a step in a service invocation method of an adaptive architecture according to an embodiment of the present invention;
FIG. 3 is a detailed flowchart illustrating a step in a service invocation method of an adaptive architecture according to an embodiment of the present invention;
FIG. 4 is a functional block diagram of a service invocation apparatus with an adaptive architecture according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device implementing the service invocation method with adaptive structure according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
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 scope of the invention.
The embodiment of the application provides a service calling method of an adaptive structure. In the embodiment of the present application, the execution body of the service invocation method of the adaptive structure includes, but is not limited to, at least one of a server, a terminal, and an electronic device capable of being configured to execute the method provided in the embodiment of the present application. In other words, the service invocation method of the adaptive structure may be performed by software or hardware installed in the terminal device or the server device, and the software may be a blockchain platform. The service end includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. The server may be an independent server, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
Referring to fig. 1, a flowchart of a service invocation method with an adaptive structure according to an embodiment of the present invention is shown. In this embodiment, the service invocation method of the adaptive structure includes:
s1, acquiring basic information of a target call service, and carrying out structural processing on the basic information to obtain a service statement annotation table.
In the embodiment of the invention, the target calling service can be each micro service under a general system, and can also be a third party service outside the system.
In detail, referring to fig. 2, in the embodiment of the present invention, the obtaining basic information of the target call service and performing a structuring process on the basic information to obtain a service statement annotation table includes:
s11, declaring a target annotation and defining the attribute of the target annotation;
s12, marking the target annotation on the target call service, and acquiring basic information in the class of the target call service by utilizing a reflection mechanism;
and S13, screening and filling the basic information according to the attribute of the target annotation to obtain a service statement annotation table.
In the embodiment of the invention, a set of notes for declaring and customizing the RPC service detailed information is customized for each target calling service. In a distributed system, service a may use a framework or tool to generate and manage detailed information of RPC services, including information on interfaces, methods, parameters, etc. of service a. For ease of use and configuration, service A may customize a set of annotations to tag and declare this detailed information for parsing and processing in a framework or tool.
Specifically, the embodiment of the invention performs declaration operation on the target call service, for example, a Servie layer in the service A, which can expose the service externally, by using the @ interface keyword, so as to obtain a target annotation @ CmdQryInvoke, and configures the attribute of the target annotation, for example, name, attribute, default value and the like. The class of service a is then marked behind the @ CmdQryInvoke using annotations.
According to the embodiment of the invention, the information of each class in the service A is extracted through a reflection mechanism to obtain basic information, and then data filling and deleting are carried out according to the requirements of the information such as the attribute in the target annotation to obtain the service statement annotation table.
S2, analyzing the service statement annotation table by utilizing the pre-constructed remote procedure call frame, and generating interface information of the target call service.
Wherein the remote procedure call framework is a type of request for services from a remote computer program over a network.
In detail, referring to fig. 3, in the embodiment of the present invention, the parsing the service statement annotation table by using the pre-constructed remote procedure call framework to generate the interface information of the target call service includes:
s21, inquiring whether each class of the target call service contains annotation marks or not by utilizing traversal inquiry service in a pre-constructed remote procedure call framework;
and returning to the operation step of S21 after the annotation mark is not detected, and inquiring other classes of the target call service.
S22, acquiring a service statement annotation table corresponding to the target annotation mark when the annotation mark is detected;
s23, analyzing each field information in the service statement annotation table, filling the information into a preset data structure, and respectively obtaining interface routing information and service information;
and S24, the interface route information and the service information are output in a gathering way, and the interface information of the target calling service is obtained.
In the embodiment of the invention, a tool class for service discovery and routing is compiled, annotation information of marked services and interfaces is obtained through a reflection mechanism, and the annotation information is converted into routing information and service information. Specifically, all classes are traversed by the reflection mechanism and checked for @ CmdQryInvoke annotations on the class. If so, metadata in the service statement annotation table, such as routing paths, service names, version numbers, and the like, are obtained. Among other things, these metadata may be categorized, such as service information: service name and version number, and routing information: and (3) routing paths.
In the embodiment of the invention, the data structures of the interface routing information and the service information can be configured first, and then the data can be filled after the routing information and the service information are analyzed, so that the interface routing information and the service information are obtained. In the embodiment of the invention, the interface route information and the service information are unified as interface information.
S3, generating service by utilizing the pre-constructed proxy, and configuring the interface information to obtain the proxy service.
In detail, in the embodiment of the present invention, the generating a service by using a pre-constructed proxy, configuring the interface information, and obtaining a proxy service includes:
invoking a pre-constructed proxy generation service, and automatically generating a proxy service class;
analyzing the interface information, and filling the analysis result into the proxy service class by using the interface route information configuration service in the proxy generation service to obtain the proxy service.
In the embodiment of the invention, the proxy generation service is a two-way package in the form of SDK, and when a calling program is started, the class containing @ CmdQryInvoke annotation is scanned, and a proxy service class remotely called by httpClient is automatically generated for the class.
In addition, in the embodiment of the present invention, before the service is generated by using the pre-constructed proxy, the method further includes:
configuring a communication mode for transmitting information between each service by using an HTTP protocol;
configuring a data transmission type in the communication mode by using a JSON format;
configuring a request service and a response service according to the communication mode and the data transmission type, and constructing an interface routing information configuration service;
and packaging the sending request service, the receiving response service and the interface routing information configuration service to obtain the proxy generation service.
In the embodiment of the invention, the bottom services in the framework communicate by using the HTTP protocol, and the communication efficiency is improved by utilizing the characteristics of persistent connection, multiplexing, compression and the like of HTTP. In addition, the embodiment of the invention also supports a replacement protocol so as to adapt to different requirements, for example: an HTTP interface may also be configured that can customize paths and parameters.
The embodiment framework of the invention uses the main stream JSON format as a standard of data transmission so as to ensure the readability and interoperability of data, and a developer can use a JSON object or a character string to transfer parameters and results.
In addition, the proxy generation service needs to automatically generate a request and send the request to the target call service, so that an automatic interface route information configuration service, a request sending service and a response receiving service of data transmission need to be constructed, and finally, each service is encapsulated through an encapsulation tool to obtain a proxy generation service.
S4, calling the target calling service by using the proxy service, and feeding back a response result generated by the target calling service to the pre-constructed client.
In detail, in an embodiment of the present invention, the performing, by using the proxy service, a call request for the target call service includes:
constructing request information by using the proxy service;
and transmitting the request information to the target calling service by using a transmission request service in the proxy service.
In the embodiment of the invention, the proxy service can construct a request object according to the request information in the interface information, such as an interface and a method. The request object may contain called interface information, method names, parameters, etc. The proxy service then sends the built request object to the invoked service, which can be accomplished by sending the request service.
After the called service receives the request, the called service finds out the corresponding interface and method according to the received request, executes the corresponding logic, generates a response result, returns the response result to the proxy service, and finally feeds back the response result to the client by the proxy service.
According to the embodiment of the invention, the Service statement annotation table is added in the Service layer of each Service, so that remote procedure call among each Service in the system is supported; the invention automatically generates the corresponding HTTP protocol interface by configuring the proxy service, wherein the proxy service comprises an interface routing information configuration service, a sending request service and a receiving response service, the sending request service and the receiving response service are responsible for connection communication with the called service, and the interface routing information configuration service can automatically generate interface routing information according to key information in the annotation of the called service, thereby realizing the adaptive change of the interface called by the called service. Therefore, the service call method with the self-adaptive structure provided by the embodiment of the invention can reduce code redundancy through service annotation in a remote procedure call scene, and improve service call efficiency by realizing automatic generation of call interfaces between internal and external services.
Fig. 4 is a functional block diagram of a service call device with an adaptive structure according to an embodiment of the present invention.
The service invocation apparatus 100 of the adaptive structure of the present invention may be installed in an electronic device. The service invocation apparatus 100 of the adaptive structure may include a service information acquisition module 101, an annotation table analysis module 102, a proxy service construction module 103, and a service invocation module 104 according to the implemented functions. The module of the invention, which may also be referred to as a unit, refers to a series of computer program segments, which are stored in the memory of the electronic device, capable of being executed by the processor of the electronic device and of performing a fixed function.
In the present embodiment, the functions concerning the respective modules/units are as follows:
the service information acquisition module 101 is configured to acquire basic information of a target call service, and perform structural processing on the basic information to obtain a service statement annotation table;
the annotation table analyzing module 102 is configured to analyze the service statement annotation table by using a pre-constructed remote procedure call framework, and generate interface information of the target call service;
the proxy service construction module 103 is configured to utilize the pre-constructed proxy generation service to configure the interface information to obtain a proxy service;
the service calling module 104 is configured to make a call request to the target calling service by using the proxy service, and feed back a response result generated by the target calling service to the pre-constructed client.
In detail, each module in the service invocation apparatus 100 with an adaptive structure in the embodiment of the present application adopts the same technical means as the service invocation method with an adaptive structure described in fig. 1 to 3, and can produce the same technical effects, which is not described herein.
Fig. 5 is a schematic structural diagram of an electronic device 1 implementing a service invocation method with adaptive structure according to an embodiment of the present invention.
The electronic device 1 may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program, such as an adaptively structured service invocation program, stored in the memory 11 and being executable on the processor 10.
The processor 10 may be formed by an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be formed by a plurality of integrated circuits packaged with the same function or different functions, including one or more central processing units (Central Processing Unit, CPU), a microprocessor, a digital processing chip, a graphics processor, a combination of various control chips, and so on. The processor 10 is a Control Unit (Control Unit) of the electronic device 1, connects respective parts of the entire electronic device using various interfaces and lines, executes various functions of the electronic device and processes data by running or executing programs or modules (for example, executing service calling programs of an adaptive architecture, etc.) stored in the memory 11, and calling data stored in the memory 11.
The memory 11 includes at least one type of readable storage medium including flash memory, a removable hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, such as a mobile hard disk of the electronic device. The memory 11 may in other embodiments also be an external storage device of the electronic device, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only for storing application software installed in an electronic device and various types of data, such as codes of service invoker programs of an adaptive structure, but also for temporarily storing data that has been output or is to be output.
The communication bus 12 may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. The bus is arranged to enable a connection communication between the memory 11 and at least one processor 10 etc.
The communication interface 13 is used for communication between the electronic device 1 and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), typically used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), or alternatively a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device and for displaying a visual user interface.
Fig. 5 shows only an electronic device with components, it being understood by a person skilled in the art that the structure shown in fig. 5 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or may combine certain components, or may be arranged in different components.
For example, although not shown, the electronic device 1 may further include a power source (such as a battery) for supplying power to each component, and preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management, and the like are implemented through the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The electronic device 1 may further include various sensors, bluetooth modules, wi-Fi modules, etc., which will not be described herein.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
The service invocation program of the adaptive architecture stored in the memory 11 of the electronic device 1 is a combination of instructions that, when executed in the processor 10, enable:
basic information of a target call service is obtained, and the basic information is structured to obtain a service statement annotation table;
analyzing the service statement annotation table by utilizing a pre-constructed remote procedure call frame to generate interface information of the target call service;
configuring the interface information by utilizing a pre-constructed proxy generation service to obtain a proxy service;
and calling the target calling service by using the proxy service, and feeding back a response result generated by the target calling service to the pre-constructed client.
In particular, the specific implementation method of the above instructions by the processor 10 may refer to the description of the relevant steps in the corresponding embodiment of the drawings, which is not repeated herein.
Further, the modules/units integrated in the electronic device 1 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as separate products. The computer readable storage medium may be volatile or nonvolatile. For example, the computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM).
The present invention also provides a computer readable storage medium storing a computer program which, when executed by a processor of an electronic device, can implement:
basic information of a target call service is obtained, and the basic information is structured to obtain a service statement annotation table;
analyzing the service statement annotation table by utilizing a pre-constructed remote procedure call frame to generate interface information of the target call service;
configuring the interface information by utilizing a pre-constructed proxy generation service to obtain a proxy service;
and calling the target calling service by using the proxy service, and feeding back a response result generated by the target calling service to the pre-constructed client.
In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
The embodiment of the application can acquire and process the related data based on the artificial intelligence technology. Among these, artificial intelligence (Artificial Intelligence, AI) is the theory, method, technique and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend and extend human intelligence, sense the environment, acquire knowledge and use knowledge to obtain optimal results.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the system claims can also be implemented by means of software or hardware by means of one unit or means. The terms first, second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (10)

1. A service invocation method of an adaptive architecture, the method comprising:
basic information of a target call service is obtained, and the basic information is structured to obtain a service statement annotation table;
analyzing the service statement annotation table by utilizing a pre-constructed remote procedure call frame to generate interface information of the target call service;
configuring the interface information by utilizing a pre-constructed proxy generation service to obtain a proxy service;
and calling the target calling service by using the proxy service, and feeding back a response result generated by the target calling service to the pre-constructed client.
2. The service invocation method of the adaptive architecture according to claim 1, wherein the obtaining basic information of the target invocation service and performing a structuring process on the basic information to obtain a service statement annotation table includes:
declaring a target annotation and defining an attribute of the target annotation;
marking the target annotation to the target calling service, and acquiring basic information in the class of the target calling service by utilizing a reflection mechanism;
and screening and filling the basic information according to the attribute of the target annotation to obtain a service statement annotation table.
3. The service invocation method of the adaptive architecture of claim 1, wherein the parsing the service statement annotation table using the pre-built remote procedure invocation framework generates interface information for the target invocation service, comprising:
inquiring whether each class of the target call service contains annotation marks or not by utilizing traversal inquiry service in a pre-constructed remote procedure call framework;
when the annotation mark is detected, a service statement annotation table corresponding to the target annotation mark is obtained;
analyzing each field information in the service statement annotation table, filling the field information into a preset data structure, and respectively obtaining interface routing information and service information;
and carrying out aggregate output on the interface route information and the service information to obtain the interface information of the target calling service.
4. The service invocation method of the adaptive architecture of claim 1, wherein prior to said generating a service using the pre-constructed proxy, the method further comprises:
configuring a communication mode for transmitting information between each service by using an HTTP protocol;
configuring a data transmission type in the communication mode by using a JSON format;
configuring a request service and a response service according to the communication mode and the data transmission type, and constructing an interface routing information configuration service;
and packaging the sending request service, the receiving response service and the interface routing information configuration service to obtain the proxy generation service.
5. The service invocation method of the adaptive architecture of claim 1, wherein the generating a service using a pre-constructed proxy, configuring the interface information, and obtaining a proxy service, comprises:
invoking a pre-constructed proxy generation service, and automatically generating a proxy service class;
analyzing the interface information, and filling the analysis result into the proxy service class by using the interface route information configuration service in the proxy generation service to obtain the proxy service.
6. The service invocation method of the adaptive architecture of claim 1, wherein said invoking the call request for the target invocation service with the proxy service comprises:
constructing request information by using the proxy service;
and transmitting the request information to the target calling service by using a transmission request service in the proxy service.
7. The service invocation method of the adaptive architecture of claim 1, wherein the remote procedure invocation framework further has a custom path and parameter HTTP interface configured therein.
8. A service invocation apparatus of an adaptive architecture, the apparatus comprising:
the service information acquisition module is used for acquiring basic information of a target call service, and carrying out structural processing on the basic information to obtain a service statement annotation table;
the annotation table analysis module is used for analyzing the service statement annotation table by utilizing a pre-constructed remote procedure call frame and generating interface information of the target call service;
the proxy service construction module is used for generating a service by utilizing the pre-constructed proxy, configuring the interface information and obtaining the proxy service;
and the service calling module is used for calling the target calling service by utilizing the proxy service and feeding back a response result generated by the target calling service to the pre-constructed client.
9. An electronic device, the electronic device comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the service invocation method of the adaptive architecture of any of claims 1 to 7.
10. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the service invocation method of the adaptive architecture of any of claims 1 to 7.
CN202311599743.0A 2023-11-27 2023-11-27 Service calling method, device, equipment and storage medium of self-adaptive structure Pending CN117632538A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311599743.0A CN117632538A (en) 2023-11-27 2023-11-27 Service calling method, device, equipment and storage medium of self-adaptive structure

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311599743.0A CN117632538A (en) 2023-11-27 2023-11-27 Service calling method, device, equipment and storage medium of self-adaptive structure

Publications (1)

Publication Number Publication Date
CN117632538A true CN117632538A (en) 2024-03-01

Family

ID=90017563

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311599743.0A Pending CN117632538A (en) 2023-11-27 2023-11-27 Service calling method, device, equipment and storage medium of self-adaptive structure

Country Status (1)

Country Link
CN (1) CN117632538A (en)

Similar Documents

Publication Publication Date Title
AU2002258640A1 (en) Method and apparatus for intelligent data assimilation
EP1435047A2 (en) Method and apparatus for intelligent data assimilation
CN103092602B (en) software development kit
CN113704665B (en) Dynamic service release method and device, electronic equipment and storage medium
CN111061464B (en) Analysis code generation method, device, equipment and storage medium
CN110647316B (en) Method and device for generating universal business object, computer equipment and storage medium
CN110321283A (en) Interface testing case generation method, device, computer installation and storage medium
CN1662011A (en) System and method for building component applications using metadata defined mapping between message and data domains
CN113890712A (en) Data transmission method and device, electronic equipment and readable storage medium
CN115168166A (en) Method, device and equipment for recording business data change and storage medium
CN112650804B (en) Big data access method, device, system and storage medium
CN113626512A (en) Data processing method, device, equipment and readable storage medium
CN111338717B (en) Interface calling method, application program upgrading method, server and client
CN104378393A (en) Resource sharing method and corresponding device
CN115022397B (en) Interface parameter simplifying method and device, electronic equipment and storage medium
US11803786B2 (en) Enterprise integration platform
CN117632538A (en) Service calling method, device, equipment and storage medium of self-adaptive structure
CN113296987B (en) Interface calling method and device for calling module, computer equipment and storage medium
CN114844693A (en) Lightweight communication data encryption method, device, equipment and storage medium
CN112540839B (en) Information changing method, device, electronic equipment and storage medium
CN113452785B (en) Service access method and device based on offline resources, electronic equipment and medium
CN113778447B (en) Service compatibility method and device of front-end system, electronic equipment and storage medium
CN113032168B (en) Data transmission rate dynamic adjustment method and device, electronic equipment and storage medium
CN101145953B (en) Method and system for dynamic debugging of network device management software
KR20160124303A (en) Apparatus and method for providing service

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