Method and device for data interaction between systems
Through the adapter mode, data interaction between systems is realized in the internal business system, solving the problem of high cost of development and maintenance of multiple sets of codes, and improving the convenience and flexibility of interaction between systems.
Patent Information
- Application Number
- CN202310704482.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-14
- Publication Date
- 2024-12-17
AI Technical Summary
In non-standard channel docking scenarios, internal business systems need to adapt to different API interfaces of multiple external channel systems, resulting in the development of multiple sets of codes and supporting codes, increasing maintenance costs and complexity.
Through the adapter mode, the internal system only needs to develop a set of standard code, use the adapter to interact between systems, automatically map request and response parameters, adapt to the interface differences of external channel systems, and realize adaptive access between systems.
It greatly reduces the cost of code development and maintenance, improves the convenience and flexibility of interaction between systems, and avoids complexity and maintenance difficulties caused by interface differences.
Smart Images

Figure CN119149008A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for data interaction between systems. Background Art
[0002] In the scenario of non-standard channel docking, the internal business system needs to be docked according to the standards of the external channel system. The API (Application Programming Interface) interface of each non-standard external channel system is implemented differently. The general practice is to write multiple sets of codes in the internal business system to adapt to the solutions of multiple external channel systems. For multiple external channel systems to be docked, multiple sets of codes will be developed on the internal business system. At the same time, multiple sets of API downgrade control codes, network entry and exit codes, etc. that match the codes need to be developed.
[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0004] For multiple sets of codes developed on internal business systems, there is no unified business code standard, and the codes are difficult to maintain; the development and maintenance costs are high, and multiple sets of codes and their supporting codes will cause the development and maintenance costs to increase exponentially. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a method and device for data interaction between systems, which can realize adaptive access between systems based on adapters. The internal system only needs to develop a set of standard codes and does not need to worry about the interface differences of external non-standard channel systems, thereby avoiding a large amount of code development and maintenance, greatly saving the cost of code development and maintenance, and improving the convenience of interaction between systems.
[0006] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for data interaction between systems is provided, comprising:
[0007] Determine a corresponding adapter according to an access request from the first system to the second system, wherein the access request includes a first request parameter;
[0008] Acquire configuration information of the adapter, the configuration information including parameter mapping rules and an access address of the second system;
[0009] Mapping the first request parameter to a second request parameter corresponding to the second system according to the parameter mapping rule, and accessing the second system according to the second request parameter and the access address of the second system;
[0010] In response to receiving the second response parameter returned by the second system, mapping the second response parameter to a first response parameter corresponding to the first system according to the parameter mapping rule;
[0011] The first response parameter is sent to the first system to complete data interaction between the first system and the second system.
[0012] Optionally, the first system is an internal business system, and the second system is an external channel system; determining the corresponding adapter according to the first system's access request to the second system includes: determining the adapter corresponding to the external channel system according to a channel identifier included in the access request.
[0013] Optionally, the first system is an external channel system and the second system is an internal business system; determining the corresponding adapter based on the first system's access request to the second system includes: determining the adapter corresponding to the external channel system based on the access entry address of the external channel system included in the access request.
[0014] Optionally, the configuration information also includes a call count threshold; and before mapping the first request parameter to the second request parameter corresponding to the second system according to the parameter mapping rule, it also includes: obtaining the number of calls of the second system within a specified time period, and determining whether the number of calls exceeds the call count threshold; and determining that the number of calls does not exceed the call count threshold; wherein, if the number of calls exceeds the call count threshold, the access request is rejected.
[0015] Optionally, after accessing the second system according to the second request parameter and the access address of the second system, the method further includes: incrementing the number of calls to the second system.
[0016] Optionally, the configuration information also includes an interface call switch parameter; and before mapping the first request parameter to the second request parameter corresponding to the second system according to the parameter mapping rule, it also includes: judging whether the interface call of the second system has taken effect according to the interface call switch parameter; and determining that the interface call of the second system has taken effect; wherein, if it is determined that the interface call of the second system has not taken effect, directly returning a preset response value as the second response parameter.
[0017] Optionally, the configuration information also includes an interface call success identification code; and sending the first response parameter to the first system includes: determining whether the first response parameter includes the interface call success identification code; if the first response parameter includes the interface call success identification code, sending the first response parameter to the first system; if the first response parameter does not include the interface call success identification code, sending a preset interface call failure reminder information as the first response parameter to the first system.
[0018] According to another aspect of an embodiment of the present invention, a device for data interaction between systems is provided, including:
[0019] An adapter matching module, configured to determine a corresponding adapter according to an access request from the first system to the second system, wherein the access request includes a first request parameter;
[0020] A configuration information acquisition module, used to acquire configuration information of the adapter, wherein the configuration information includes parameter mapping rules and an access address of the second system;
[0021] a request parameter mapping module, configured to map the first request parameter to a second request parameter corresponding to the second system according to the parameter mapping rule, and access the second system according to the second request parameter and an access address of the second system;
[0022] a response parameter mapping module, configured to, in response to receiving a second response parameter returned by the second system, map the second response parameter to a first response parameter corresponding to the first system according to the parameter mapping rule;
[0023] A response parameter sending module is used to send the first response parameter to the first system to complete the data interaction between the first system and the second system.
[0024] According to another aspect of an embodiment of the present invention, there is provided an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method for data interaction between systems provided by an embodiment of the present invention.
[0025] According to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the method for data interaction between systems provided by an embodiment of the present invention is implemented.
[0026] An embodiment of the above invention has the following advantages or beneficial effects: by determining the corresponding adapter according to the access request of the first system to the second system, the access request includes a first request parameter; obtaining the configuration information of the adapter, the configuration information includes a parameter mapping rule and an access address of the second system; mapping the first request parameter to a second request parameter corresponding to the second system according to the parameter mapping rule, and accessing the second system according to the second request parameter and the access address of the second system; in response to receiving a second response parameter returned by the second system, mapping the second response parameter to a first response parameter corresponding to the first system according to the parameter mapping rule; sending the first response parameter to the first system to complete the data interaction between the first system and the second system. The technical solution can realize adaptive access between systems based on the adapter. The internal system only needs to develop a set of standard codes without worrying about the interface differences of external non-standard channel systems, thereby avoiding a large amount of code development and maintenance, greatly saving the code development and maintenance costs, and improving the convenience of interaction between systems.
[0027] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0029] Figure 1 is a schematic diagram of main steps of a method for data interaction between systems according to an embodiment of the present invention;
[0030] Figure 2 is a system principle diagram of an embodiment of the present invention;
[0031] Figure 3 is a schematic diagram of a data interaction process according to an embodiment of the present invention;
[0032] Figure 4 is a schematic diagram of main modules of an apparatus for data interaction between systems according to an embodiment of the present invention;
[0033] Figure 5 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0034] Figure 6 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0035] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0036] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution disclosed in the present invention are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.
[0037] In the prior art, when different systems interact with each other, since the external channel system has its own standards, which are different from the standards of the internal business system, as the number of external channel systems increases, it is necessary to be compatible with multiple sets of standards, which increases the difficulty and cost of code development and maintenance. In order to solve this technical problem, the present invention provides a method for data interaction between systems. The internal business system only needs to develop a set of standard middle-end codes, and use the adapter mode to adapt the standards of the external channel system to the standards of the internal business system. The internal business system only needs to focus on the implementation of its own business code, which helps the internal business system form a set of standard codes, thereby avoiding a large amount of code development and maintenance.
[0038] Figure 1 FIG. 1 is a schematic diagram of the main steps of the method for data interaction between systems according to an embodiment of the present invention. Figure 1 As shown, the method for data interaction between systems according to an embodiment of the present invention mainly includes the following steps S101 to S105.
[0039] Step S101: Determine the corresponding adapter according to the access request of the first system to the second system, wherein the access request includes a first request parameter. In the process of data interaction between the internal business system (hereinafter referred to as the "internal system") and the external channel system (hereinafter referred to as the "external system"), the API interface docking involves two situations, one is that the internal system calls the API interface of the external system, and the other is that the external system calls the API interface of the internal system.
[0040] According to one embodiment of the present invention, the first system is an internal business system, and the second system is an external channel system. And, determining the corresponding adapter according to the access request of the first system to the second system includes: determining the adapter corresponding to the external channel system according to the channel identifier included in the access request. When the internal system needs to call the API interface of the external system to interact with data, the access request needs to include the channel identifier corresponding to the external system. Among them, the channel identifier is agreed upon in advance by the internal system and the external system, and is bound to the adapter of the external system, so the adapter corresponding to the external system can be obtained according to the channel identifier. Taking the internal system of the health BBC mall and the external non-standard channel A health mall as an example, the channel identifier bbcShopId=321 is agreed upon, and the A mall adapter is newly created on the health open platform, and the channel identifier bbcShopId=321 is bound to the adapter configuration, thereby forming the relationship that the A mall adapter must correspond to bbcShopId=321, and bbcShopId=321 must correspond to the A mall adapter. When the internal system calls the interface of the external system to access the external system, the channel identifier must be transmitted to find the corresponding adapter according to the channel identifier. The adapter solution finds the corresponding external system adapter based on the pre-agreed fields and the channel ID (e.g. bbcShopId) passed in by the internal system. If the corresponding adapter cannot be found, an error message will be returned to the internal system, such as: {"code":"9999","msg":"The external channel system is not configured with an adapter"}.
[0041] According to another embodiment of the present invention, the first system is an external channel system, and the second system is an internal business system. In addition, determining the corresponding adapter according to the access request of the first system to the second system includes: determining the adapter corresponding to the external channel system according to the access entry address of the external channel system included in the access request. When the external system needs to call the API interface of the internal system to interact with data, the access request needs to include the access entry address assigned to the external system by the internal system. Among them, the access entry address assigned to the external system by the internal system is pre-agreed and is bound to the adapter of the external system, so the adapter corresponding to the external system can be obtained according to the access entry address assigned to the external system by the internal system. For example: taking the message API scenario of the external system of A Mall calling the internal system as an example, the adapter solution provides a URL address to the external system of A Mall, such as: https: / / beta-openapi.health.com / open / Ajk / message (this address is only an example), which means the message callback API under the external channel system of A Mall. Then bind the adapter of the external channel system of A Mall to the URL address. When the external system accesses the internal system by accessing the address, the corresponding adapter can be found. If the corresponding adapter cannot be found, an error message will be returned to the external system, such as: {"code":"9999","msg":"The external channel system is not configured with an adapter"}.
[0042] Step S102: Obtain the configuration information of the adapter, the configuration information including parameter mapping rules and the access address of the second system. After determining the corresponding adapter according to the access request, the configuration information of the adapter can be obtained. The configuration information of the adapter exists in the form of a list, and is grouped according to the API interface dimension of the external system. The configuration information of each external system's API interface includes, for example: whether the interface is effective, and the corresponding return value when it is not effective, the limit on the number of interface calls, the parameter mapping rules corresponding to the input and output parameters, etc., and should also include the access address of the second system corresponding to the API interface. According to the configuration information of the adapter, the external channel system can be monitored, downgraded and limited, and parameter conversion between systems can be performed.
[0043] Step S103: Map the first request parameter to the second request parameter corresponding to the second system according to the parameter mapping rule, and access the second system according to the second request parameter and the access address of the second system. When the first system is an internal system, the first request parameter is the request parameter corresponding to the internal system, and the second system is an external system. The request parameter corresponding to the internal system is converted into a second request parameter recognizable by the external system through the parameter mapping rule; when the first system is an external system, the first request parameter is the request parameter corresponding to the external system, and the second system is an internal system. The request parameter corresponding to the external system is converted into a second request parameter recognizable by the internal system through the parameter mapping rule. Among them, the parameter mapping rule is generally implemented as one or more conversion formulas. For the request parameter, it is an input parameter, so the corresponding input parameter conversion formula is. Correspondingly, for the response parameter, it is an output parameter, so the corresponding output parameter conversion formula is.
[0044] In one embodiment of the present invention, the parameter mapping rule can be implemented using the JSLT (JSON query and transformation language, mainly used for data conversion in JSON format) syntax specification. For example, assume that the conversion formula includes the following statements: "storeId": "test123"; "orderId": .outerRootOrderId; "partnerDiagId": .partnerDiagId. Among them,
[0045] "storeId":"test123" means that the result will have a field named storeId, whose value is a constant test123;
[0046] "orderId":.outerRootOrderId" means that the result will have a field named orderId, whose value is a dynamic variable whose value is the value of the outerRootOrderId field in the input parameter;
[0047] "partnerDiagId":.partnerDiagId means that the result will have a field named partnerDiagId, whose value is a dynamic variable whose value is the value of the partnerDiagId field in the input parameter.
[0048] After parameter mapping, the request input of the internal system can be adapted to the interface request input of the external system, so that the internal system can call the interface of the external system through the adapter without code modification. Similarly, after parameter mapping, the request input of the external system can be adapted to the interface request input of the internal system, so that the internal system can call the interface of the internal system through the adapter without code modification.
[0049] According to an embodiment of the present invention, the configuration information also includes a call count threshold; and before mapping the first request parameter to the second request parameter corresponding to the second system according to the parameter mapping rule, it also includes: obtaining the call count of the second system within a specified time period, and determining whether the call count exceeds the call count threshold; and determining that the call count does not exceed the call count threshold; wherein, if the call count exceeds the call count threshold, the access request is rejected. The specified time period can be set to one minute, for example, and the call count threshold refers to the maximum number of calls within one minute. If the call count of the second system within the specified time period exceeds the call count threshold, the access request is rejected and the current limiting information is returned. The current limiting information is, for example: {"code":"1024","msg":"Touched current limiting threshold"}. In this way, the call to the system interface can be restricted by configuration without the need to develop code, thereby avoiding code maintenance and saving a lot of development workload.
[0050] According to an embodiment of the present invention, after accessing the second system according to the second request parameter and the access address of the second system, the method further includes: incrementing the number of calls to the second system. The number of calls to the second system can be saved in a database, and the number of calls will be incremented each time the second system is called, so as to facilitate subsequent call restrictions based on the number of calls.
[0051] According to another embodiment of the present invention, the configuration information also includes an interface call switch parameter; and before mapping the first request parameter to the second request parameter corresponding to the second system according to the parameter mapping rule, it also includes: judging whether the interface call of the second system has taken effect according to the interface call switch parameter; and determining that the interface call of the second system has taken effect; wherein, in the case where it is determined that the interface call of the second system has not taken effect, directly returning a preset response value as the second response parameter. Specifically, the interface call switch parameter is used to identify whether an interface call of a system has taken effect. If it has taken effect, subsequent parameter mapping and other processing can be performed, otherwise directly returning a preset response value as the second response parameter. For example: the effect field can be configured to 0 to indicate that the interface call has not taken effect and the interface cannot be called.
[0052] Step S104: In response to receiving the second response parameter returned by the second system, the second response parameter is mapped to the first response parameter corresponding to the first system according to the parameter mapping rule. By mapping the first request parameter to the second request parameter corresponding to the second system, the second system can be accessed so that the second system performs business processing according to the second request parameter, obtains the second response parameter, and then returns the second response parameter. After receiving the second response parameter returned by the second system, the second response parameter is again mapped to the first response parameter corresponding to the first system according to the parameter mapping rule so that the first system can recognize it.
[0053] Step S105: Send the first response parameter to the first system to complete the data interaction between the first system and the second system.
[0054] According to another embodiment of the present invention, the configuration information also includes an interface call success identification code. And, sending the first response parameter to the first system includes: judging whether the first response parameter includes the interface call success identification code; in the case where the first response parameter includes the interface call success identification code, sending the first response parameter to the first system; in the case where the first response parameter does not include the interface call success identification code, sending the preset interface call failure reminder information as the first response parameter to the first system. Specifically, by configuring an interface call success identification code field discardErrCodeList field in the adapter, it is possible to judge whether the interface call to the second system is successful based on the field value. For example, the configuration field value is 0 and 9999. When code=0 or code=9999 is returned in the actual response message, it is considered that the call is successful.
[0055] Figure 2 FIG. 1 is a system schematic diagram of an embodiment of the present invention. Figure 2 As shown, in the embodiment of the present invention, the internal business system corresponds to a set of standard codes, and the service monitoring and management is performed through the open platform. For each external channel system, there is an adapter, and each adapter corresponds to the docking channel standard followed by the external channel system.
[0056] Figure 3 FIG. 1 is a schematic diagram of a data interaction process according to an embodiment of the present invention. Figure 3As shown, in one embodiment of the present invention, taking the internal system accessing the external system through the adapter as an example, after determining the adapter corresponding to the external system according to the access request, first, determine whether the interface call has taken effect according to the interface call switch parameter; if not, directly return the preset response value, otherwise obtain the number of calls of the external system interface within a specified time (for example, one minute) from the data of the adapter saved in the middleware; then, determine whether the number of calls exceeds the call number threshold; if exceeded, directly return the current limiting information, otherwise perform the request parameter mapping conversion according to the parameter mapping rule; then, according to the mapped request parameters, call the requested address path, and increase the number of calls of the external system interface by 1. After receiving the response parameters returned by the external system, perform the response parameter mapping conversion according to the parameter mapping rule; then determine whether the converted response parameters include the interface call success identification code; if included, return the converted response parameters to the internal system, otherwise directly return the external system access failure.
[0057] Figure 4 Schematic diagram of the main modules of the device for data interaction between systems according to an embodiment of the present invention. Figure 4 As shown, the device 400 for data interaction between systems according to the embodiment of the present invention mainly includes an adapter matching module 401 , a configuration information acquisition module 402 , a request parameter mapping module 403 , a response parameter mapping module 404 and a response parameter sending module 405 .
[0058] The adapter matching module 401 is used to determine a corresponding adapter according to an access request from the first system to the second system, wherein the access request includes a first request parameter;
[0059] A configuration information acquisition module 402, used to acquire configuration information of the adapter, the configuration information including parameter mapping rules and an access address of the second system;
[0060] A request parameter mapping module 403, configured to map the first request parameter to a second request parameter corresponding to the second system according to the parameter mapping rule, and access the second system according to the second request parameter and the access address of the second system;
[0061] a response parameter mapping module 404, configured to, in response to receiving a second response parameter returned by the second system, map the second response parameter to a first response parameter corresponding to the first system according to the parameter mapping rule;
[0062] The response parameter sending module 405 is used to send the first response parameter to the first system to complete the data interaction between the first system and the second system.
[0063] According to an embodiment of the present invention, the first system is an internal business system, and the second system is an external channel system; the adapter matching module 401 can also be used to: determine the adapter corresponding to the external channel system according to the channel identifier included in the access request.
[0064] According to another embodiment of the present invention, the first system is an external channel system, and the second system is an internal business system; the adapter matching module 401 can also be used to: determine the adapter corresponding to the external channel system according to the access entry address of the external channel system included in the access request.
[0065] According to another embodiment of the present invention, the configuration information also includes a call count threshold; and the device 400 for data interaction between systems also includes a first determination module (not shown in the figure), which is used to: before mapping the first request parameter to the second request parameter corresponding to the second system according to the parameter mapping rule, obtain the call count of the second system within a specified time period, and determine whether the call count exceeds the call count threshold; and determine that the call count does not exceed the call count threshold; wherein, if the call count exceeds the call count threshold, the access request is rejected.
[0066] According to another embodiment of the present invention, the device 400 for data interaction between systems also includes a call count incrementing module (not shown in the figure), which is used to: after accessing the second system according to the second request parameter and the access address of the second system, increment the call count of the second system.
[0067] According to another embodiment of the present invention, the configuration information also includes an interface call switch parameter; and the device 400 for data interaction between systems also includes a second determination module (not shown in the figure), which is used to: before mapping the first request parameter to the second request parameter corresponding to the second system according to the parameter mapping rule, determine whether the interface call of the second system has taken effect according to the interface call switch parameter; and determine that the interface call of the second system has taken effect; wherein, when it is determined that the interface call of the second system has not taken effect, directly return a preset response value as the second response parameter.
[0068] According to another embodiment of the present invention, the configuration information also includes an interface call success identification code; and the response parameter sending module 405 can also be used to: determine whether the first response parameter includes the interface call success identification code; if the first response parameter includes the interface call success identification code, send the first response parameter to the first system; if the first response parameter does not include the interface call success identification code, send a preset interface call failure reminder information as the first response parameter to the first system.
[0069] According to the technical solution of the embodiment of the present invention, the corresponding adapter is determined according to the access request of the first system to the second system, the access request includes a first request parameter; the configuration information of the adapter is obtained, the configuration information includes a parameter mapping rule and an access address of the second system; the first request parameter is mapped to a second request parameter corresponding to the second system according to the parameter mapping rule, and the second system is accessed according to the second request parameter and the access address of the second system; in response to receiving a second response parameter returned by the second system, the second response parameter is mapped to a first response parameter corresponding to the first system according to the parameter mapping rule; the first response parameter is sent to the first system to complete the data interaction between the first system and the second system. The technical solution can realize adaptive access between systems based on the adapter, and the internal system only needs to develop a set of standard codes without worrying about the interface differences of the external non-standard channel system, thereby avoiding a large amount of code development and maintenance, greatly saving the development and maintenance costs of the code, and improving the convenience of interaction between systems.
[0070] Figure 5 An exemplary system architecture 500 is shown to which the method for inter-system data interaction or the apparatus for inter-system data interaction according to the embodiment of the present invention can be applied.
[0071] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, 503, a network 504 and a server 505. Network 504 is used to provide a medium for communication links between terminal devices 501, 502, 503 and server 505. Network 504 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0072] Users can use terminal devices 501, 502, 503 to interact with server 505 through network 504 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 501, 502, 503, such as data interaction applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).
[0073] The terminal devices 501 , 502 , and 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0074] The server 505 may be a server that provides various services, such as a background management server that provides support for websites browsed by users using terminal devices 501, 502, and 503 (for example only). The background management server may determine the corresponding adapter for the received data such as the access request from the first system to the second system, wherein the access request includes a first request parameter; obtain the configuration information of the adapter, wherein the configuration information includes a parameter mapping rule and an access address of the second system; map the first request parameter to a second request parameter corresponding to the second system according to the parameter mapping rule, and access the second system according to the second request parameter and the access address of the second system; in response to receiving a second response parameter returned by the second system, map the second response parameter to a first response parameter corresponding to the first system according to the parameter mapping rule; send the first response parameter to the first system for processing, and feed back the processing result (for example, the first response parameter - for example only) to the terminal device.
[0075] It should be noted that the method for data interaction between systems provided in the embodiment of the present invention is generally executed by the server 505 , and accordingly, the device for data interaction between systems is generally arranged in the server 505 .
[0076] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0077] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 of a terminal device or a server suitable for implementing an embodiment of the present invention. Figure 6 The terminal device or server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0078] like Figure 6As shown, the computer system 600 includes a central processing unit (CPU) 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 part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0079] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 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, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.
[0080] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present invention are executed.
[0081] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0082] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0083] The units or modules involved in the embodiments of the present invention may be implemented by software or hardware. The units or modules described may also be arranged in a processor. For example, they may be described as: a processor including an adapter matching module, a configuration information acquisition module, a request parameter mapping module, a response parameter mapping module, and a response parameter sending module. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves. For example, the response parameter sending module may also be described as "a module for sending the first response parameter to the first system to complete the data interaction between the first system and the second system."
[0084] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: determining the corresponding adapter according to the access request of the first system to the second system, the access request includes a first request parameter; obtaining the configuration information of the adapter, the configuration information includes a parameter mapping rule and an access address of the second system; mapping the first request parameter to a second request parameter corresponding to the second system according to the parameter mapping rule, and accessing the second system according to the second request parameter and the access address of the second system; in response to receiving the second response parameter returned by the second system, mapping the second response parameter to a first response parameter corresponding to the first system according to the parameter mapping rule; sending the first response parameter to the first system to complete the data interaction between the first system and the second system.
[0085] According to the technical solution of the embodiment of the present invention, the corresponding adapter is determined according to the access request of the first system to the second system, the access request includes a first request parameter; the configuration information of the adapter is obtained, the configuration information includes a parameter mapping rule and an access address of the second system; the first request parameter is mapped to a second request parameter corresponding to the second system according to the parameter mapping rule, and the second system is accessed according to the second request parameter and the access address of the second system; in response to receiving a second response parameter returned by the second system, the second response parameter is mapped to a first response parameter corresponding to the first system according to the parameter mapping rule; the first response parameter is sent to the first system to complete the data interaction between the first system and the second system. The technical solution can realize adaptive access between systems based on the adapter, and the internal system only needs to develop a set of standard codes without worrying about the interface differences of the external non-standard channel system, thereby avoiding a large amount of code development and maintenance, greatly saving the development and maintenance costs of the code, and improving the convenience of interaction between systems.
[0086] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for data interaction between systems, characterized in that: include: Determine a corresponding adapter according to an access request from the first system to the second system, wherein the access request includes a first request parameter; Acquire configuration information of the adapter, the configuration information including parameter mapping rules and an access address of the second system; Mapping the first request parameter to a second request parameter corresponding to the second system according to the parameter mapping rule, and accessing the second system according to the second request parameter and the access address of the second system; In response to receiving the second response parameter returned by the second system, mapping the second response parameter to a first response parameter corresponding to the first system according to the parameter mapping rule; The first response parameter is sent to the first system to complete data interaction between the first system and the second system.
2. The method according to claim 1, characterized in that The first system is an internal business system, and the second system is an external channel system; Determining a corresponding adapter according to an access request from the first system to the second system includes: An adapter corresponding to the external channel system is determined according to the channel identifier included in the access request.
3. The method according to claim 1, characterized in that The first system is an external channel system, and the second system is an internal business system; Determining a corresponding adapter according to an access request from the first system to the second system includes: An adapter corresponding to the external channel system is determined according to the access entry address of the external channel system included in the access request.
4. The method according to claim 1, characterized in that: The configuration information also includes a call count threshold; and, Before mapping the first request parameter to a second request parameter corresponding to the second system according to the parameter mapping rule, the method further includes: Obtaining the number of calls of the second system within a specified time period, and determining whether the number of calls exceeds the number of calls threshold; and, determining that the number of calls does not exceed the number of calls threshold; Wherein, when the number of calls exceeds the number of calls threshold, the access request is rejected.
5. The method according to claim 1 or 4, characterized in that: After accessing the second system according to the second request parameter and the access address of the second system, the method further includes: The number of calls to the second system is incremented.
6. The method according to claim 1, characterized in that The configuration information also includes interface call switch parameters; and, Before mapping the first request parameter to a second request parameter corresponding to the second system according to the parameter mapping rule, the method further includes: Determining whether the interface call of the second system has taken effect according to the interface call switch parameter; and, determining that the interface call of the second system has taken effect; Wherein, when it is determined that the interface call of the second system is not effective, a preset response value is directly returned as the second response parameter.
7. The method according to claim 1, characterized in that The configuration information also includes an interface call success identification code; and, Sending the first response parameter to the first system includes: Determining whether the first response parameter includes the interface call success identification code; In a case where the first response parameter includes the interface call success identification code, sending the first response parameter to the first system; In a case where the first response parameter does not include the interface call success identification code, preset interface call failure reminder information is sent to the first system as the first response parameter.
8. A device for data interaction between systems, characterized in that: include: An adapter matching module, configured to determine a corresponding adapter according to an access request from the first system to the second system, wherein the access request includes a first request parameter; A configuration information acquisition module, used to acquire configuration information of the adapter, wherein the configuration information includes parameter mapping rules and an access address of the second system; a request parameter mapping module, configured to map the first request parameter to a second request parameter corresponding to the second system according to the parameter mapping rule, and access the second system according to the second request parameter and an access address of the second system; a response parameter mapping module, configured to, in response to receiving a second response parameter returned by the second system, map the second response parameter to a first response parameter corresponding to the first system according to the parameter mapping rule; A response parameter sending module is used to send the first response parameter to the first system to complete the data interaction between the first system and the second system.
9. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
