CN111198968A - Data query method and device - Google Patents

Data query method and device Download PDF

Info

Publication number
CN111198968A
CN111198968A CN201911277562.XA CN201911277562A CN111198968A CN 111198968 A CN111198968 A CN 111198968A CN 201911277562 A CN201911277562 A CN 201911277562A CN 111198968 A CN111198968 A CN 111198968A
Authority
CN
China
Prior art keywords
query
data
message
result
product
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911277562.XA
Other languages
Chinese (zh)
Inventor
刘永波
唐啸
张勇辉
肖雷
曾凡麟
王伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CCB Finetech Co Ltd
Original Assignee
China Construction Bank Corp
CCB Finetech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN201911277562.XA priority Critical patent/CN111198968A/en
Publication of CN111198968A publication Critical patent/CN111198968A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/103Workflow collaboration or project management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Human Resources & Organizations (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Signal Processing (AREA)
  • Economics (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a data query method and device, and relates to the technical field of computers. One embodiment of the method comprises: receiving a data query message, and determining a product contract corresponding to a sender of the data query message; generating a query member adapted to a receiver of the data query message according to the product contract; generating query results based on the query component query data; and generating a result file according to the query result, and returning the result file to the data query message sender. The implementation mode can realize the parameter configuration consistency of three stages of message access, query execution and query result output in the service flow by the mode of product contract configuration, reduce the error rate, reduce the repeated development and improve the system joint debugging test efficiency.

Description

Data query method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for querying data.
Background
At present, an external connection unit transacts inquiry business and needs to be in direct online connection and butt joint with a system of a financial institution. Because the system communication protocol and the data interaction message format of the external unit are different, the financial institution needs to specialize message analysis according to the message format of the external unit system. The external unit has rich and various combinations of the account number inquiry or account opening information, transaction details, held product information and the like of the client. The output format of the query result fed back by the external unit to the financial institution is different from the content requirement. The manual coding analysis of data interaction messages and the output of query results are not intuitive, the error rate is high, and the joint debugging test efficiency with an external authorized organ system is low.
At present, the system is usually docked with the external unit system in a one-to-one interface development mode, that is, the financial institution independently develops an internal system according to the interface requirement of the external unit system, and when a query result is generated and fed back to the external unit system, the query result is also based on the query product range hard-coded query logic required by the external unit.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
(1) the three stages of system message access, query execution and query result output in the whole business process are not configured by consistency parameters;
(2) manually coding and analyzing message data, and once a system interaction interface is adjusted, code adjustment is required; with the increase of external units, repeated logic development can occur, and the error rate of manual coding is higher;
(3) the content and format output by the query result are configured by manual coding, so that the error rate is high, and the system joint debugging test efficiency is greatly influenced.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for data query, which can implement consistency of parameter configuration in three stages of message access, query execution, and query result output in a business process by means of product contract configuration, reduce an error rate, reduce repetitive development, and improve efficiency of joint debugging test of a system.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method for querying data, including:
receiving a data query message, and determining a product contract corresponding to a sender of the data query message; generating a query member adapted to a receiver of the data query message according to the product contract;
generating query results based on the query component query data;
and generating a result file according to the query result, and returning the result file to the data query message sender.
Optionally, the product contract includes basic information, a protocol, and message information of a sender of the data query message; wherein the basic information includes product conditions; the protocol and message information comprises a protocol type, a data format and a message analysis rule;
generating a query component corresponding to the query request according to the target product contract, including: matching a target factory class according to the protocol type and the data format of the target product contract; analyzing the data query message according to the message analysis rule to obtain a data label; instantiating the target plant class according to the data tag and the product condition to generate the query building block using a reflection mechanism.
Optionally, the protocol and packet information further includes: IP and port;
determining a product contract corresponding to a sender of the data query message, including: and determining the IP and the port number carried by the data query message, and determining a product contract corresponding to a sender of the data query message according to the IP and the port number carried by the data query message.
Optionally, the product contract comprises: feeding back result information; the feedback result information comprises an output file name format and result content;
generating a result file according to the query result, comprising: and converting the query result into a target format and content according to the output file name format and the result content to obtain the result file.
Optionally, converting the query result into a target format and content, including: and converting the query result into a target format and content by adopting a template engine.
Optionally, before determining the product contract corresponding to the sender of the data query message, the method further includes: configuring each of the product contracts through a visualization interface.
According to a second aspect of the embodiments of the present invention, there is provided an apparatus for querying data, including:
the protocol adaptation module receives a data query message and determines a product contract corresponding to a sender of the data query message; generating a query member adapted to a receiver of the data query message according to the product contract;
the query execution module is used for generating a query result based on the query data of the query component;
and the result feedback module is used for generating a result file according to the query result and returning the result file to the data query message sender.
Optionally, the product contract includes basic information, a protocol, and message information of a sender of the data query message; wherein the basic information includes product conditions; the protocol and message information comprises a protocol type, a data format and a message analysis rule;
the protocol adaptation module generates a query component corresponding to the query request according to the target product contract, and the query component comprises: matching a target factory class according to the protocol type and the data format of the target product contract; analyzing the data query message according to the message analysis rule to obtain a data label; instantiating the target plant class according to the data tag and the product condition to generate the query building block using a reflection mechanism.
Optionally, the protocol and packet information further includes: IP and port;
the protocol adaptation module determines a product contract corresponding to a sender of the data query message, and the method comprises the following steps: and determining the IP and the port number carried by the data query message, and determining a product contract corresponding to a sender of the data query message according to the IP and the port number carried by the data query message.
Optionally, the product contract comprises: feeding back result information; the feedback result information comprises an output file name format and result content;
the result feedback module generates a result file according to the query result, and the result file comprises: and converting the query result into a target format and content according to the output file name format and the result content to obtain the result file.
Optionally, the result feedback module converts the query result into a target format and content, including: and converting the query result into a target format and content by adopting a template engine.
Optionally, the apparatus in the embodiment of the present invention further includes: and the visual configuration module is used for configuring each product contract through a visual interface before the protocol adaptation module determines the product contract corresponding to the sender of the data query message.
According to a third aspect of the embodiments of the present invention, there is provided an electronic device for data query, including:
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 are caused to implement the method provided by the first aspect of the embodiments of the present invention.
According to a fourth aspect of embodiments of the present invention, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the method provided by the first aspect of embodiments of the present invention.
One embodiment of the above invention has the following advantages or benefits: the invention regards the access of the external unit as a product contract, and realizes the parameter configuration consistency of three stages of message access, query execution and query result output in the business process by pre-configuring the product contract of each external unit, thereby reducing the error rate, reducing the repeated development and improving the system joint debugging test efficiency. And each product contract is configured through the visual interface, so that the data query message analysis, the query result output and the product contract configuration visualization can be realized.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main flow of a method of data querying according to an embodiment of the invention;
FIG. 2 is a schematic diagram of the main modules of an apparatus for data querying, according to an embodiment of the present invention;
FIG. 3 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 4 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
According to one aspect of the embodiments of the present invention, a method for data query is provided.
Fig. 1 is a schematic diagram of a main flow of a data query method according to an embodiment of the present invention, as shown in fig. 1, the data query method includes:
step S101, receiving a data query message, and determining a product contract corresponding to a sender of the data query message; generating a query member adapted to a receiver of the data query message according to the product contract;
step S102, generating a query result based on the query data of the query component;
step S103, generating a result file according to the query result, and returning the result file to the data query message sender.
Illustratively, the external unit sends a data query message to the financial institution, and after receiving the data query message, the financial institution determines a product contract corresponding to the external unit from the pre-configured product contracts. And generating a query member adapted to the financial institution system according to the determined product contract. Query results are generated based on the generated query building block query data. And generating a result file according to the generated query result, and returning the generated result file to the external unit.
The product contract comprises parameter configuration of three stages of message access, query execution and query result output of an external unit. By pre-configuring the product contract of the external unit, the parameter configuration consistency of three stages of message access, query execution and query result output in the business process can be realized.
The component is a reusable software module oriented to the software architecture. By generating the query component adapted to the receiver of the data query message according to the product contract, the protocol adaptation between the sender and the receiver of the data query message can be automatically realized, the analysis of a manually coded message, the query execution, the result feedback and the like are avoided, the error rate is reduced, and the system joint debugging test efficiency is improved. By pre-configuring the product contracts of all the external units, the repeated development can be reduced, and the system joint debugging testing efficiency is improved.
Optionally, the product contract includes basic information, a protocol, and message information of a sender of the data query message; wherein the basic information includes product conditions; the protocol and message information includes protocol type, data format, and message parsing rule. Generating a query component corresponding to the query request according to the target product contract, including: matching a target factory class according to the protocol type and the data format of the target product contract; analyzing the data query message according to the message analysis rule to obtain a data label; instantiating the target plant class according to the data tag and the product condition to generate the query building block using a reflection mechanism.
The product condition refers to various control parameters in the data query process, such as the name of a customer to be queried, the type of queried data, the time range and the like. The product condition can be represented by a product condition table, and the product condition can adopt a default configuration mode, namely, if the product condition parameter adopts default setting, the product condition parameter value does not need to be newly added in the product condition table of the contract.
In this embodiment, several Protocol types and data formats that are commonly used for implementing system interaction may be enumerated, for example, http (hypertext transfer Protocol), https (hypertext transfer Protocol over Secure Socket Layer), Socket (Socket), json (JavaScript Object Notation), xml (eXtensible Markup Language), and the like, and a factory class of a Protocol type and a data format is formed.
The query member is generated by adopting a factory mode, so that the expansibility is good, and the specific implementation process of data query can be shielded, so that a sender of the data query message only needs to pay attention to an interface of the data query message, and the use experience is improved.
In some embodiments, the base information of the product contract carries a product number and/or a product name. When the product contract corresponding to the sender of the data query message is determined, the corresponding product contract can be matched according to the product number and/or the product name carried in the data query message. In this embodiment, after the receiver of the data query message configures the product contract, the product number and/or the product name of the product contract are/is generated to the sender of the data query message, and an interface of the sender of the data query message is modified based on the product number and/or the product name, so that the product number and/or the product name are carried when the data query message is generated. The corresponding product contract is determined through the product number and/or the product name, so that the method is good in accuracy, simple and convenient.
In other embodiments, the agreement and message information of the product contract further includes: IP (Internet Protocol) and port; determining a product contract corresponding to a sender of the data query message, including: and determining the IP and the port number carried by the data query message, and determining a product contract corresponding to a sender of the data query message according to the IP and the port number carried by the data query message. On the one hand, the embodiment can accurately and quickly determine the product contract corresponding to the sender of the data query message, and on the other hand, because the IP and the port number are the inherent attribute information of each data message, the data interface of the sender of the data query message does not need to be modified, so that the use experience can be improved.
Optionally, the product contract comprises: feeding back result information; the feedback result information comprises an output file name format and result content; generating a result file according to the query result, comprising: and converting the query result into a target format and content according to the output file name format and the result content to obtain the result file. When the query result is converted into the target format and content, the query result can be realized through a reflection mechanism according to the protocol types of the receiver and the sender of the data query request. In the embodiment, feedback result information is configured in the product contract, and the result file is automatically generated according to the query result and the feedback result information, so that the feedback of manual coding results and the like can be avoided, the error rate is reduced, and the system joint debugging test efficiency is improved.
Optionally, converting the query result into a target format and content, including: and converting the query result into a target format and content by adopting a template engine. The template engine can be selectively set according to actual conditions, such as a template engine of Java freemaker, Velocity and the like.
Optionally, before determining the product contract corresponding to the sender of the data query message, the method further includes: configuring each of the product contracts through a visualization interface. And each product contract is configured through the visual interface, so that the data query message analysis, the query result output and the product contract configuration visualization can be realized.
According to a second aspect of the embodiments of the present invention, there is provided an apparatus for implementing the above method.
Fig. 2 is a schematic diagram of main blocks of an apparatus for data query according to an embodiment of the present invention. As shown in fig. 2, the apparatus 200 for data query includes:
the protocol adaptation module 201 is used for receiving a data query message and determining a product contract corresponding to a sender of the data query message; generating a query member adapted to a receiver of the data query message according to the product contract;
a query execution module 202 for generating a query result based on the query data of the query component;
and the result feedback module 203 generates a result file according to the query result, and returns the result file to the data query message sender.
Optionally, the product contract includes basic information, a protocol, and message information of a sender of the data query message; wherein the basic information includes product conditions; the protocol and message information comprises a protocol type, a data format and a message analysis rule;
the protocol adaptation module generates a query component corresponding to the query request according to the target product contract, and the query component comprises: matching a target factory class according to the protocol type and the data format of the target product contract; analyzing the data query message according to the message analysis rule to obtain a data label; instantiating the target plant class according to the data tag and the product condition to generate the query building block using a reflection mechanism.
Optionally, the protocol and packet information further includes: IP and port;
the protocol adaptation module determines a product contract corresponding to a sender of the data query message, and the method comprises the following steps: and determining the IP and the port number carried by the data query message, and determining a product contract corresponding to a sender of the data query message according to the IP and the port number carried by the data query message.
Optionally, the product contract comprises: feeding back result information; the feedback result information comprises an output file name format and result content;
the result feedback module generates a result file according to the query result, and the result file comprises: and converting the query result into a target format and content according to the output file name format and the result content to obtain the result file.
Optionally, the result feedback module converts the query result into a target format and content, including: and converting the query result into a target format and content by adopting a template engine.
Optionally, the apparatus in the embodiment of the present invention further includes: and the visual configuration module is used for configuring each product contract through a visual interface before the protocol adaptation module determines the product contract corresponding to the sender of the data query message.
According to a third aspect of the embodiments of the present invention, there is provided an electronic device for data query, including:
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 are caused to implement the method provided by the first aspect of the embodiments of the present invention.
According to a fourth aspect of embodiments of the present invention, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the method provided by the first aspect of embodiments of the present invention.
Fig. 3 illustrates an exemplary system architecture 300 of a data query method or a data query apparatus to which embodiments of the present invention may be applied.
As shown in fig. 3, the system architecture 300 may include external systems 301, 302, 303, a network 304, and a server 305. Network 304 serves as a medium for providing communication links between external systems 301, 302, 303 and server 305. Network 304 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use external systems 301, 302, 303 to interact with a server 305 over a network 304 to receive or send messages or the like. The external systems 301, 302, 303 may be a variety of electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 305 may be a server providing various services, such as a background management server (for example only) providing support for applications browsed by users using external systems 301, 302, 303. The backend management server may analyze and process the received data, such as the data query message, and feed back a processing result (e.g., a result file, which is merely an example) to the external system.
The data query method provided by the embodiment of the present invention is generally executed by the server 305, and accordingly, the data query apparatus is generally disposed in the server 305. It should be noted that, when the server calls the data of the external system, the server may send a data query message to the external system, at this time, the method for querying data provided in the embodiment of the present invention is generally executed by the external systems 301, 302, and 303, and accordingly, the device for querying data is generally disposed in the external systems 301, 302, and 303. When the external system 301 calls the data of the external system 302, the external system 302 may send a data query message, at this time, the method for querying data provided by the embodiment of the present invention is generally executed by the external system 302, and accordingly, a device for querying data is generally disposed in the external system 302.
It should be understood that the number of terminal devices, networks, and servers in fig. 3 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 4, a block diagram of a computer system 400 suitable for use with a terminal device implementing an embodiment of the invention is shown. The terminal device shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 4, the computer system 400 includes a Central Processing Unit (CPU)401 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage section 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for the operation of the system 400 are also stored. The CPU 401, ROM 402, and RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
The following components are connected to the I/O interface 405: an input section 406 including a keyboard, a mouse, and the like; an output section 407 including a display device such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 408 including a hard disk and the like; and a communication section 409 including a network interface card such as a LAN card, a modem, or the like. The communication section 409 performs communication processing via a network such as the internet. A driver 410 is also connected to the I/O interface 405 as needed. A removable medium 411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 410 as necessary, so that a computer program read out therefrom is mounted into the storage section 408 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 409, and/or installed from the removable medium 411. The computer program performs the above-described functions defined in the system of the present invention when executed by a Central Processing Unit (CPU) 401.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor comprising: the protocol adaptation module receives a data query message and determines a product contract corresponding to a sender of the data query message; generating a query member adapted to a receiver of the data query message according to the product contract; the query execution module is used for generating a query result based on the query data of the query component; and the result feedback module is used for generating a result file according to the query result and returning the result file to the data query message sender. The names of these modules do not in some cases form a limitation on the modules themselves, for example, the protocol adaptation module may also be described as a "module that generates a result file from the query result".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: receiving a data query message, and determining a product contract corresponding to a sender of the data query message; generating a query member adapted to a receiver of the data query message according to the product contract; generating query results based on the query component query data; and generating a result file according to the query result, and returning the result file to the data query message sender.
According to the technical scheme of the embodiment of the invention, the access of the external units is regarded as a product contract, and the consistency of parameter configuration in three stages of message access, query execution and query result output in a business process is realized by pre-configuring the product contracts of the external units, so that the error rate is reduced, the repeated development is reduced, and the system joint debugging test efficiency is improved. And each product contract is configured through the visual interface, so that the data query message analysis, the query result output and the product contract configuration visualization can be realized.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method of data querying, comprising:
receiving a data query message, and determining a product contract corresponding to a sender of the data query message; generating a query member adapted to a receiver of the data query message according to the product contract;
generating query results based on the query component query data;
and generating a result file according to the query result, and returning the result file to the data query message sender.
2. The method of claim 1, wherein the product contract includes basic information, protocol and message information of a sender of the data query message; wherein the basic information includes product conditions; the protocol and message information comprises a protocol type, a data format and a message analysis rule;
generating a query component corresponding to the query request according to the target product contract, including: matching a target factory class according to the protocol type and the data format of the target product contract; analyzing the data query message according to the message analysis rule to obtain a data label; instantiating the target plant class according to the data tag and the product condition to generate the query building block using a reflection mechanism.
3. The method of claim 2, wherein the protocol and messaging information further comprises: IP and port;
determining a product contract corresponding to a sender of the data query message, including: and determining the IP and the port number carried by the data query message, and determining a product contract corresponding to a sender of the data query message according to the IP and the port number carried by the data query message.
4. The method of claim 1, wherein the product contract comprises: feeding back result information; the feedback result information comprises an output file name format and result content;
generating a result file according to the query result, comprising: and converting the query result into a target format and content according to the output file name format and the result content to obtain the result file.
5. The method of claim 4, wherein converting the query results to a target format and content comprises: and converting the query result into a target format and content by adopting a template engine.
6. The method of any of claims 1-5, wherein prior to determining the production contract corresponding to the sender of the data query message, further comprising: configuring each of the product contracts through a visualization interface.
7. An apparatus for querying data, comprising:
the protocol adaptation module receives a data query message and determines a product contract corresponding to a sender of the data query message; generating a query member adapted to a receiver of the data query message according to the product contract;
the query execution module is used for generating a query result based on the query data of the query component;
and the result feedback module is used for generating a result file according to the query result and returning the result file to the data query message sender.
8. The apparatus of claim 7, wherein the product contract includes basic information, protocol and message information for a sender of the data query message; wherein the basic information includes product conditions; the protocol and message information comprises a protocol type, a data format and a message analysis rule;
the protocol adaptation module generates a query component corresponding to the query request according to the target product contract, and the query component comprises: matching a target factory class according to the protocol type and the data format of the target product contract; analyzing the data query message according to the message analysis rule to obtain a data label; instantiating the target plant class according to the data tag and the product condition to generate the query building block using a reflection mechanism.
9. An electronic device for data query, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-6.
CN201911277562.XA 2019-12-11 2019-12-11 Data query method and device Pending CN111198968A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911277562.XA CN111198968A (en) 2019-12-11 2019-12-11 Data query method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911277562.XA CN111198968A (en) 2019-12-11 2019-12-11 Data query method and device

Publications (1)

Publication Number Publication Date
CN111198968A true CN111198968A (en) 2020-05-26

Family

ID=70744331

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911277562.XA Pending CN111198968A (en) 2019-12-11 2019-12-11 Data query method and device

Country Status (1)

Country Link
CN (1) CN111198968A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2925251A1 (en) * 2015-03-30 2016-09-30 Jerry Steven Massey System and methods for improved demand response management system (drms)
CN106326361A (en) * 2016-08-10 2017-01-11 中国农业银行股份有限公司 HBase database-based data inquiry method and device
CN109145025A (en) * 2018-09-14 2019-01-04 阿里巴巴集团控股有限公司 A kind of data query method, apparatus and service server that multi-data source is integrated
CN109492138A (en) * 2018-10-22 2019-03-19 中国银行股份有限公司 A kind of data query processing method and system
CN110019350A (en) * 2017-07-28 2019-07-16 北京京东尚科信息技术有限公司 Data query method and apparatus based on configuration information

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2925251A1 (en) * 2015-03-30 2016-09-30 Jerry Steven Massey System and methods for improved demand response management system (drms)
CN106326361A (en) * 2016-08-10 2017-01-11 中国农业银行股份有限公司 HBase database-based data inquiry method and device
CN110019350A (en) * 2017-07-28 2019-07-16 北京京东尚科信息技术有限公司 Data query method and apparatus based on configuration information
CN109145025A (en) * 2018-09-14 2019-01-04 阿里巴巴集团控股有限公司 A kind of data query method, apparatus and service server that multi-data source is integrated
CN109492138A (en) * 2018-10-22 2019-03-19 中国银行股份有限公司 A kind of data query processing method and system

Similar Documents

Publication Publication Date Title
CN108574604B (en) Test method and device
CN110795147A (en) Interface protocol file management method and device
CN112633691A (en) Method and device for generating custom approval process
CN109040326A (en) The method and apparatus of PUSH message
US20230185584A1 (en) Custom publisher system integration
US20200111487A1 (en) Voice capable api gateway
WO2018177032A1 (en) Method and device for processing response data, client device and electronic device
CN112653614A (en) Request processing method and device based on message middleware
CN111787041B (en) Method and device for processing data
CN112947919A (en) Method and device for constructing service model and processing service request
CN112990991B (en) Method and device for combined invoicing
CN112685481B (en) Data processing method and device
CN111198968A (en) Data query method and device
CN113485902B (en) Method, device, equipment and computer readable medium for testing service platform
CN114125066B (en) Method and device for processing service request
CN114625458A (en) Page data processing method and device, electronic equipment and storage medium
CN113779018A (en) Data processing method and device
CN109889402B (en) Method and apparatus for generating information
CN113779122A (en) Method and apparatus for exporting data
CN111949472A (en) Method and device for recording application logs
CN113468041A (en) Interface comparison test method and device
CN109542646A (en) Method and apparatus for calling application programming interface
CN112825107B (en) Method and device for generating chart
CN114253520B (en) Interface code generation method and device
CN110019030B (en) Method and device for dividing file

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20220923

Address after: 12 / F, 15 / F, 99 Yincheng Road, China (Shanghai) pilot Free Trade Zone, Pudong New Area, Shanghai, 200120

Applicant after: Jianxin Financial Science and Technology Co.,Ltd.

Address before: 25 Financial Street, Xicheng District, Beijing 100033

Applicant before: CHINA CONSTRUCTION BANK Corp.

Applicant before: Jianxin Financial Science and Technology Co.,Ltd.

TA01 Transfer of patent application right