CN115062043A - Data query method, device, equipment and medium for cross-line message - Google Patents

Data query method, device, equipment and medium for cross-line message Download PDF

Info

Publication number
CN115062043A
CN115062043A CN202210676962.3A CN202210676962A CN115062043A CN 115062043 A CN115062043 A CN 115062043A CN 202210676962 A CN202210676962 A CN 202210676962A CN 115062043 A CN115062043 A CN 115062043A
Authority
CN
China
Prior art keywords
cross
query
row
databases
message
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
CN202210676962.3A
Other languages
Chinese (zh)
Inventor
黄金芳
陆杨芳
王宝利
王淑美
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202210676962.3A priority Critical patent/CN115062043A/en
Publication of CN115062043A publication Critical patent/CN115062043A/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/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure provides a data query method for a cross-line message, and relates to the financial field or other fields. The method comprises the following steps: obtaining N first keywords in a cross-line message to be inquired; determining preset query rules matched with the N first keywords from preset query rule bases of M databases, wherein the preset query rule bases comprise preset query rules corresponding to each database, and the preset query rules between at least two databases in the M databases are different; generating a first query statement of at least one database in the M databases according to the N first keywords and the matched preset query rule; and querying the target service data in the corresponding database by using the first query statement of the at least one database. The disclosure also provides a data query apparatus, device, storage medium and program product for a cross-line message.

Description

Data query method, device, equipment and medium for cross-line message
Technical Field
The present disclosure relates to the financial and other fields, and more particularly, to a data query method, apparatus, device, medium, and program product for a cross-line message.
Background
The business-crossing business of commercial bank and Chinese people's bank (hereafter referred to as "people") are transacted interactively through the cross-bank message. Transaction processing of a cross-row business is often participated by one or more cross-row applications inside a commercial bank, so that data query is related to cross-different types of databases and switching of data structures in different database tables.
Under the above circumstances, it is necessary for a person who develops or tests the logic of the whole business process to be familiar with the logic of the whole business process, so as to query different data records of the whole processing process. However, each person for development or testing may only be responsible for local work content, and there is a dependence on service familiarity, so that it is difficult to smoothly query different data records related to a cross-row message for processing a cross-row service, resulting in low efficiency in research and development, testing, or querying data.
Disclosure of Invention
In view of the foregoing, the present disclosure provides a data query method, apparatus, device, medium, and program product for a cross-line message.
One aspect of the embodiments of the present disclosure provides a data query method for a cross-line packet, including: obtaining N first keywords in a cross-line message to be inquired, wherein N is an integer greater than or equal to 1; determining preset query rules matched with the N first keywords from preset query rule bases of M databases, wherein the preset query rule bases comprise preset query rules corresponding to each database, the preset query rules between at least two databases in the M databases are different, the M databases are used for storing at least one cross-row applied service data, and M is an integer greater than or equal to 2; generating a first query statement of at least one database in the M databases according to the N first keywords and the matched preset query rule; and querying the target service data in the corresponding database by using the first query statement of the at least one database.
According to an embodiment of the present disclosure, the obtaining N first keywords in the to-be-queried cross-line message includes: receiving the N first keywords input by a user; before determining the preset query rule matched with the N first keywords from the preset query rule base of the M databases, the method further includes: and acquiring the message type and/or the service scene of the cross-line message to be inquired, which are determined by the user, wherein the message type comprises the type of the cross-line service to which the cross-line message to be inquired belongs, and the service scene is acquired according to the execution result of the cross-line service to which the cross-line message to be inquired belongs.
According to an embodiment of the present disclosure, the determining the preset query rule matched with the N first keywords from the preset query rule base of the M databases includes: filtering preset query rule bases of the M databases based on the message type and/or the service scene of the cross-row message to be queried; and determining the matched preset query rule from the filtered preset query rule base of the M databases.
According to an embodiment of the present disclosure, before determining the preset query rule matching the N first keywords from a preset query rule base of M databases, the method further includes: obtaining S historical cross-row messages, wherein S is an integer greater than or equal to 1; and obtaining a preset query rule base of the M databases according to at least one second query statement corresponding to the S historical cross-row messages, wherein each second query statement is used for querying the service data from the corresponding database of the M databases.
According to the embodiment of the present disclosure, after obtaining S historical row-spanning messages, obtaining at least one second query statement corresponding to the S historical row-spanning messages further includes: extracting at least one second keyword from the S historical cross-line messages; and obtaining at least one second query statement corresponding to the S historical cross-row messages according to the at least one second keyword.
According to an embodiment of the present disclosure, further comprising: determining the at least one cross-row application associated with the S historical cross-row packets; acquiring first log data of the at least one cross-row application; wherein the obtaining, according to the at least one second keyword, at least one second query statement corresponding to the S historical cross-row messages includes: and obtaining at least one second query statement corresponding to the S historical cross-row messages from the first log data according to the at least one second keyword.
According to an embodiment of the present disclosure, the obtaining, according to the at least one second keyword, at least one second query statement corresponding to the S historical inter-row packets from the first log data includes: determining a log identifier corresponding to the at least one second keyword, wherein the log identifier is used for determining corresponding second log data from the first log data; and acquiring the at least one second query statement from the second log data.
According to the embodiment of the present disclosure, after obtaining S historical cross-row messages, the method further includes: when a user inquires the service data according to the S historical line crossing messages, recording at least one third inquiry statement manually input by the user; taking the at least one third query statement as the at least one second query statement.
According to an embodiment of the present disclosure, the preset query rule base of the M databases is obtained according to at least one second query statement corresponding to the S historical cross-row messages: obtaining a database table name and a query condition from each second query statement; and determining a preset query rule corresponding to the database according to the database table name and the query condition in each second query statement.
According to the embodiment of the present disclosure, after S historical cross-row messages are obtained, the method further includes: obtaining a message type and/or a service scene of each historical cross-row message, wherein the message type comprises a cross-row service type of each historical cross-row message, and the service scene is obtained according to an execution result of the cross-row service of each historical cross-row message; and classifying the preset query rules of each database according to the message type and/or the service scene of each historical cross-row message.
Another aspect of the embodiments of the present disclosure provides a data query apparatus for a cross-line packet, including: the keyword module is used for obtaining N first keywords in the cross-line message to be inquired, wherein N is an integer greater than or equal to 1; a matching rule module, configured to determine a preset query rule matched with the N first keywords from preset query rule bases of M databases, where the preset query rule bases include a preset query rule corresponding to each database, the preset query rules between at least two of the M databases are different, the M databases are used to store at least one cross-row applied service data, and M is an integer greater than or equal to 2; a statement generating module, configured to generate a first query statement for at least one database of the M databases according to the N first keywords and the matched preset query rule; and the data query module is used for querying the target service data in the corresponding database by using the first query statement of the at least one database.
Another aspect of the disclosed embodiments provides an electronic device, including: one or more processors; a storage device to store one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method as described above.
Yet another aspect of the embodiments of the present disclosure provides a computer-readable storage medium having stored thereon executable instructions, which when executed by a processor, cause the processor to perform the method as described above.
Yet another aspect of the disclosed embodiments provides a computer program product comprising a computer program that when executed by a processor implements the method as described above.
One or more of the above embodiments have the following advantageous effects: and determining a preset query rule matched with the N first keywords from a preset query rule base of the M databases, and generating a first query statement according to the preset query rule corresponding to at least one database, so that the target service data in the corresponding database can be queried. Therefore, the personnel for development or test and the like can obtain the query results of the cross-application, cross-database and different database tables related to the cross-row message to be queried by virtue of the N first keywords, and at least partially solve the problem that the personnel for development or test and the like switch queries back and forth among different applications, different databases and different database tables.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be apparent from the following description of embodiments of the disclosure, which proceeds with reference to the accompanying drawings, in which:
fig. 1 schematically illustrates an application scenario diagram of a data query method for a cross-row packet according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow diagram of a data query method for a cross-row message according to an embodiment of the disclosure;
FIG. 3 schematically illustrates a flow diagram of a data query method for a cross-row message according to another embodiment of the present disclosure;
FIG. 4 schematically illustrates a flow diagram for obtaining a preset query rule base according to an embodiment of the present disclosure;
FIG. 5 schematically shows a flow diagram for obtaining a second query statement according to an embodiment of the disclosure;
FIG. 6 schematically shows a flow diagram for obtaining a second query statement according to another embodiment of the present disclosure;
FIG. 7 schematically shows a flow diagram for obtaining a second query statement according to another embodiment of the present disclosure;
FIG. 8 schematically shows a flow diagram for obtaining a second query statement according to another embodiment of the present disclosure;
FIG. 9 schematically illustrates a flow diagram for obtaining preset query rules, in accordance with an embodiment of the present disclosure;
FIG. 10 schematically illustrates a flow chart for classifying preset query rules according to an embodiment of the present disclosure;
FIG. 11 is a block diagram schematically illustrating a data query apparatus for a cross-row message according to an embodiment of the present disclosure; and
FIG. 12 schematically illustrates a block diagram of an electronic device suitable for implementing a data query method for a cross-row message according to an embodiment of the disclosure.
Detailed Description
In order to facilitate understanding of technical solutions of the embodiments of the present application, some technical terms related to the present application are first described.
Cross-row service: an interactive financial transaction is conducted between two different banks. Such as inter-bank transfer between two commercial banks or inter-bank payment, in which case the transfer is performed by a person. Such as interaction between commercial banks and pedestrians, and data query or report.
And (3) line crossing message: in the process of processing the cross-bank service, the information files need to be directly interacted with systems of the pedestrian and the like, or transferred and sent by the systems of the pedestrian and the like, and the information files of data of money, payees and the like are transmitted.
And (3) across-row application: applications involving one or more links in the course of cross-bank transactions within the system of commercial banks.
And (4) inquiring rules: and may include attributes such as naming of the database, syntax requirements, data type, format of the data table, name of the database table, and data structure. According to the query statement obtained by the rule, the database system can analyze the query statement and return a query result.
Data structure: it may include the relationship between database tables (for example, the relationship between tables when storing data by using sub-database and sub-table), and the number, type, content, property and the relation between fields in a certain database table.
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
The cross-bank message is used as a way for exchanging information between bank systems, and may include a cross-bank receiving message and a cross-bank sending message, such as a cross-bank remittance message, a pedestrian clearing message, or an information query message sent to a pedestrian.
Taking the cross-bank remittance message as an example, the user sends a remittance request through a channel application (such as mobile banking, payment treasure or WeChat). When processing the remittance request, the user account status may be inquired, whether the balance is enough, whether the target bank supports remittance, whether the target account can receive remittance, and other intermediate steps, and finally a trans-bank remittance message is generated and sent to the bank. Taking the human line clearing message as an example, after receiving the human line clearing message, the account sorting processing is performed first. The accounts are queried by a cross-line application (e.g., a personal account system) and account sort results are returned. And then, carrying out accounting processing according to the account sorting result to obtain an accounting result.
Each of the above steps of querying data, assembling messages, routing, sending messages, or billing may involve a corresponding cross-line application platform. Different types of databases, such as a relational database, a non-relational database, or a key-value database, may exist between the cross-row application platforms, and may also correspond to databases of different manufacturers. The query rules of databases of different types or different manufacturers may be different, and due to the functional difference of the cross-row application platform or the performance difference of the databases, the data structures in the databases may not be consistent. Therefore, switching of multiple applications across different types of databases needs to be performed by knowing the data structures of different database tables of different platforms, which causes difficulty in smoothly querying different data records related to a row-crossing message for processing a row-crossing service by development or test personnel.
The embodiment of the disclosure provides a data query method, a device, equipment, a medium and a program product for a cross-row message. And determining a preset query rule matched with the N first keywords from a preset query rule base of the M databases, and generating a first query statement according to the preset query rule corresponding to at least one database, so that the target service data in the corresponding database can be queried. Therefore, the query results of the cross-application, cross-database and different database tables related to the cross-row message to be queried can be obtained through the N first keywords, and the problem that personnel for development or testing and the like switch queries back and forth between different applications, different databases and different database tables is at least partially solved.
It should be noted that the data query method, apparatus, device, medium, and program product for a cross-row packet provided in the embodiments of the present disclosure may be used in related aspects of cross-row packet processing in the financial field, and may also be used in packet processing in any field except the financial field.
Fig. 1 schematically shows an application scenario diagram of a data query method for a cross-row packet according to an embodiment of the present disclosure.
As shown in fig. 1, the application scenario 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal devices 101, 102, 103 to interact with a server 105 over a network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (for example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and perform other processing on the received data such as the user request, and feed back a processing result (e.g., a webpage, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the data query method for the cross-row message provided by the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the data query apparatus for a cross-line message provided by the embodiment of the present disclosure may be generally disposed in the server 105. The data query method for the cross-row packet provided by the embodiment of the present disclosure may also be executed by a server or a server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and/or the server 105. Correspondingly, the data query apparatus for a cross-row message provided in the embodiment of the present disclosure may also be disposed in a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, and 103 and/or the server 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The following describes in detail a data query method for a cross-row packet according to an embodiment of the present disclosure with reference to fig. 2 to 10 based on the scenario described in fig. 1.
Fig. 2 schematically shows a flowchart of a data query method for a cross-row message according to an embodiment of the present disclosure.
As shown in fig. 2, the data query method for a cross-line message according to this embodiment includes operations S210 to S240.
In operation S210, N first keywords in the line crossing message to be queried are obtained, where N is an integer greater than or equal to 1.
Illustratively, the cross-line message to be queried may be a target message determined by a person who develops or tests, etc., and may be a message that the bank system has finished processing and returned the customer's results. The N first keywords may be keywords such as ID, amount, target bank account, and user account of the message.
Illustratively, the input line-crossing message may be automatically recognized, such as field parsing according to a message specification, or ocr (optical Character recognition) recognition in the case of displaying the message content in a picture.
In operation S220, a preset query rule matched with the N first keywords is determined from preset query rule bases of M databases, where the preset query rule bases include a preset query rule corresponding to each database, the preset query rules between at least two of the M databases are different, the M databases are used to store at least one cross-row applied service data, and M is an integer greater than or equal to 2.
For example, each database may be configured with a corresponding query rule in advance to form a preset query rule base. The correspondence of each database to one or more query rules may be included within the query rule base. For example, the first keyword may be searched in a preset query rule base, and a matching query rule may be determined according to the searched result. In addition, the searched result may not include the query rule corresponding to the whole database.
For example, an expert may be made to compile preset query rules for each database based on expert experience.
For example, each database may correspond to a different cross-row application platform, and may have a different data type or data structure, which results in different preset query rules between at least two databases.
In operation S230, a first query statement of at least one database of the M databases is generated according to the N first keywords and the matched preset query rule.
For example, the matched preset query rule may include a general query statement conforming to the corresponding database, for example, the structure of the general query statement is constructed according to attributes such as naming of the database, syntax requirement, data type, format of the data table, name of the database table, and data structure, wherein one or more parameters are represented by variables such as ID, amount of money, target bank account, and user account of the message. One or more variables may be assigned according to the first keyword to obtain a first query statement corresponding to the database.
Illustratively, the Query statement may be constructed according to the syntax requirement of the database according to a Structured Query Language (SQL).
In operation S240, target business data in a corresponding database is queried using a first query statement of at least one database.
Illustratively, the target business data is business data that is retrieved and returned from a database table by the database management system parsing the first query statement.
According to the embodiment of the disclosure, the preset query rule matched with the N first keywords is determined from the preset query rule base of the M databases, and the first query statement is generated according to the preset query rule corresponding to at least one database, so that the target service data in the corresponding database can be queried. Therefore, the query results of the cross-application, cross-database and different database tables related to the cross-row message to be queried can be obtained through the N first keywords, and the problem that personnel for development or testing and the like switch queries back and forth between different applications, different databases and different database tables is at least partially solved.
Fig. 3 schematically shows a flow chart of a data query method for a cross-row message according to another embodiment of the present disclosure.
As shown in fig. 3, the data query method for the cross-line message of this embodiment includes operations S310 to S340, and operations S230 to S240. Wherein operation S310 is one of the embodiments of operation S210, and operation S330 and operation S340 are one of the embodiments of operation S220. Operation S320 may be performed before operation S220. Operations S230 to S240 refer to the above embodiments, and are not described herein.
In operation S310, N first keywords input by a user are received.
Illustratively, the user may include a person who develops or tests, etc. For example, the user can select keywords according to the content in the cross-line message to be queried to input the query.
In operation S320, a message type and/or a service scenario of the to-be-queried cross-line message determined by the user is obtained, where the message type includes a type of a cross-line service to which the to-be-queried cross-line message belongs, and the service scenario is obtained according to an execution result of the cross-line service to which the to-be-queried cross-line message belongs.
Illustratively, the message type may include a credit service message, a debit service message, or a query message. The business scenario may include a success scenario or a failure scenario (e.g., a failure due to the current reason, a failure due to a practical reason, or a failure due to a human system).
In operation S330, preset query rule bases of the M databases are filtered based on the message type and/or the service scenario of the cross-line message to be queried.
For example, the query rules may be classified in advance, for example, the packet type and/or the service scenario to which the query rules belong may be labeled during storage. Therefore, the query rule with the label of the type and/or the service scene selected by the user is obtained during query, the filtering effect is realized, and the query efficiency is improved.
In operation S340, a matching preset query rule is determined from the preset query rule base of the filtered M databases.
According to the embodiment of the disclosure, the data range can be reduced by combining keywords, message types and/or service scenes, and the efficiency of data query is improved.
Before determining the preset query rule matching with the N first keywords in the embodiment corresponding to fig. 2 or fig. 3, the preset query rule base of the M databases may be configured in advance. As described in detail below.
Fig. 4 schematically shows a flowchart for obtaining a preset query rule base according to an embodiment of the present disclosure.
As shown in fig. 4, obtaining the preset query rule base in this embodiment includes operations S410 to S420.
In operation S410, S historical cross-row messages are obtained, where S is an integer greater than or equal to 1.
Illustratively, the user may import or paste the processed datagram message.
In operation S420, a preset query rule base of the M databases is obtained according to at least one second query statement corresponding to the S historical cross-row messages, where each second query statement is used to query the service data from the corresponding database in the M databases.
According to the embodiment of the disclosure, since one of the functions of the preset query rule is to automatically generate the query statement according to the keyword, the preset query rule base can be obtained according to the used query statement in the historical cross-line message. The method has the effects of reducing the business logic experience requirements on related personnel, reducing the dependence on the preset query rule of expert personnel and accurately obtaining the preset query rule.
FIG. 5 schematically shows a flow diagram for obtaining a second query statement according to an embodiment of the disclosure.
As shown in fig. 5, the embodiment obtains the second query statement includes operations S510 to S520.
In operation S510, at least one second keyword is extracted from the S historical cross-row messages.
The second keyword may also be obtained by message parsing or OCR recognition, for example. The type of the at least one second keyword comprises types of the N first keywords, namely types of message ID, account or amount and the like.
In operation S520, at least one second query statement corresponding to the S historical cross-row messages is obtained according to the at least one second keyword.
According to the embodiment of the disclosure, the second query statement includes the second keyword to implement reading or writing of the service data. Therefore, the second query statement can be accurately queried through the second keyword.
FIG. 6 schematically shows a flow diagram for obtaining a second query statement according to another embodiment of the disclosure.
As shown in fig. 6, the embodiment obtains the second query statement includes operations S610 to S630. Among them, operations S610 to S620 may be performed between operations S510 and S520. Operation S630 is one embodiment of operation S520.
At operation S610, at least one cross-row application associated with S historical cross-row packets is determined.
Illustratively, the associated at least one cross-line application includes an application participating in one or more links in the process of processing the cross-line business to which the historical cross-line message belongs, such as the personal account system at the account sorting department after receiving the human clearing message, and an accounting system.
In operation S620, first log data of at least one cross-line application is acquired.
Illustratively, during the operation of the cross-line application, the print log can help to know the operation content, the operation condition and the problem location, and the log data can include the data processing record associated with each historical cross-line message. For example, for a human clearing message, the operations of sorting and billing the account for the message may be output to the log by the cross-row application.
In operation S630, at least one second query statement corresponding to the S historical row-crossing messages is obtained from the first log data according to the at least one second keyword.
According to the embodiment of the disclosure, each historical cross-row message may correspond to more log data and more query statements, and the second query statement which can be utilized can be quickly and accurately obtained by utilizing the second keyword.
FIG. 7 schematically shows a flow diagram for obtaining a second query statement according to another embodiment of the disclosure.
As shown in fig. 7, obtaining the second query statement in operation S630 includes operations S710 to S720.
In operation S710, a log identifier corresponding to at least one second keyword is determined, and the log identifier is used to determine corresponding second log data from the first log data.
Illustratively, a log identification may be used throughout the call link, such as a uuid number, thread number, or other customized identification, and so forth. Taking the thread number as an example, each piece of log information carries a hexadecimal value formed by 8 characters for marking the thread number, and the log information records application activity information. Wherein each piece of log information may be a row of log contents in the first log data.
Illustratively, the second log data may be partial data of the first log data, which may include a plurality of pieces of log information having the same thread number. The reason why the log identifier is used for determining the corresponding second log data from the first log data is that during the operation of the cross-line application, more logs may be printed at the same time, for example, a plurality of threads are executed at the same time, so that the logs of the threads are interspersed with each other. Therefore, the corresponding log content can be determined more quickly by the thread number called when a certain historical cross-line message is processed.
In operation S720, at least one second query statement is obtained from the second log data.
Illustratively, the multi-application log (for example, the log of the application related to account sorting, group reporting, routing or accounting) involved is associated, the first log data is searched by the keywords of the input fields of message ID, amount and the like, and the log unique identifier is obtained: and traversing the second log data of each cross-row application according to the thread number to obtain an insert/update SQL statement, and obtaining a table name and query conditions.
According to the embodiment of the disclosure, the corresponding second query statement can be quickly and accurately acquired by using the second log data. In addition, obtaining the SQL statement of insert/update as the second query statement can further improve efficiency, because insert/update is used for writing or updating data, while the SQL statement of delete may not exist after being executed, and there is no need for query subsequently.
FIG. 8 schematically shows a flow diagram for obtaining a second query statement according to another embodiment of the present disclosure.
As shown in fig. 8, obtaining the second query statement of this embodiment includes operations S810 to S820.
In operation S810, when the user queries service data according to the S historical cross-line messages, at least one third query statement manually input by the user is recorded.
At least one third query statement is treated as at least one second query statement in operation S820.
For example, a manual query channel may be provided, and the user inputs a third query statement, and automatically learns and stores the third query statement, which is used for multiple times and can correctly query the result, in a default query configuration corresponding to the service scenario or the message type. For example, in the account sorting stage of a plurality of historical clearing messages, a third query statement is input into the personal account system and the public account system respectively, an operation of manually querying the account type is performed, and if a sorting result is successfully returned for more than or equal to 10 times (for example only), the third query statement used in the 10 times is taken as a second query statement.
It can be understood that the second query statement obtained through the manual query channel and the second query statement obtained through the log output by the application belong to different channels, so that the flexibility of obtaining the second query statement is improved. For example, the query rule may be set in advance only by a query statement manually input by the user. The second query statement may be obtained through the manual query channel in a case where the first log data of the cross-row application cannot be obtained (e.g., no log is available to the application host) in operation S620. The second query statement may also be obtained through a manual query channel in a case where there is no query statement in the second log data (e.g., in a case of SQL in which the log is not printed).
Fig. 9 schematically shows a flowchart for obtaining preset query rules according to an embodiment of the present disclosure.
As shown in fig. 9, the obtaining of the preset query rule base in operation S420 includes operations S910 to S920.
In operation S910, a database table name and a query condition are obtained from each second query statement.
In operation S920, according to the database table name and the query condition in each second query statement, a preset query rule corresponding to the database is determined.
Illustratively, the database table name is used for the database management system to return the target business data from the corresponding database table according to the query condition. The query condition is used for querying data meeting the condition. Taking the second query statement as an insert statement, the format may be:
INSERT INTO table_name
VALUES(valuel,value2,value3,…);
the database table name can be determined according to the table _ name, and the query condition can be determined according to values 1, 2 and 3. For example, constructing the preset query rule according to the query condition may include a select statement in the format of "select field name from database table name where query condition". One or more of the keywords, the database table names, and the query conditions may be abstracted and expressed as variables.
In operation S220, first, it may be determined which databases contain relevant data according to the first key, for example, the database storing the corresponding data according to the message ID. Then, the database table in the database is determined according to the user account 1234, and the database table name B is obtained. Finally, the field name is denoted by "+", the user account is used as a query condition, and the first query statement is "select" + "from B where account is 1234".
Illustratively, the preset query rule base may be implemented in the form of a mapping table, such as an excel table or a database table, including mapping relationships between each database and one or more query rules.
Fig. 10 schematically shows a flowchart for classifying preset query rules according to an embodiment of the present disclosure.
As shown in fig. 10, the classifying the preset query rule in this embodiment includes operations S1010 to S1020.
In operation S1010, a message type and/or a service scenario of each historical cross-line packet is obtained, where the message type includes a type of a cross-line service to which each historical cross-line packet belongs, and the service scenario is obtained according to an execution result of the cross-line service to which each historical cross-line packet belongs.
In operation S1020, the preset query rules of each database are classified according to the packet type and/or the service scenario of each historical cross-row packet.
Illustratively, the classification process may mark each preset query rule with a corresponding type tag and a corresponding scene tag. The corresponding relation can be obtained according to which second query language the preset query rule is according to, and the message type and/or the service scene of the historical cross-line message corresponding to the second query language is the label result of the preset query rule.
According to the embodiment of the disclosure, since the message type of each historical cross-row message and the execution result of the cross-row service determine which applications or databases manage corresponding data, the message type is used as a first dimension and the mining of the service scene is used as a second dimension when extracting the keywords of the received and sent messages, so as to form the default query configuration. The method can allow the user to select according to the message type and/or the service scene of the cross-line message to be inquired, thereby improving the data inquiry efficiency.
Based on the data query method for the cross-row message, the disclosure also provides a data query device for the cross-row message. The apparatus will be described in detail below with reference to fig. 11.
Fig. 11 schematically shows a block diagram of a data query apparatus for a cross-row message according to an embodiment of the present disclosure.
As shown in fig. 11, the data query apparatus 1100 for a cross-line message of this embodiment may include a keyword module 1110, a matching rule module 1120, a statement generation module 1130, and a data query module 1140.
The keyword module 1110 may perform operation S210, for obtaining N first keywords in the line crossing message to be queried, where N is an integer greater than or equal to 1.
The matching rule module 1120 may perform operation S230, configured to determine a preset query rule matching the N first keywords from a preset query rule base of M databases, where the preset query rule base includes a preset query rule corresponding to each database, the preset query rules between at least two of the M databases are different, the M databases are used to store at least one service data applied across rows, and M is an integer greater than or equal to 2.
The statement generating module 1130 may perform operation S230, and is configured to generate a first query statement of at least one database of the M databases according to the N first keywords and the matched preset query rule.
The data query module 1140 may perform operation S240 for querying the target business data in the corresponding database using the first query statement of the at least one database.
According to an embodiment of the present disclosure, the keyword module 1110 may perform operation S310, and the data query apparatus 1100 may include a user input module for performing operation S320. The matching rule module 1120 may perform operations S330 to S340, which are not described herein.
According to an embodiment of the present disclosure, the data querying device 1100 may include a querying rule configuration module, configured to perform one or more of operations S410 to S420, operations S510 to S520, operations S610 to S630, operations S710 to S720, operations S810 to S820, operations S910 to S920, and operations S1010 to S1020, which will not be described herein again.
In some embodiments, the following steps may be performed using the data query apparatus 1100 to implement data queries for cross-row messages.
1. Providing a message: import/paste the report receiving and sending message.
2. Extracting keywords: extracting keywords of the receiving and sending messages to generate (1) retrieval keywords: the information such as message ID, amount, account number, etc. (2) A query SQL configures keywords: and taking the message type as a first dimension and the mining of the service scene as a second dimension for forming default query configuration.
3. Automatic association log acquisition query SQL: correlating related multi-application logs, searching the multi-application logs by keywords of input fields such as message ID, amount and the like to obtain a log unique identifier: the thread number. And traversing the log according to the thread number to obtain the SQL statement of insert/update, and obtaining the table name and the query condition. The association forms the default database platform and the initial configuration of the table query statement.
4. Providing a manual query channel: aiming at the SQL scene without logs or without printed logs of a host, a manual query channel is provided, and query statements which use the query statements for multiple times and can correctly query results are automatically learned and put in a default query configuration corresponding to a service scene and a database type.
5. When the device is used, the message type and the service scene can be selected by inputting the ID key words of the message, all query results of cross-application, cross-database and different tables are displayed through the interface, and the problem of switching of different applications, different databases and different tables is solved.
It should be noted that the implementation, solved technical problems, implemented functions, and achieved technical effects of each module/unit/subunit and the like in the apparatus part embodiment are respectively the same as or similar to the implementation, solved technical problems, implemented functions, and achieved technical effects of each corresponding step in the method part embodiment, and are not described herein again.
According to an embodiment of the present disclosure, any plurality of the keyword module 1110, the matching rule module 1120, the sentence generation module 1130, and the data query module 1140 may be combined in one module to be implemented, or any one of them may be split into a plurality of modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module.
According to an embodiment of the present disclosure, at least one of the keyword module 1110, the matching rule module 1120, the statement generation module 1130, and the data query module 1140 may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or may be implemented in any one of three implementations of software, hardware, and firmware, or in a suitable combination of any of them. Alternatively, at least one of the keyword module 1110, the matching rule module 1120, the statement generation module 1130, and the data query module 1140 may be at least partially implemented as a computer program module that, when executed, may perform a corresponding function.
FIG. 12 schematically illustrates a block diagram of an electronic device suitable for implementing a data query method for a cross-row message according to an embodiment of the disclosure.
As shown in fig. 12, an electronic apparatus 1200 according to an embodiment of the present disclosure includes a processor 1201, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)1202 or a program loaded from a storage section 1208 into a Random Access Memory (RAM) 1203. The processor 1201 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 1201 may also include on-board memory for caching purposes. The processor 1201 may include a single processing unit or multiple processing units for performing the different actions of the method flows according to embodiments of the present disclosure.
In the RAM 1203, various programs and data necessary for the operation of the electronic apparatus 1200 are stored. The processor 1201, the ROM 1202, and the RAM 1203 are connected to each other by a bus 1204. The processor 1201 performs various operations of method flows according to embodiments of the present disclosure by executing programs in the ROM 1202 and/or the RAM 1203. Note that the programs may also be stored in one or more memories other than the ROM 1202 and the RAM 1203. The processor 1201 may also perform various operations of method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
Electronic device 1200 may also include input/output (I/O) interface 1205, according to an embodiment of the disclosure, input/output (I/O) interface 1205 also connected to bus 1204. The electronic device 1200 may also include one or more of the following components connected to the I/O interface 1205: an input section 1206 including a keyboard, mouse, etc. Including an output portion 1207 such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker and the like. A storage section 1208 including a hard disk and the like. And a communication section 1209 including a network interface card such as a LAN card, a modem, or the like. The communication section 1209 performs communication processing via a network such as the internet. A driver 1210 is also connected to the I/O interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is mounted on the drive 1210 as necessary, so that a computer program read out therefrom is mounted into the storage section 1208 as necessary.
The present disclosure also provides a computer-readable storage medium, which may be embodied in the devices/apparatuses/systems described in the above embodiments. Or may exist alone without being assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM 1202 and/or the RAM 1203 and/or one or more memories other than the ROM 1202 and the RAM 1203 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the method illustrated in the flow chart. When the computer program product runs in a computer system, the program code is used for causing the computer system to realize the method provided by the embodiment of the disclosure.
The computer program performs the above-described functions defined in the system/apparatus of the embodiments of the present disclosure when executed by the processor 1201. The systems, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In one embodiment, the computer program may be hosted on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed in the form of a signal on a network medium, downloaded and installed through the communication section 1209, and/or installed from the removable medium 1211. The computer program containing program code may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 1209, and/or installed from the removable medium 1211. The computer program, when executed by the processor 1201, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In accordance with embodiments of the present disclosure, program code for executing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, these computer programs may be implemented using high level procedural and/or object oriented programming languages, and/or assembly/machine languages. The programming language includes, but is not limited to, programming languages such as Java, C + +, python, the "C" language, or the like. The program code may execute entirely on the user computing device, partly on the user device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments of the present disclosure and/or the claims may be made without departing from the spirit and teachings of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure are described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (14)

1. A data query method for a cross-line message comprises the following steps:
obtaining N first keywords in a cross-line message to be inquired, wherein N is an integer greater than or equal to 1;
determining preset query rules matched with the N first keywords from preset query rule bases of M databases, wherein the preset query rule bases comprise preset query rules corresponding to each database, the preset query rules between at least two databases in the M databases are different, the M databases are used for storing at least one cross-row applied service data, and M is an integer greater than or equal to 2;
generating a first query statement of at least one database in the M databases according to the N first keywords and the matched preset query rule;
and querying the target service data in the corresponding database by using the first query statement of the at least one database.
2. The method of claim 1, wherein the obtaining N first keywords in the to-be-queried cross-line message comprises:
receiving the N first keywords input by a user;
before determining the preset query rule matched with the N first keywords from the preset query rule base of the M databases, the method further includes:
and acquiring the message type and/or the service scene of the cross-line message to be inquired, which are determined by the user, wherein the message type comprises the type of the cross-line service to which the cross-line message to be inquired belongs, and the service scene is acquired according to the execution result of the cross-line service to which the cross-line message to be inquired belongs.
3. The method of claim 2, wherein the determining the preset query rule matching the N first keywords from a preset query rule base of M databases comprises:
filtering preset query rule bases of the M databases based on the message type and/or the service scene of the cross-row message to be queried;
and determining the matched preset query rule from the filtered preset query rule base of the M databases.
4. The method of claim 1, wherein prior to determining the preset query rule matching the N first keywords from a preset query rule base of M databases, the method further comprises:
s historical cross-row messages are obtained, wherein S is an integer greater than or equal to 1;
and obtaining a preset query rule base of the M databases according to at least one second query statement corresponding to the S historical cross-row messages, wherein each second query statement is used for querying the service data from the corresponding database of the M databases.
5. The method according to claim 4, wherein after obtaining S historical cross-row packets, obtaining at least one second query statement corresponding to the S historical cross-row packets further includes:
extracting at least one second keyword from the S historical cross-line messages;
and obtaining at least one second query statement corresponding to the S historical cross-row messages according to the at least one second keyword.
6. The method of claim 5, further comprising:
determining the at least one cross-row application associated with the S historical cross-row packets;
acquiring first log data of the at least one cross-row application;
wherein the obtaining, according to the at least one second keyword, at least one second query statement corresponding to the S historical cross-row messages includes:
and obtaining at least one second query statement corresponding to the S historical cross-row messages from the first log data according to the at least one second keyword.
7. The method according to claim 6, wherein the obtaining, according to the at least one second keyword, at least one second query statement corresponding to the S historical line crossing messages from the first log data includes:
determining a log identifier corresponding to the at least one second keyword, wherein the log identifier is used for determining corresponding second log data from the first log data;
and acquiring the at least one second query statement from the second log data.
8. The method of claim 4 or 7, wherein after obtaining S historical cross-row messages, the method further comprises:
when a user inquires the service data according to the S historical line crossing messages, recording at least one third inquiry statement manually input by the user;
taking the at least one third query statement as the at least one second query statement.
9. The method according to claim 4, wherein the preset query rule base of the M databases is obtained according to at least one second query statement corresponding to the S historical cross-row packets:
obtaining a database table name and a query condition from each second query statement;
and determining a preset query rule corresponding to the database according to the database table name and the query condition in each second query statement.
10. The method of claim 4, wherein after obtaining S historical cross-row messages, the method further comprises:
obtaining a message type and/or a service scene of each historical cross-row message, wherein the message type comprises a cross-row service type of each historical cross-row message, and the service scene is obtained according to an execution result of the cross-row service of each historical cross-row message;
and classifying the preset query rules of each database according to the message type and/or the service scene of each historical cross-row message.
11. A data query device for a cross-line message, comprising:
the keyword module is used for obtaining N first keywords in the cross-line message to be inquired, wherein N is an integer greater than or equal to 1;
a matching rule module, configured to determine a preset query rule that matches the N first keywords from preset query rule bases of M databases, where the preset query rule bases include a preset query rule corresponding to each database, preset query rules between at least two databases of the M databases are different, the M databases are used to store at least one piece of cross-row applied service data, and M is an integer greater than or equal to 2;
a statement generating module, configured to generate a first query statement for at least one database of the M databases according to the N first keywords and the matched preset query rule;
and the data query module is used for querying the target service data in the corresponding database by using the first query statement of the at least one database.
12. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-10.
13. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the method of any one of claims 1 to 10.
14. A computer program product comprising a computer program which, when executed by a processor, implements a method according to any one of claims 1 to 10.
CN202210676962.3A 2022-06-15 2022-06-15 Data query method, device, equipment and medium for cross-line message Pending CN115062043A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210676962.3A CN115062043A (en) 2022-06-15 2022-06-15 Data query method, device, equipment and medium for cross-line message

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210676962.3A CN115062043A (en) 2022-06-15 2022-06-15 Data query method, device, equipment and medium for cross-line message

Publications (1)

Publication Number Publication Date
CN115062043A true CN115062043A (en) 2022-09-16

Family

ID=83199660

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210676962.3A Pending CN115062043A (en) 2022-06-15 2022-06-15 Data query method, device, equipment and medium for cross-line message

Country Status (1)

Country Link
CN (1) CN115062043A (en)

Similar Documents

Publication Publication Date Title
US10339038B1 (en) Method and system for generating production data pattern driven test data
US10546348B1 (en) Cleaning noise words from transaction descriptions
US11087309B2 (en) Location detection based on IP addresses and transactions
CN109241384B (en) Scientific research information visualization method and device
CN104579909B (en) Method and equipment for classifying user information and acquiring user grouping information
US20220076231A1 (en) System and method for enrichment of transaction data
US9652740B2 (en) Fan identity data integration and unification
CN111382279A (en) Order examination method and device
CN113205402A (en) Account checking method and device, electronic equipment and computer readable medium
CN108074033A (en) Processing method, system, electronic equipment and the storage medium of achievement data
CN108520045B (en) Data service response method and device
CN110942392A (en) Service data processing method, device, equipment and medium
US20220156245A1 (en) System and method for managing custom fields
US20170132195A1 (en) Method and Apparatus Providing Contextual Suggestion in Planning Spreadsheet
CN110955801B (en) Knowledge graph analysis method and system for cognos report indexes
CN116932214A (en) Instruction sending method and device, electronic equipment and computer storage medium
US20220277400A1 (en) System and method for regular expression generation for improved data transfer
CN115098738A (en) Service data extraction method and device, storage medium and electronic equipment
CN113395292B (en) Message processing method and device, electronic equipment and storage medium
CN115495513A (en) Event standardization method and device
CN115062043A (en) Data query method, device, equipment and medium for cross-line message
CN117009397A (en) Data query method, data query device, electronic equipment and storage medium
CN115017185A (en) Data processing method, device and storage medium
US8538813B2 (en) Method and system for providing an SMS-based interactive electronic marketing offer search and distribution system
US11521206B2 (en) Systems and methods for providing immutable identifiers for aggregated data structures

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