CN113176907A - Interface data calling method and device, computer system and readable storage medium - Google Patents

Interface data calling method and device, computer system and readable storage medium Download PDF

Info

Publication number
CN113176907A
CN113176907A CN202110463605.4A CN202110463605A CN113176907A CN 113176907 A CN113176907 A CN 113176907A CN 202110463605 A CN202110463605 A CN 202110463605A CN 113176907 A CN113176907 A CN 113176907A
Authority
CN
China
Prior art keywords
information
configuration
request
interface
target
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
CN202110463605.4A
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.)
Industrial and Commercial Bank of China Ltd ICBC
ICBC Technology Co Ltd
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
ICBC 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 Industrial and Commercial Bank of China Ltd ICBC, ICBC Technology Co Ltd filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110463605.4A priority Critical patent/CN113176907A/en
Publication of CN113176907A publication Critical patent/CN113176907A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The disclosure provides an interface data calling method, which can be used in the technical field of computers or other fields. Wherein, the method comprises the following steps: receiving a request for calling interface data, wherein the request carries request parameter information and identification information of a target interface; responding to the request, and acquiring configuration component information corresponding to the identification information of the target interface, wherein the configuration component information comprises information of a component for calling interface data; and dynamically loading and executing the components based on the configuration component information and the request parameter information. The disclosure also provides an interface data calling apparatus, a computer system, a readable storage medium, and a computer program product.

Description

Interface data calling method and device, computer system and readable storage medium
Technical Field
The present disclosure relates to the field of computer technology or other fields, and more particularly, to an interface data calling method, apparatus, computer system, readable storage medium, and computer program product.
Background
When the system solves the service problem, the system often needs to rely on the interfaces of other multi-party systems to obtain the relevant service information.
In implementing the disclosed concept, the inventors found that there are at least the following problems in the related art: each time a system is updated or a new system is added, additional code development and version release are needed to cooperate with the realization of interface docking with the new system, so that a longer docking period and a longer test period are needed each time, and the requirements of rapid development and docking of the new system at the present stage are not met.
Disclosure of Invention
In view of the above, the present disclosure provides an interface data calling method, an interface data calling apparatus, a computer system, a readable storage medium, and a computer program product.
One aspect of the present disclosure provides an interface data calling method, including:
receiving a request for calling interface data, wherein the request carries request parameter information and identification information of a target interface;
responding to the request, and acquiring configuration component information corresponding to the identification information of the target interface, wherein the configuration component information comprises information of a component for calling interface data; and
based on the configuration component information and the request parameter information, the components are dynamically loaded and executed.
According to the embodiment of the disclosure, the interface data calling method further includes:
constructing a configuration information set, wherein the configuration information set comprises configuration information of at least one interface, the configuration information of each interface in the configuration information set comprises associated configuration parameter information and configuration component information, and the configuration parameter information comprises identification information of the interface;
in response to the request, obtaining configuration component information corresponding to the identification information of the target interface includes:
determining, in response to the request, configuration parameter information corresponding to the identification information of the target interface from the set of configuration information;
and acquiring configuration component information associated with the configuration parameter information based on the configuration parameter information.
According to the embodiment of the disclosure, the interface data calling method further includes:
extracting field information of a target field in the request parameter information;
judging whether the field information of the target field meets a preset condition or not;
under the condition that the field information of the target field meets the preset condition, executing the operation of dynamically loading and executing the component based on the configuration component information and the request parameter information;
and stopping the execution of the interface data calling method under the condition that the field information of the target field does not meet the preset condition.
According to an embodiment of the present disclosure, wherein dynamically loading and executing components based on configuration component information and request parameter information includes:
dynamically loading the component using a reflection mechanism based on the configuration component information;
and executing the service method in the component to obtain target return data.
According to an embodiment of the present disclosure, wherein executing the business method in the component, obtaining the target return data includes:
executing a service method in the assembly to obtain primary return data;
acquiring request return information in the request parameter information;
target return data is determined from the preliminary return data based on the request return information.
According to an embodiment of the present disclosure, the configuration parameter information includes notification means information;
the interface data calling method further comprises the following steps:
and determining a mode for returning the target return data based on the notification mode information, wherein the mode for returning the target return data comprises synchronous return or asynchronous return.
According to the embodiment of the disclosure, the interface data calling method further includes:
receiving an increase request for increasing configuration information of a new interface;
and constructing new configuration information based on the addition request, wherein the new configuration information comprises new configuration parameter information and new configuration component information, and the new configuration parameter information comprises identification information of the new interface.
Another aspect of the present disclosure provides an interface data calling apparatus, including:
the receiving module is used for receiving a request for calling interface data, wherein the request carries request parameter information and identification information of a target interface;
the response module is used for responding to the request and acquiring configuration component information corresponding to the identification information of the target interface, wherein the configuration component information comprises information of a component for calling interface data; and
and the loading module is used for dynamically loading and executing the components based on the configuration component information and the request parameter information.
Yet another aspect of the present disclosure provides a computer system comprising:
one or more processors;
a memory for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the interface data call method described above.
Yet another aspect of the present disclosure provides a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to implement the interface data calling method described above.
Yet another aspect of the present disclosure provides a computer program product comprising a computer program comprising computer executable instructions for implementing the interface data call method described above when executed.
According to the embodiment of the disclosure, the method comprises the steps of receiving a request for calling interface data, wherein the request carries request parameter information and identification information of a target interface; responding to the request, and acquiring configuration component information corresponding to the identification information of the target interface, wherein the configuration component information comprises information of a component for calling interface data; the technical means of dynamically loading and executing the components based on the configuration component information and the request parameter information is utilized to dynamically acquire the configuration component information and dynamically load and execute the components to call interface data, so that the components and service codes are decoupled, and the service codes used for interface butt joint do not need to be modified or updated according to system updating or new system addition; therefore, the technical problems of low processing efficiency and high cost caused by the fact that a large amount of repeated codes are required to be developed in the interface corresponding process of the system in the prior art are at least partially solved, and the technical effects of improving the convenience and the stability of system use, saving development cost and time and improving efficiency are further achieved.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments of the present disclosure with reference to the accompanying drawings, in which:
FIG. 1 schematically illustrates a system architecture of interface data call methods and apparatus that may be implemented with embodiments of the present disclosure;
FIG. 2 schematically illustrates a flow diagram of an interface data call method according to an embodiment of the disclosure;
FIG. 3 schematically shows a flow diagram for construction of a set of configuration information according to an embodiment of the disclosure;
FIG. 4 schematically illustrates a flow diagram of an interface data call method according to another embodiment of the present disclosure;
FIG. 5 schematically illustrates a block diagram of an interface data invocation device according to an embodiment of the present disclosure; and
FIG. 6 schematically illustrates a block diagram of a computer system suitable for implementing the interface data call method according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a convention analogous to "A, B or at least one of C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B or C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
At present, most systems have the condition of mutual interface calling with other multi-party systems in the daily development and operation processes. In existing systems, each time a new system is docked, additional code development and version releases are required to match the docking interface of the new system. The method has the advantages of long docking period and test period for each docking, long time consumption, high development and docking cost and incapability of meeting the requirements of rapid development and docking at the present stage.
The embodiment of the disclosure provides an interface data calling method. The method comprises the following steps: receiving a request for calling interface data, wherein the request carries request parameter information and identification information of a target interface; responding to the request, and acquiring configuration component information corresponding to the identification information of the target interface, wherein the configuration component information comprises information of a component for calling interface data; and dynamically loading and executing the components based on the configuration component information and the request parameter information.
By adopting the interface data calling method provided by the embodiment of the disclosure, the configuration component information corresponding to the identification information of the target interface is dynamically acquired based on the request parameter information in the request and the identification information of the target interface, and the component is dynamically loaded and executed based on the configuration component information and the request parameter information. By dynamically acquiring configuration component information and dynamically loading and executing the component calling interface data, the component and the service code are decoupled, the problem of development of a large amount of repeated codes in the interface corresponding process of the conventional system is solved, and the service code for interface docking is not required to be modified or updated according to system updating or new system addition. Therefore, the interface data calling method provided by the embodiment of the disclosure can improve the convenience and stability of system use, save development cost and time, and improve efficiency.
FIG. 1 schematically illustrates an exemplary system architecture 100 in which methods and apparatus for interface data invocation may be applied, according to an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired and/or wireless communication links, and so forth.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as a shopping-like application, a web browser application, a search-like application, an instant messaging tool, a mailbox client, and/or social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (for example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and perform other processing on the received data such as the user request, and feed back a processing result (e.g., a webpage, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the interface data calling method provided by the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the interface data calling apparatus provided by the embodiment of the present disclosure may be generally disposed in the server 105. The interface data calling method provided by the embodiment of the present disclosure may also be executed by a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the interface data invoking device provided by the embodiment of the present disclosure may also be disposed in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Alternatively, the interface data calling method provided by the embodiment of the present disclosure may also be executed by the terminal device 101, 102, or 103, or may also be executed by another terminal device different from the terminal device 101, 102, or 103. Accordingly, the interface data calling apparatus provided by the embodiment of the present disclosure may also be disposed in the terminal device 101, 102, or 103, or in another terminal device different from the terminal device 101, 102, or 103.
For example, the request for invoking the interface data may be originally stored in any of the terminal devices 101, 102, or 103 (e.g., the terminal device 101, but not limited thereto), or stored on an external storage device and may be imported into the terminal device 101. Then, the terminal device 101 may send the request to other terminal devices, servers, or server clusters, and execute the interface data calling method provided by the embodiment of the present disclosure by the other servers, or server clusters receiving the request.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Fig. 2 schematically shows a flow chart of an interface data invocation method according to an embodiment of the present disclosure.
As shown in fig. 2, the method includes operations S201 to S203.
In operation S201, a request for invoking interface data is received, where the request carries request parameter information and identification information of a target interface.
According to the embodiment of the present disclosure, the request parameter information may be, but is not limited to, a request parameter name, an input parameter format, the number of input parameters and a return parameter format, the number of return parameters, a request mode, and the like.
According to the embodiment of the present disclosure, the identification information of the target interface may be an identification number (ID) of the target interface, but is not limited thereto, as long as it is information representing a unique identification of the target interface, such as a two-dimensional code or a barcode.
In operation S202, in response to the request, configuration component information corresponding to the identification information of the target interface is acquired, wherein the configuration component information includes information for calling a component of the interface data.
According to the embodiment of the disclosure, the identification information of the interface can be associated with the corresponding configuration component information in advance, and in the case of responding to the request, the configuration component information associated with the interface is acquired based on the identification information of the target interface.
In operation S203, a component is dynamically loaded and executed based on the configuration component information and the request parameter information.
According to the embodiment of the disclosure, based on the configuration component information, the component corresponding to the configuration component information can be dynamically loaded, and based on the request parameter information, the execution component calls the interface data.
According to the embodiment of the disclosure, by using the interface data calling method of the embodiment of the disclosure, under the condition of calling the interface data, the configuration component information can be dynamically acquired, and the interface data can be called by dynamically loading and executing the component, so that the corresponding function is realized. In the embodiment of the disclosure, only the components need to be designed in advance, and extra development codes and version release are not needed, so that the problems of system performance and stability caused by high-frequency system release due to updating of a docking system or addition of a new system are reduced, and logic modification and repair are more convenient.
The method shown in fig. 2 is further described below with reference to fig. 3 to 4 in conjunction with specific embodiments.
According to an embodiment of the present disclosure, the interface data calling method may further include an operation of constructing a configuration information set.
According to an embodiment of the present disclosure, the configuration information set includes configuration information of at least one interface, wherein the configuration information of each interface in the configuration information set includes associated configuration parameter information and configuration component information, wherein the configuration parameter information includes identification information of the interface.
Fig. 3 schematically shows a schematic diagram of constructing a set of configuration information according to an embodiment of the present disclosure.
As shown in fig. 3, the construction of the configuration information set may include operations S301 to S302.
In operation S301, a configuration information set is constructed.
According to the embodiment of the disclosure, the configuration parameter information and the configuration component information can be configured and constructed through a Web interface. And associating and generating configuration information of the interface. The plurality of configuration information forms a configuration information set.
In operation S302, a set of configuration information is stored in a database.
According to the embodiment of the disclosure, after the configuration information set is constructed, the configuration information in the configuration information set can be stored in the database and permanently stored. So as to directly acquire the configuration component information corresponding to the identification information of the target interface from the database when the operation of interface data calling is executed.
According to an embodiment of the present disclosure, obtaining configuration component information corresponding to the identification information of the target interface in response to the request may specifically include the following operations.
According to an embodiment of the present disclosure, for example, in response to a request, configuration parameter information corresponding to identification information of a target interface is determined from a set of configuration information; and acquiring configuration component information associated with the configuration parameter information based on the configuration parameter information.
According to the embodiment of the disclosure, the interface data can be called on the basis of constructing the configuration information set so as to dynamically acquire the configuration component information corresponding to the identification information of the target interface.
According to the embodiment of the disclosure, the interface data calling method provided by the embodiment of the disclosure not only dynamically loads and executes the components, but also dynamically acquires the configuration component information associated with the configuration parameter information through the configuration information set, thereby reducing the development of repeated codes.
According to an embodiment of the present disclosure, the interface data call method may also perform the following operations with a new system addition.
For example, an add request to add configuration information for a new interface is received; and constructing new configuration information based on the addition request, wherein the new configuration information comprises new configuration parameter information and new configuration component information, and the new configuration parameter information comprises identification information of the new interface.
According to the embodiment of the present disclosure, it should be noted that the new configuration information may be added to the configuration information set as an element in the configuration information set, so that in the case of taking the new interface as the target interface, in response to a request, the new configuration parameter information corresponding to the identification information of the target interface is determined from the configuration information set, and then the new configuration component information associated with the new configuration parameter information is obtained based on the new configuration parameter information. It should be further noted that the new configuration component information corresponds to the new component. The component is designed for adding new interfaces, i.e. adding new dockees, and can be a jar package. The component only needs to develop a corresponding processing method and pack the processing method into a corresponding jar packet, and extra development codes and version release are not needed.
According to the embodiment of the disclosure, new configuration information is constructed by using the embodiment of the disclosure, and corresponding functions can be realized only by designing and developing corresponding jar packages. The logic modification and repair are more convenient, the system performance problem caused by frequent versions of the system is reduced, and developers only need to pay attention to the processing logic in the docking process.
According to an embodiment of the present disclosure, the interface data calling method may further include an operation of performing security verification on the request parameter information.
For example, extracting field information of a target field in the request parameter information; judging whether the field information of the target field meets a preset condition or not; under the condition that the field information of the target field meets the preset condition, executing the operation of dynamically loading and executing the component based on the configuration component information and the request parameter information; and stopping the execution of the interface data calling method under the condition that the field information of the target field does not meet the preset condition.
According to an embodiment of the present disclosure, one or more target fields in the request parameter information are extracted. The more the number and types of target field extraction, the more the security verification is facilitated.
According to the embodiment of the present disclosure, the field information of the target field in the configuration parameter information in the configuration information set may be used as a preset condition, i.e., a verification standard. Matching field information of a target field in request parameter information in the request with field information of a target field in configuration parameter information in a configuration information set, and determining that the request is an executable request meeting the standard under the condition that the matching is successful, namely the field information of the target field meets a preset condition. Under the condition that the field information of the target field in the request parameter information in the request is not matched with the field information of the target field in the configuration parameter information in the configuration information set, namely the field information of the target field does not meet the preset condition, the request can be determined to be a nonstandard request, and the execution of the interface data calling method can be stopped if the request has a safety risk.
According to the embodiment of the disclosure, based on the verification operation, the identity verification is favorably carried out on the request, the problems or phenomena of malicious calling or information leakage and the like are avoided, and the safety and the stability of interface data calling are improved.
According to embodiments of the present disclosure, among other things, components may be dynamically loaded and executed using a reflection mechanism based on configuration component information and request parameter information. Specifically, the components may be dynamically loaded using a reflection mechanism based on configuration component information; and executing the service method in the component to obtain target return data.
According to the embodiment of the disclosure, the component can be a jar packet, the jar packet associated with the configuration component information is dynamically loaded based on the configuration component information and the request parameter information, and a method in the jar packet is executed by using a reflection mechanism of Java.
According to embodiments of the present disclosure, the reflection mechanism may load a class (class) whose name is only known at runtime, learn its complete construct, and generate its object entity or evoke its method.
According to the embodiment of the disclosure, the reflection mechanism of the embodiment of the disclosure is used for dynamically loading and executing the component, so that the component can be randomly plugged or replaced, and the component is decoupled from the service code, thereby realizing the effect of flexible loading and execution.
According to the embodiment of the present disclosure, it should be noted that the interface data acquired by using the interface data calling method provided by the embodiment of the present disclosure does not have target return data, and may also include other non-target return data. In the embodiment of the present disclosure, the target return data may be determined from the called interface data, and only the target return data is returned. For example, a business method in the component is executed to obtain preliminary return data; acquiring request return information in the request parameter information; and determining target return data from the preliminary return data based on the request return information.
According to the embodiment of the disclosure, by using the interface data calling method of the embodiment of the disclosure, target return data can be accurately provided based on request return information in the request parameter information, and the method is more targeted.
According to an embodiment of the present disclosure, the configuration parameter information includes notification means information.
According to an embodiment of the present disclosure, the interface data call method may further determine a manner of returning the target return data, such as synchronously returning or asynchronously returning the target return data, based on the notification manner information in the configuration parameter information.
According to the embodiment of the disclosure, the target return data is synchronously returned to the corresponding interface terminal after the target return data is called.
According to the embodiment of the disclosure, the target return data is asynchronously returned to the corresponding interface end after the target return data is called and other operations are possibly executed. But is not limited to this and it is also possible to return the target return data to the other corresponding interface end.
By using the interface data calling method of the embodiment of the disclosure, the target return data is flexibly returned, the return modes are various, the method can adapt to different modes, and the application range is large.
Fig. 4 schematically shows a flow chart of an interface data call method according to another embodiment of the present disclosure.
As shown in fig. 4, the construction of the configuration information set may include operations S401 to S405.
In operation S401, a request for calling interface data is received.
In operation S402, in response to the request, configuration component information and configuration parameter information corresponding to the identification information of the target interface in the configuration information set are acquired.
In operation S403, field information of a target field in the request parameter information is extracted and verified.
According to an embodiment of the present disclosure, field information of a target field in request parameter information may be verified based on configuration parameter information.
In operation S404, in case that the field information of the target field satisfies a preset condition, a component is dynamically loaded and executed based on the configuration component information and the request parameter information.
In operation S405, in the case where the field information of the target field does not satisfy the preset condition, the execution of the interface data calling method is stopped.
According to the embodiment of the disclosure, the interface data calling method provided by the embodiment of the disclosure solves the problem of development of a large amount of repeated codes in the interface docking process of the existing system, and enhances the readability of the system; in addition, the version updating frequency of the system is reduced, the interface does not depend on system updating and releasing in the butt joint process, and logic modification and repair are more convenient; and thirdly, the problems of system performance and stability caused by frequent edition sending of the system are reduced, and developers only need to pay attention to processing logic in the butt joint process.
Fig. 5 schematically shows a block diagram of an interface data invocation device according to an embodiment of the present disclosure.
As shown in fig. 5, the interface data calling apparatus 500 includes a receiving module 501, a responding module 502, and a loading module 503.
A receiving module 501, configured to receive a request for invoking interface data, where the request carries request parameter information and identification information of a target interface;
a response module 502, configured to, in response to the request, obtain configuration component information corresponding to the identification information of the target interface, where the configuration component information includes information of a component used to invoke interface data; and
and a loading module 503, configured to dynamically load and execute the component based on the configuration component information and the request parameter information.
According to the embodiment of the disclosure, the dynamic acquisition of configuration component information and the dynamic loading and execution of component calling interface data of the embodiment of the disclosure are utilized to decouple the component from the service code, so that the problem of development of a large amount of repeated codes in the interface docking process of the conventional system is solved, and the service code used for interface docking is not required to be modified or updated according to system updating or new system addition. Therefore, the convenience and the stability of the system use are improved, the development cost and time are saved, and the efficiency is improved.
According to an embodiment of the present disclosure, the interface data invoking device 500 further includes an information set constructing module.
The information set constructing module is used for constructing a configuration information set, wherein the configuration information set comprises configuration information of at least one interface, the configuration information of each interface in the configuration information set comprises associated configuration parameter information and configuration component information, and the configuration parameter information comprises identification information of the interface.
According to an embodiment of the present disclosure, the response module 502 includes a response unit and a first obtaining unit.
A response unit, configured to determine, in response to the request, configuration parameter information corresponding to the identification information of the target interface from the configuration information set;
the first acquisition unit is used for acquiring the configuration component information associated with the configuration parameter information based on the configuration parameter information.
According to the embodiment of the present disclosure, the interface data calling apparatus 500 further includes an extracting module and a determining module.
The extraction module is used for extracting field information of a target field in the request parameter information;
the judging module is used for judging whether the field information of the target field meets a preset condition or not; under the condition that the field information of the target field meets the preset condition, executing the operation of dynamically loading and executing the component based on the configuration component information and the request parameter information; and stopping the execution of the interface data calling method under the condition that the field information of the target field does not meet the preset condition.
According to the embodiment of the disclosure, the loading module comprises a dynamic loading submodule and an execution submodule.
The dynamic loading submodule is used for dynamically loading the component by utilizing a reflection mechanism based on the configuration component information;
and the execution submodule is used for executing the service method in the component to obtain target return data.
According to the embodiment of the disclosure, the execution submodule comprises an execution unit, a second acquisition unit and a determination unit.
The execution unit is used for executing the service method in the component to obtain the primary return data;
the second acquisition unit is used for acquiring request return information in the request parameter information;
and the determining unit is used for determining target return data from the preliminary return data based on the request return information.
According to an embodiment of the present disclosure, the configuration parameter information includes notification means information.
According to an embodiment of the present disclosure, the interface data invoking device 500 further includes a return determination module.
And the return determining module is used for determining a mode of returning the target return data based on the notification mode information, wherein the mode of returning the target return data comprises synchronous return or asynchronous return.
According to an embodiment of the present disclosure, the interface data invoking device 500 further includes an addition request receiving module and an information constructing module.
An increase request receiving module, configured to receive an increase request for increasing configuration information of a new interface;
and the information construction module is used for constructing new configuration information based on the addition request, wherein the new configuration information comprises new configuration parameter information and new configuration component information, and the new configuration parameter information comprises identification information of the new interface.
Any number of modules, sub-modules, units, sub-units, or at least part of the functionality of any number thereof according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in any other reasonable manner of hardware or firmware by integrating or packaging a circuit, or in any one of or a suitable combination of software, hardware, and firmware implementations. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the disclosure may be at least partially implemented as a computer program module, which when executed may perform the corresponding functions.
For example, any plurality of the receiving module 501, the responding module 502, and the loading module 503 may be combined and implemented in one module/unit/sub-unit, or any one of the modules/units/sub-units may be split into a plurality of modules/units/sub-units. Alternatively, at least part of the functionality of one or more of these modules/units/sub-units may be combined with at least part of the functionality of other modules/units/sub-units and implemented in one module/unit/sub-unit. According to an embodiment of the present disclosure, at least one of the receiving module 501, the responding module 502, and the loading module 503 may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware by any other reasonable manner of integrating or packaging a circuit, or may be implemented in any one of or a suitable combination of software, hardware, and firmware. Alternatively, at least one of the receiving module 501, the responding module 502, and the loading module 503 may be implemented at least in part as a computer program module, which when executed, may perform a corresponding function.
It should be noted that the interface data calling device portion in the embodiment of the present disclosure corresponds to the interface data calling method portion in the embodiment of the present disclosure, and the description of the interface data calling device portion specifically refers to the interface data calling method portion, which is not described herein again.
Fig. 6 schematically shows a block diagram of a computer system suitable for implementing the above described method according to an embodiment of the present disclosure. The computer system illustrated in FIG. 6 is only one example and should not impose any limitations on the scope of use or functionality of embodiments of the disclosure.
As shown in fig. 6, a computer system 600 according to an embodiment of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. Processor 601 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 601 may also include onboard memory for caching purposes. Processor 601 may include a single processing unit or multiple processing units for performing different actions of a method flow according to embodiments of the disclosure.
In the RAM 603, various programs and data necessary for the operation of the system 600 are stored. The processor 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. The processor 601 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 602 and/or RAM 603. It is to be noted that the programs may also be stored in one or more memories other than the ROM 602 and RAM 603. The processor 601 may also perform various operations of the method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, system 600 may also include an input/output (I/O) interface 605, input/output (I/O) interface 605 also connected to bus 604. The system 600 may also include one or more of the following components connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
According to embodiments of the present disclosure, method flows according to embodiments of the present disclosure may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program, when executed by the processor 601, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples may include, but are not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM 602 and/or RAM 603 described above and/or one or more memories other than the ROM 602 and RAM 603.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the method provided by the embodiments of the present disclosure, when the computer program product is run on an electronic device, the program code being adapted to cause the electronic device to implement the interface data invocation method provided by the embodiments of the present disclosure.
The computer program, when executed by the processor 601, performs the above-described functions defined in the system/apparatus of the embodiments of the present disclosure. The systems, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In one embodiment, the computer program may be hosted on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed in the form of a signal on a network medium, downloaded and installed through the communication section 609, and/or installed from the removable medium 611. The computer program containing program code may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In accordance with embodiments of the present disclosure, program code for executing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, these computer programs may be implemented using high level procedural and/or object oriented programming languages, and/or assembly/machine languages. The programming language includes, but is not limited to, programming languages such as Java, C + +, python, the "C" language, or the like. The program code may execute entirely on the user computing device, partly on the user device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (11)

1. An interface data calling method, comprising:
receiving a request for calling interface data, wherein the request carries request parameter information and identification information of a target interface;
in response to the request, obtaining configuration component information corresponding to the identification information of the target interface, wherein the configuration component information comprises information of a component for calling the interface data; and
and dynamically loading and executing the components based on the configuration component information and the request parameter information.
2. The method of claim 1, further comprising:
constructing a configuration information set, wherein the configuration information set comprises configuration information of at least one interface, wherein the configuration information of each interface in the configuration information set comprises associated configuration parameter information and configuration component information, and the configuration parameter information comprises identification information of the interface;
the obtaining, in response to the request, configuration component information corresponding to the identification information of the target interface includes:
determining, in response to the request, configuration parameter information corresponding to identification information of the target interface from the set of configuration information;
based on the configuration parameter information, obtaining the configuration component information associated with the configuration parameter information.
3. The method of claim 1, further comprising:
extracting field information of a target field in the request parameter information;
judging whether the field information of the target field meets a preset condition or not;
executing the operation of dynamically loading and executing the component based on the configuration component information and the request parameter information under the condition that the field information of the target field meets the preset condition;
and stopping the execution of the interface data calling method under the condition that the field information of the target field does not meet the preset condition.
4. The method of claim 1, wherein the dynamically loading and executing the component based on the configuration component information and the request parameter information comprises:
dynamically loading the component using a reflection mechanism based on the configuration component information;
and executing the service method in the assembly to obtain target return data.
5. The method of claim 4, wherein the executing the business method in the component, obtaining target return data comprises:
executing the service method in the assembly to obtain preliminary return data;
acquiring request return information in the request parameter information;
determining the target return data from the preliminary return data based on the request return information.
6. The method of claim 5, the configuration parameter information comprising notification means information;
the method further comprises the following steps:
and determining a mode for returning the target return data based on the notification mode information, wherein the mode for returning the target return data comprises synchronous return or asynchronous return.
7. The method of claim 2, further comprising:
receiving an increase request for increasing configuration information of a new interface;
constructing new configuration information based on the addition request, wherein the new configuration information comprises new configuration parameter information and new configuration component information, and the new configuration parameter information comprises identification information of the new interface.
8. An interface data invocation apparatus, comprising:
the device comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a request for calling interface data, and the request carries request parameter information and identification information of a target interface;
a response module, configured to, in response to the request, obtain configuration component information corresponding to the identification information of the target interface, where the configuration component information includes information of a component used to call the interface data; and
and the loading module is used for dynamically loading and executing the component based on the configuration component information and the request parameter information.
9. A computer system, comprising:
one or more processors;
a memory for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-7.
10. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to carry out the method of any one of claims 1 to 7.
11. A computer program product comprising a computer program comprising computer executable instructions for implementing the method of any one of claims 1 to 7 when executed.
CN202110463605.4A 2021-04-27 2021-04-27 Interface data calling method and device, computer system and readable storage medium Pending CN113176907A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110463605.4A CN113176907A (en) 2021-04-27 2021-04-27 Interface data calling method and device, computer system and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110463605.4A CN113176907A (en) 2021-04-27 2021-04-27 Interface data calling method and device, computer system and readable storage medium

Publications (1)

Publication Number Publication Date
CN113176907A true CN113176907A (en) 2021-07-27

Family

ID=76926648

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110463605.4A Pending CN113176907A (en) 2021-04-27 2021-04-27 Interface data calling method and device, computer system and readable storage medium

Country Status (1)

Country Link
CN (1) CN113176907A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114840276A (en) * 2022-04-15 2022-08-02 北京百度网讯科技有限公司 Object calling method, device, equipment, storage medium and program product

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101631033A (en) * 2008-07-14 2010-01-20 中兴通讯股份有限公司 Method, system, server and client for calling remote component

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101631033A (en) * 2008-07-14 2010-01-20 中兴通讯股份有限公司 Method, system, server and client for calling remote component

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114840276A (en) * 2022-04-15 2022-08-02 北京百度网讯科技有限公司 Object calling method, device, equipment, storage medium and program product

Similar Documents

Publication Publication Date Title
CN112463729B (en) Data file warehousing method and device, electronic equipment and medium
CN113434241A (en) Page skipping method and device
CN113132400B (en) Business processing method, device, computer system and storage medium
CN112965916B (en) Page testing method, page testing device, electronic equipment and readable storage medium
CN114237651A (en) Installation method and device of cloud native application, electronic equipment and medium
CN116561013B (en) Testing method and device based on target service framework, electronic equipment and medium
CN113176907A (en) Interface data calling method and device, computer system and readable storage medium
CN110717992B (en) Method, apparatus, computer system and readable storage medium for scheduling model
CN112882895A (en) Health examination method, device, computer system and readable storage medium
CN112732547B (en) Service testing method and device, storage medium and electronic equipment
CN111414154A (en) Method and device for front-end development, electronic equipment and storage medium
CN113535565B (en) Interface use case generation method, device, equipment and medium
CN112506781B (en) Test monitoring method, device, electronic equipment, storage medium and program product
CN112988604B (en) Object testing method, testing system, electronic device and readable storage medium
CN114116509A (en) Program analysis method, program analysis device, electronic device, and storage medium
CN113448578A (en) Page data processing method, processing system, electronic device and readable storage medium
CN113392010A (en) Common component testing method and device, electronic equipment and storage medium
CN113515271A (en) Service code generation method and device, electronic equipment and readable storage medium
CN112068814A (en) Method, device, system and medium for generating executable file
CN113051090A (en) Interface processing method and device, interface calling method and device, system and medium
CN113760467A (en) Transaction processing method, device, computer system and storage medium
CN114117449A (en) Hidden parameter mining-based test method and device, electronic equipment and medium
CN115309404A (en) File generation method and device, electronic equipment and storage medium
CN114780361A (en) Log generation method, device, computer system and readable storage medium
CN115357653A (en) Data processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination