A data query method and device, computer equipment and a storage medium
By establishing interface relationships and configuration files between business systems, the problem of low data query efficiency between business systems was solved, and a fast data query process without real-time coding was achieved.
Patent Information
- Application Number
- CN202111249844.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-26
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2041-10-26
Smart Images

Figure CN113961600B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to the technical field of data query, and specifically to a data query method and device, computer equipment and storage medium. BACKGROUND
[0002] With the development of computer technology, data interaction between business systems also gradually increases. In the process of data query, generally, it is necessary to know the business interface corresponding to two business systems through the business interface table, and then the data query is realized by calling two business interfaces through code writing, so as to realize the data interaction between two business systems. However, the developer needs to deal with the docking problem of different business interfaces of different external systems every day, and write a large amount of redundant code to realize the data query between two business systems or even multiple business systems, resulting in low data query efficiency. SUMMARY
[0003] The embodiments of the present application provide a data query method and device, computer equipment and storage medium, which can improve the data query efficiency.
[0004] In one aspect, the present application provides a data query method, which comprises:
[0005] receiving a data query request for a target business sent by a first business system, the data query request carrying first business interface information corresponding to the first business system, the data query request being used to request target business data of the target business stored by a second business system;
[0006] determining a second business interface associated with the first business interface corresponding to the first business interface information from an interface association relationship included in an interface association relationship set, the second business interface being used to obtain the target business data stored by the second business system;
[0007] obtaining an interface configuration file between the first business interface and the second business interface;
[0008] based on the second business interface, calling the interface configuration file to obtain the target business data from the second business system, and sending the target business data to the first business system based on the first business interface.
[0009] In one aspect, the present application provides a data query device, which comprises:
[0010] The communication unit is configured to receive a data query request for a target service sent by a first service system, the data query request carrying first service interface information corresponding to the first service system, and the data query request being used to request target service data of the target service stored by a second service system;
[0011] The processing unit is configured to determine a second service interface associated with the first service interface from interface association relationships included in the set of interface association relationships, the second service interface being used to obtain the target service data stored by the second service system;
[0012] The processing unit is further configured to obtain an interface configuration file between the first service interface and the second service interface.
[0013] The processing unit is further configured to obtain the target service data from the second service system based on the second service interface and the interface configuration file.
[0014] The communication unit is further configured to send the target service data to the first service system based on the first service interface.
[0015] In an aspect, an embodiment of the present application provides a computer device, including a processor and a memory, the processor and the memory are connected with each other, wherein the memory is configured to store a computer program, the computer program includes program instructions, the processor is configured to invoke the program instructions to execute the data query method described above.
[0016] In an aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium stores program instructions, the program instructions are executed to implement the data query method described above.
[0017] In an aspect, an embodiment of the present application provides a computer program product or a computer program, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer readable storage medium, and the computer instructions are executed by a processor of a computer device to execute the data query method described above.
[0018] In the embodiment of the present application, a data query request for a target service is received from a first service system, the data query request carrying first service interface information corresponding to the first service system, the data query request being used to request target service data of the target service stored by a second service system; a second service interface associated with the first service interface is determined from an interface association relationship included in an interface association relationship set, the second service interface being used to obtain the target service data stored by the second service system; an interface configuration file between the first service interface and the second service interface is obtained; then the target service data is obtained from the second service system by calling the interface configuration file based on the second service interface, and the target service data is sent to the first service system based on the first service interface. By establishing the interface association relationship, a developer can quickly find a service interface between two service systems; further, by directly calling the interface configuration file for service data query, there is no need to write codes in real time when the two service systems perform service data query. BRIEF DESCRIPTION OF DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.
[0020] Figure 1a is an architecture diagram of a data query system provided by the embodiment of the present application;
[0021] Figure 1b is another architecture diagram of a data query system provided by the embodiment of the present application;
[0022] Figure 2 is a flowchart of a data query method provided by the embodiment of the present application;
[0023] Figure 3 is a structure diagram of a data query device provided by the embodiment of the present application;
[0024] Figure 4 is a structure diagram of a computer device provided by the embodiment of the present application. DETAILED DESCRIPTION
[0025] Clearly, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all the other embodiments obtained by those of ordinary skill in the art without creative efforts should belong to the scope of the present application.
[0026] The embodiment of the present application provides a data query scheme, and the general principle of the data query scheme is as follows: an interface association relationship between different business interfaces is established, and an interface configuration file between the business interfaces is preconfigured, and then the specific process of the data query scheme can be described by taking two business systems for business data query as an example: when the business system 1 wants to query the business data of the business system 2, first, the business interface information of the business system 1 is acquired, then the business interface of the business system 2 is determined according to the business interface information of the business system 1 and the interface association relationship between different business interfaces, then the interface configuration file between the two business interfaces is directly acquired according to the business interface information corresponding to the business interface and the business interface of the business system 2, and the business data stored in the business system 2 can be queried by calling the interface configuration file, and then the queried business data is returned to the business system 1.
[0027] The data query scheme provided by the embodiment of the present application has the following beneficial effects: the association relationship between the business interfaces of each business system is centrally managed, and then the interface association relationship is established, so that the developer can quickly find the business interfaces between the two business systems; further, the interface configuration file is directly called for business data query, and there is no need to write codes in real time when the two business systems query the business data.
[0028] Based on the above data query scheme, the embodiment of the present application provides a data query system. Please refer to Figure 1a , Figure 1aA structural diagram of a data query system is provided for an embodiment of the present application. The data query system can include at least two business systems 101 and at least one interface management platform 102; wherein the business system 101 can provide a data query interface in which the business data to be queried can be input; the interface management platform 102 is used to store the interface association relationship set between different business interfaces and the interface configuration file between a plurality of business interfaces, etc., the interface management platform 102 can obtain the required business data from one business system 101 and forward the obtained business data to another business system 101. Wherein the business system 101 and the interface management platform 102 can be directly or indirectly connected through wired or wireless communication, which is not limited in the present application. Wherein the business system 101 can be a server or a terminal device, and the interface management platform can also be a server and a terminal device. The above terminal device can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a mobile internet device (MID), a wearable device, etc. The above server includes a plurality of servers (also referred to as nodes), which can be independent physical servers, and can also be cloud servers providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content distribution networks (CDN), and big data and artificial intelligence platforms, etc. Basic cloud computing services.
[0029] In one embodiment, the above data query scheme can be executed by the interface management platform 102. Specifically, a user can query the business data of a target business from one business system 101 to another business system 101, the user can submit the business data of the target business to be queried on the business system 101, and the business system 101 can generate a data query request for the target business and send the data query request to the interface management platform 102, wherein the data query request carries first business interface information. Then the interface management platform 102 can determine the second business interface associated with the first business interface corresponding to the first business interface information from the association relationship included in the interface association relationship set; and obtain the configuration file between the first business interface and the second business interface, then directly call the second business interface in the configuration file to obtain the business data of the target business from another business system 101, and use the first business interface in the configuration file to return the business data of the target business to the business system 101 sending the data query request.
[0030] It should be noted that, Figure 1a only represents the system architecture of the data query system, and does not limit the specific architecture of the data query system. For example,Figure 1a The number of business systems in the system is 2; but in other embodiments, the number of business systems can be 3, 5 or even more. For example, Figure 1a The business system and the interface management device in the system can be located outside the blockchain network; but in other embodiments, the data query system can also be deployed based on the blockchain network, that is, the business system and the interface management device can be deployed in the blockchain network, or Figure 1b The business system in the system is deployed outside the blockchain network, and the interface management device is deployed inside the blockchain network, and the like. Among them, the blockchain mentioned here is a new application mode of distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm and other computer technologies. Its essence is a decentralized database, which is a series of data blocks associated using cryptography.
[0031] Based on the above data query scheme, please refer to Figure 2 , Figure 2 a flowchart of a data query method provided by an embodiment of the application. The data query method can be executed by a computer device, which can be the interface management platform 102 in the above Figure 1a The data query method described in this embodiment includes the following steps S201-S204:
[0032] S201, receiving a data query request for a target business sent by a first business system, the data query request carrying first business interface information corresponding to the first business system, the data query request being used to request target business data of the target business stored by a second business system.
[0033] Among them, the target business can be a weather business, a geographic business, an insurance business, etc.; and the target business data can be weather data, geographic data, insurance data, etc. In a specific implementation, when the first business system wants to query the target business data of the target business from the second business system, it can send a data query request to the computer device, and then the computer device receives the data query request sent by the first business system. The first business interface information can include the interface name, interface identifier and interface verification information of the first business interface, etc., and the interface verification information can be the IP address, MAC (Media Access Control) address, etc. of the computer device to which the first business system belongs.
[0034] In an embodiment, the first service interface information comprises interface verification information. After receiving the data query request sent by the first service system, the computer device can perform legality verification on the first service interface according to the interface verification information. If the legality verification on the first service interface is passed, the interface association relationship set is obtained, and step S202 is executed. If the legality verification on the first service interface is not passed, an alarm information can be output, which is used to indicate that the interface verification information of the first service interface is incorrect.
[0035] In an embodiment, before step S202 is executed, the first service interface information comprises a target address of the first service system, which can be an IP address or a MAC address of the first service system on the blockchain, and the like. The computer device can trigger the target smart contract according to the target service type to which the target service belongs: call the target smart contract to obtain the identity information corresponding to the target address stored on the blockchain and the preset authorization condition corresponding to the target smart contract; determine whether the identity information satisfies the preset authorization condition through the target smart contract. If the identity information satisfies the preset authorization condition, the interface association relationship set is obtained. The blockchain stores a plurality of smart contracts, and each smart contract corresponds to a service type. The identity information can be the hardware information of the computer device to which the first service system belongs, and the like. The preset authorization condition can also be the hardware information of the computer device to which the first service system belongs, which can be set according to authorization requirements. Then, the computer device can trigger the target smart contract corresponding to the target service type to which the target service belongs. Then, the smart contract is called to obtain the identity information corresponding to the communication address stored on the blockchain, and it is determined whether the identity information satisfies the preset authorization condition. If it is determined that the identity information satisfies the preset authorization condition, the interface association relationship set is obtained. If it is determined that the identity information does not satisfy the preset authorization condition, a prompt information is output, which is used to indicate that the target address is not authorized.
[0036] In an embodiment, a set of interface association relationships between different service interfaces can be established in advance. In a specific implementation, the computer device can obtain the service interfaces of a plurality of service systems from a preset storage space, where the preset storage space can be a blockchain, etc.; then establish interface association relationships for the service interfaces of the plurality of service systems according to preset conditions to obtain interface association relationships between the service interfaces; where the preset conditions include one or more of the following: there is data interaction between the service interfaces, and the service interfaces process the same service type of service. There is data interaction between the service interfaces can mean that there is a demand for data interaction between the service interfaces. For example, when service system 1 and service system 2 have data interaction, an interface association relationship between the service interface of service system 1 and the service interface of service system 2 can be established; for another example, when the service interface of service system 1 and the service interface of service system 2 process the same service type of service, an interface association relationship between the service interface of service system 1 and the service interface of service system 2 can be established, and the interface association relationships between the service interfaces are saved in the set of interface association relationships.
[0037] S202, from the interface association relationships included in the set of interface association relationships, determine the second service interface associated with the first service interface corresponding to the first service interface information, the second service interface being used to obtain target service data stored by a second service system.
[0038] Wherein each service system can correspond to one or more service interfaces, and each service interface can be used to transmit different service data. The service data of the corresponding service system can be obtained through the service interface, or the service data to be stored can be sent to the corresponding service system through the service interface. For example, calling the first service interface can transmit the service data stored by the first service system, and for another example, calling the second service interface can transmit the service data stored by the second service system. The set of interface association relationships includes interface association relationships between different service interfaces.
[0039] In a specific implementation, in step S202, the first service interface information has been obtained from the data query request, and the first service system can be determined; then the computer device can obtain the set of interface association relationships from the local space or other platforms. Where the other platforms can be a blockchain, etc. And the second service interface associated with the first service interface can be obtained from the association relationship included in the set of interface association relationships.
[0040] In an embodiment, the interface association relationship set includes a plurality of interface association relationship subsets, each of which corresponds to a service type; and the specific implementation manner of determining the second service interface associated with the first service interface corresponding to the first service interface information from the interface association relationship set can be: first determining a target service type to which a target service belongs; searching for a target interface association relationship subset matching the target service type from the plurality of interface association relationship subsets; and determining the second service interface associated with the first service interface from the target interface association relationship subset. Specifically, the computer device can determine the target service type to which the target belongs, then match the target service type with each service type to obtain a matching service type matching the target service type; then obtain the target interface association relationship subset corresponding to the matching service type from the plurality of interface association relationship subsets, and then determine the second service interface associated with the first service interface from the target interface association relationship subset. The second service interface associated with the first service interface can be quickly found through the service type, further improving the efficiency of data query.
[0041] For example, the interface association relationship set includes interface association relationship subset 1 and interface association relationship subset 2; the interface association relationship subset 1 corresponds to an insurance service type; the interface association relationship subset 2 corresponds to a weather service type; the target service is an insurance purchase service, the first service interface is service interface 1, and the computer device can determine that the target service type to which the insurance purchase service belongs is the insurance service type, then search for the interface association relationship subset 1 matching the insurance service type from the plurality of interface association relationship subsets, and the interface association relationship subset 1 includes the interface association relationship between the service interface 1 and the service interface 2; then the computer device can obtain the service interface 2 corresponding to the service interface 1 from the interface association relationship subset 1.
[0042] S203, obtaining an interface configuration file between the first service interface and the second service interface.
[0043] In a specific implementation, a plurality of reference interface configuration files can be acquired, each reference configuration file corresponding to a plurality of interface fields, each field interface being used to indicate an interface attribute information; attribute information of the first service interface and attribute information of the second service interface are determined; the attribute information of the first service interface and the attribute information of the second service interface are matched with the interface attribute information indicated by the interface fields included in each reference configuration file respectively, to obtain a first matching interface field matched with the attribute information of the first service interface, and a second matching interface field matched with the attribute information of the second service interface; if the first matching interface field and the second matching interface field belong to the same reference configuration file, the same reference configuration file corresponding to the first matching interface field and the second matching interface field is determined as the interface configuration file between the first service interface and the second service interface. Wherein, the plurality of reference interface configuration files can be stored in the computer device, and the interface attribute information can include interface identification, interface type, etc. The computer device can match the attribute information of the first service interface with the interface attribute information indicated by the plurality of fields in the reference interface configuration file, and determine the first matching interface field corresponding to the matching interface attribute information matched with the attribute information of the first service interface, and similarly, the second matching interface field corresponding to the matching interface attribute information matched with the attribute information of the second service interface can be determined, and then it is judged whether the first matching interface field and the second matching interface field belong to the same reference configuration file in the plurality of reference configuration files, if the first matching interface field and the second matching interface field belong to the same reference configuration file, the same reference configuration file corresponding to the first matching interface field and the second matching interface field is determined as the interface configuration file between the first service interface and the second service interface.
[0044] If it is determined that the first matching interface field and the second matching interface field do not belong to the same reference configuration file, a prompt information is sent to the first service system, and a configuration interface is displayed, the prompt information being used to indicate that there is no interface configuration file between the first service interface and the second service interface; then the interface configuration file between the first service interface and the second service interface can be configured by the authorized personnel in the configuration interface, and the confirmation operation is submitted in the configuration interface, and then when the computer device detects the confirmation operation for the configuration interface, the interface configuration file between the first service interface and the second service interface is configured. Wherein, the interface configuration file is stored in the form of json array.
[0045] S204, based on the second service interface, calling the interface configuration file to acquire target service data from the second service system, and based on the first service interface, sending the target service data to the first service system.
[0046] In a specific implementation, the computer device can parse the interface configuration file to obtain the service transmission parameter of the first service interface and the service transmission parameter of the second service interface, and then use the service transmission parameter of the second service interface to obtain the target service data of the target service from the second service system. After obtaining the target service data of the target service from the second service system, the computer device uses the service transmission parameter of the first service interface to send the target service data to the first service system.
[0047] In one embodiment, in order to further improve the efficiency of data query, since the interface configuration file is configured in a json array, which is convenient for maintenance, after obtaining the interface configuration file, the service transmission parameter of the first service interface and the service transmission parameter of the second service interface can be adjusted, and then the target service data of the target service is obtained from the second service system according to the adjusted service transmission parameter of the first service interface. Then the computer device uses the adjusted service transmission parameter of the first service interface to send the target service data to the first service system, which can improve the efficiency of data query. How to adjust the service transmission parameter of the first service interface and the service transmission parameter of the second service interface can be determined according to business requirements, traffic bandwidth and service query priority. For example, when the business requirement is to query within a very short time (such as 1s, 3s), the service transmission parameter of the first service interface and the service transmission parameter of the second service interface are adjusted in the direction of faster data query. For another example, when the available bandwidth of the first service system and the available bandwidth of the second service system both exceed the preset bandwidth, the service transmission parameter of the first service interface and the service transmission parameter of the second service interface can be increased. For another example, the query priority of the service data of the target service can be determined, and if the query priority is higher than a threshold, the service transmission parameter of the first service interface and the service transmission parameter of the second service interface can also be increased.
[0048] In the embodiment of the present application, a data query request for a target service is received from a first service system, the data query request carrying first service interface information corresponding to the first service system, the data query request being used to request target service data of the target service stored by a second service system; a second service interface associated with the first service interface is determined from an interface association relationship included in an interface association relationship set, the second service interface being used to obtain the target service data stored by the second service system; an interface configuration file between the first service interface and the second service interface is obtained; the second service interface in the interface configuration file is called to obtain the target service data from the second service system, and the target service data is sent to the first service system by using the first service interface. By establishing the interface association relationship, a developer can quickly find a service interface between two service systems; further, the interface configuration file is directly called for service data query without real-time code writing when the two service systems perform service data query.
[0049] Based on the description of the above data query method embodiment, the embodiment of the present application further discloses a data query device, which can be a computer program (including program code) running in the above-mentioned computer device. The data query device can execute the method shown in Figure 2 . Please refer to Figure 3 , the data query device can run the following units:
[0050] The communication unit 301 is configured to receive a data query request for a target service sent by a first service system, the data query request carrying first service interface information corresponding to the first service system, the data query request being used to request target service data of the target service stored by a second service system;
[0051] The processing unit 302 is configured to determine a second service interface associated with the first service interface from an interface association relationship included in an interface association relationship set, the second service interface being used to obtain the target service data stored by the second service system;
[0052] The processing unit 302 is further configured to obtain an interface configuration file between the first service interface and the second service interface;
[0053] The processing unit 302 is further configured to call the interface configuration file to obtain the target service data from the second service system based on the second service interface;
[0054] The communication unit 301 is further configured to send the target service data to the first service system based on the first service interface.
[0055] In an embodiment, the interface association relationship set includes a plurality of interface association relationship subsets, each of the interface association relationship subsets corresponds to a service type; when determining the second service interface associated with the first service interface corresponding to the first service interface information from the interface association relationship included in the interface association relationship set, the processing unit 302 can be specifically configured to:
[0056] determine the target service type to which the target service belongs;
[0057] search for a target interface association relationship subset matching the target service type from the plurality of interface association relationship subsets;
[0058] determine the second service interface associated with the first service interface corresponding to the first service interface information from the target interface association relationship subset.
[0059] In an embodiment, the first service interface information includes a target address of a first service system, and before determining the second service interface associated with the first service interface corresponding to the first service interface information from the interface association relationship included in the interface association relationship set, the processing unit 302 is further configured to:
[0060] trigger a target smart contract according to the target service type to which the target service belongs:
[0061] call the target smart contract to obtain identity information corresponding to the target address stored on the blockchain and a preset authorization condition corresponding to the target smart contract;
[0062] determine whether the identity information meets the preset authorization condition through the target smart contract, and if the identity information meets the preset authorization condition, obtain the interface association relationship set.
[0063] In an embodiment, the processing unit 302 is further configured to:
[0064] obtain service interfaces of a plurality of service systems from a preset storage space;
[0065] establish interface association relationships according to preset conditions, and obtain interface association relationships between the service interfaces; wherein the preset conditions include one or more of the following: data interaction exists between the service interfaces, and the service types of the service interfaces are the same;
[0066] save the interface association relationships between the service interfaces in the interface association relationship set.
[0067] In one embodiment, the processing unit 302, when calling the second service interface in the interface configuration file to obtain the target service data from the second service system, can be specifically used for:
[0068] parsing the interface configuration file to obtain the service transmission parameters of the first service interface and the service transmission parameters of the second service interface;
[0069] obtaining the target service data from the second service system by using the service transmission parameters of the second service interface;
[0070] The communication unit 301, when sending the target service data to the first service system by using the first service interface, can be specifically used for:
[0071] sending the target service data to the first service system by using the service transmission parameters of the first service interface.
[0072] In one embodiment, the processing unit 302, when obtaining the interface configuration file between the first service interface and the second service interface, can be specifically used for:
[0073] obtaining a plurality of reference interface configuration files, each reference configuration file corresponding to a plurality of interface fields, each field interface indicating an interface attribute information;
[0074] determining the attribute information of the first service interface and the attribute information of the second service interface;
[0075] matching the attribute information of the first service interface and the attribute information of the second service interface with the interface attribute information indicated by the interface fields included in each reference configuration file respectively, to obtain a first matching interface field matched with the attribute information of the first service interface, and a second matching interface field matched with the attribute information of the second service interface;
[0076] If the first matching interface field and the second matching interface field belong to the same reference configuration file, the same reference configuration file corresponding to the first matching interface field and the second matching interface field is determined as the interface configuration file between the first service interface and the second service interface.
[0077] In one embodiment, the processing unit 302 is further used for:
[0078] If the first matching interface field and the second matching interface field do not belong to the same reference configuration file, a prompt information is sent to the first service system, and a configuration interface is displayed, the prompt information being used to indicate that there is no interface configuration file between the first service interface and the second service interface.
[0079] When a confirmation operation is detected for the configuration interface, the interface configuration file between the first service interface and the second service interface is configured.
[0080] It is understood that the functional units of the data query device in this embodiment can be based on the above method embodiments. Figure 2 The specific implementation of the method described above can be found in the detailed implementation process. Figure 2 The relevant descriptions will not be repeated here.
[0081] Further, please see Figure 4 , Figure 4 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The above... Figure 2 The computer device in the corresponding embodiment can be Figure 4 The computer equipment shown. (For example...) Figure 4 As shown, the computer device may include a processor 401, an input device 402, an output device 403, and a memory 404. The processor 401, input device 402, output device 403, and memory 404 are connected via a bus 405. The memory 404 stores computer programs, which include program instructions, and the processor 401 executes the program instructions stored in the memory 404.
[0082] In this embodiment of the application, the processor 401 performs the following operations by running the executable program code in the memory 404:
[0083] The system receives a data query request for a target business sent by a first business system. The data query request carries the first business interface information corresponding to the first business system. The data query request is used to request the target business data of the target business stored in the second business system.
[0084] From the interface association relationships included in the interface association relationship set, determine the second business interface associated with the first business interface information corresponding to the first business interface information. The second business interface is used to obtain the target business data stored in the second business system.
[0085] Obtain the interface configuration file between the first business interface and the second business interface;
[0086] Based on the second business interface, the target business data is obtained from the second business system by calling the interface configuration file, and the target business data is sent to the first business system based on the first business interface.
[0087] In an embodiment, the interface association relationship set includes a plurality of interface association relationship subsets, each of the interface association relationship subsets corresponds to a service type; when determining the second service interface associated with the first service interface corresponding to the first service interface information from the interface association relationship included in the interface association relationship set, the processor 401 can be specifically configured to:
[0088] determine the target service type to which the target service belongs;
[0089] search for a target interface association relationship subset matching the target service type from the plurality of interface association relationship subsets;
[0090] determine the second service interface associated with the first service interface corresponding to the first service interface information from the target interface association relationship subset.
[0091] In an embodiment, the first service interface information includes a target address of a first service system, and before determining the second service interface associated with the first service interface corresponding to the first service interface information from the interface association relationship included in the interface association relationship set, the processor 401 is further configured to:
[0092] trigger a target smart contract according to the target service type to which the target service belongs:
[0093] invoke the target smart contract to obtain identity information corresponding to the target address stored on the blockchain and a preset authorization condition corresponding to the target smart contract;
[0094] determine whether the identity information meets the preset authorization condition through the target smart contract, and if the identity information meets the preset authorization condition, obtain the interface association relationship set.
[0095] In an embodiment, the processor 401 is further configured to:
[0096] obtain service interfaces of a plurality of service systems from a preset storage space;
[0097] establish interface association relationships according to preset conditions to obtain interface association relationships between the service interfaces; wherein the preset conditions include one or more of the following: data interaction exists between the service interfaces, and the service types of the service interfaces are the same;
[0098] save the interface association relationships between the service interfaces in the interface association relationship set.
[0099] In an embodiment, the processor 401, when calling the second service interface in the interface configuration file to obtain the target service data from the second service system, can be specifically used for:
[0100] parsing the interface configuration file to obtain the service transmission parameter of the first service interface and the service transmission parameter of the second service interface;
[0101] obtaining the target service data from the second service system by using the service transmission parameter of the second service interface;
[0102] the sending the target service data to the first service system by using the first service interface, comprising:
[0103] sending the target service data to the first service system by using the service transmission parameter of the first service interface.
[0104] In an embodiment, the processor 401, when obtaining the interface configuration file between the first service interface and the second service interface, can be specifically used for:
[0105] obtaining a plurality of reference interface configuration files, each reference configuration file corresponding to a plurality of interface fields, each field interface being used to indicate an interface attribute information;
[0106] determining the attribute information of the first service interface and the attribute information of the second service interface;
[0107] matching the attribute information of the first service interface and the attribute information of the second service interface with the interface attribute information indicated by the interface fields included in each reference configuration file respectively to obtain a first matching interface field matched with the attribute information of the first service interface and a second matching interface field matched with the attribute information of the second service interface;
[0108] if the first matching interface field and the second matching interface field belong to the same reference configuration file, determining the same reference configuration file corresponding to the first matching interface field and the second matching interface field as the interface configuration file between the first service interface and the second service interface.
[0109] In an embodiment, the processor 401 is further used for:
[0110] if the first matching interface field and the second matching interface field do not belong to the same reference configuration file, sending a prompt information to the first service system and displaying a configuration interface, the prompt information being used to indicate that there is no interface configuration file between the first service interface and the second service interface;
[0111] When a confirmation operation for the configuration interface is detected, an interface configuration file between the first service interface and the second service interface is configured.
[0112] It should be understood that, in the embodiments of the present application, the processor 401 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0113] The memory 404 can include a read-only memory and a random access memory, and provide instructions and data for the processor 401. A part of the memory 404 can also include a non-volatile random access memory.
[0114] The input device 402 can include a keyboard and the like, and input first service interface information to the processor 401; the output device 403 can include a display and the like.
[0115] In specific implementations, the processor 401, the input device 402, the output device 403 and the memory 404 described in the embodiments of the present application can perform the implementation manners described in all the above embodiments, and can also perform the implementation manners described in the above apparatuses, which will not be described here.
[0116] The embodiments of the present application provide a computer readable storage medium, which stores a computer program, the computer program including program instructions, the program instructions being executed by a processor to perform the steps performed in all the above embodiments.
[0117] The embodiments of the present application also provide a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer readable storage medium, and the computer instructions being executed by a processor of a computer device to perform the method in all the above embodiments.
[0118] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing relevant hardware, and the program can be stored in a computer readable storage medium. When the program is executed, the program can include the processes of the above-mentioned embodiment methods. The storage medium can be a magnetic disc, an optical disc, a read-only memory (ROM), a random access memory (RAM), or the like.
[0119] The above only discloses a preferred embodiment of the present application, and of course cannot limit the scope of the present application. Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed, and equivalent changes made according to the claims of the present application still belong to the scope of the present application.
Claims
1. A data query method, characterized in that, include: The system receives a data query request for a target service sent by a first business system. The data query request carries first business interface information corresponding to the first business system. The data query request is used to request target service data of the target service stored in the second business system. The first business interface information includes the target address of the first business system. Trigger the target smart contract according to the target business type to which the target business belongs; Multiple smart contracts are stored on the blockchain, and each smart contract corresponds to a business type. Call the target smart contract to obtain the identity information corresponding to the target address stored on the blockchain and the preset authorization conditions corresponding to the target smart contract; The target smart contract determines whether the identity information meets the preset authorization conditions. If it is determined that the identity information does not meet the preset authorization conditions, a prompt message is output, which indicates that the target address is not authorized; If the identity information meets the preset authorization conditions, the first business interface is validated for legality based on the interface verification information included in the first business interface information. If the validation of the first business interface fails, an alarm message is output, indicating that the interface verification information of the first business interface is incorrect. If the validation of the first business interface passes, an interface association set is obtained. The interface association set includes multiple interface association subsets, and each interface association subset corresponds to a business type. Determine the target business type to which the target business belongs, search for a target interface association subset that matches the target business type from the plurality of interface association subsets, and determine a second business interface associated with the first business interface corresponding to the first business interface information from the target interface association subsets. The second business interface is used to obtain the target business data stored in the second business system. Obtain the interface configuration file between the first business interface and the second business interface; wherein, the business types include weather business type, geographic business type, and insurance business type; the interface configuration file is obtained by: obtaining multiple reference interface configuration files, each reference configuration file corresponding to multiple interface fields, each field indicating an interface attribute information; determining the attribute information of the first business interface and the attribute information of the second business interface; matching the attribute information of the first business interface and the attribute information of the second business interface with the interface attribute information indicated by the interface fields included in each reference configuration file, to obtain a first matching interface field matching the attribute information of the first business interface and a second matching interface field matching the attribute information of the second business interface; if the first matching interface field and the second matching interface field belong to the same reference configuration file, then the same reference configuration file corresponding to the first matching interface field and the second matching interface field is determined as the interface configuration file between the first business interface and the second business interface; if the first matching interface field and the second matching interface field do not belong to the same reference configuration file, then it indicates that there is no interface configuration file between the first business interface and the second business interface; The interface configuration file is parsed to obtain the service transmission parameters of the first service interface and the service transmission parameters of the second service interface. The service transmission parameters of the first service interface and the service transmission parameters of the second service interface are adjusted according to service requirements, traffic bandwidth and service query priority. The target service data is obtained from the second service system based on the adjusted service transmission parameters of the second service interface, and then sent to the first service system based on the adjusted service transmission parameters of the first service interface.
2. The method according to claim 1, characterized in that, The method further includes: Obtain business interfaces from multiple business systems from the preset storage space; Based on preset conditions, interface association relationships are established between the business interfaces of the multiple business systems to obtain the interface association relationships between each business interface; wherein, the preset conditions include one or more of the following: there is data interaction between the business interfaces, and the business types processed by the business interfaces are the same. The interface association relationships between the various business interfaces are stored in the interface association relationship set.
3. The method according to claim 1, characterized in that, The method further includes: If the first matching interface field and the second matching interface field do not belong to the same reference configuration file, a prompt message is sent to the first business system and a configuration interface is displayed. The prompt message is used to indicate that there is no interface configuration file between the first business interface and the second business interface. When a confirmation operation is detected for the configuration interface, the interface configuration file between the first service interface and the second service interface is configured.
4. A data query device, characterized in that, include: A communication unit is configured to receive a data query request for a target service sent by a first service system. The data query request carries first service interface information corresponding to the first service system. The data query request is used to request target service data of the target service stored in a second service system. The first service interface information includes the target address of the first service system. The processing unit is used to trigger the target smart contract according to the target business type to which the target business belongs; multiple smart contracts are stored on the blockchain, and each smart contract corresponds to a business type; Call the target smart contract to obtain the identity information corresponding to the target address stored on the blockchain and the preset authorization conditions corresponding to the target smart contract; The target smart contract determines whether the identity information meets the preset authorization conditions. If it is determined that the identity information does not meet the preset authorization conditions, a prompt message is output, which indicates that the target address is not authorized; If the identity information meets the preset authorization conditions, the first business interface is validated for legality based on the interface verification information included in the first business interface information. If the validation of the first business interface fails, an alarm message is output, indicating that the interface verification information of the first business interface is incorrect. If the validation of the first business interface passes, an interface association set is obtained. The interface association set includes multiple interface association subsets, each corresponding to a business type. The target business type to which the target business belongs is determined. A target interface association subset matching the target business type is searched from the multiple interface association subsets. A second business interface associated with the first business interface corresponding to the first business interface information is determined from the target interface association subset. The second business interface is used to obtain the target business data stored in the second business system. The processing unit is further configured to obtain an interface configuration file between the first business interface and the second business interface; wherein, the business types include weather business types, geographic business types, and insurance business types; the method of obtaining the interface configuration file includes: obtaining multiple reference interface configuration files, each reference configuration file corresponding to multiple interface fields, each field interface being used to indicate an interface attribute information; determining the attribute information of the first business interface and the attribute information of the second business interface; matching the attribute information of the first business interface and the attribute information of the second business interface with the interface attribute information indicated by the interface fields included in each reference configuration file, respectively, to obtain a first matching interface field matching the attribute information of the first business interface and a second matching interface field matching the attribute information of the second business interface; if the first matching interface field and the second matching interface field belong to the same reference configuration file, then the same reference configuration file corresponding to the first matching interface field and the second matching interface field is determined as the interface configuration file between the first business interface and the second business interface; if the first matching interface field and the second matching interface field do not belong to the same reference configuration file, then it indicates that there is no interface configuration file between the first business interface and the second business interface; The processing unit is further configured to parse the interface configuration file to obtain the service transmission parameters of the first service interface and the service transmission parameters of the second service interface, and adjust the service transmission parameters of the first service interface and the service transmission parameters of the second service interface according to service requirements, traffic bandwidth and service query priority; obtain the target service data from the second service system based on the adjusted service transmission parameters of the second service interface, and send the target service data to the first service system based on the adjusted service transmission parameters of the first service interface.
5. A computer device, characterized in that, Includes memory used to store computer programs; The processor invokes the computer program in the memory to execute the data query method as described in any one of claims 1 to 3.
6. A computer storage medium, characterized in that, The computer storage medium stores a computer program, which includes program instructions. When the program instructions are executed by the processor, the data query method according to any one of claims 1 to 3 is performed.
Citation Information
Patent Citations
System management method and device, computer equipment and storage medium
CN110888901A
Interface data model conversion method, device, equipment and storage medium
CN112667720A