Statement analysis method and device, equipment, storage medium and product

By receiving business sentences in the database, identifying and replacing the conflict keywords, forming a reconstruction statement, solving the problem of statement execution caused by the grammatical differences between different databases, and achieved the effect of correctly analyzing and implementing business statements.

CN119336784APending Publication Date: 2025-01-21CHINA MOBILE INFORMATION TECHNOLOGY CO LTD +1
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411571496.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-05
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

There are differences in syntax format specifications between different types of databases, resulting in the SQL statements of the source database that may trigger keywords for the new database after data migration, causing the statement to be unable to be executed.

Method used

By receiving the business statement, determine the target field that is the same as the preset conflict keyword, replace it with the preset replacement keyword, form a reconstructed business statement, and parse the reconstructed statement.

Benefits of technology

It achieves correct parsing and execution of business statements without modifying the underlying code of the source database and developing a new version of the target database, reducing R&D, testing and time costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336784A_ABST
    Figure CN119336784A_ABST
Patent Text Reader

Abstract

The invention discloses a statement analysis method and device, equipment, a storage medium and a product, and relates to the technical field of databases. Determining a target field which is the same as the preset conflict keyword from the business statement; the preset conflict keyword has a corresponding preset replacement keyword; replacing the target field of the business statement with a preset replacement keyword to obtain a reconstructed business statement; and analyzing and reconstructing the business statement. According to the method and the device, correct analysis and identification of the business statement are realized on the premise of not rewriting bottom-layer codes of the source database and developing a new version of the target database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of database technology, and in particular to a statement parsing method, apparatus, device, storage medium and product. Background Art

[0002] Currently, due to business needs, data in various systems are migrated between different types of databases. However, there are differences in syntax format specifications between different types of databases, which results in the Structured Query Language (SQL) statements of the source database triggering keywords of the new database after data migration, causing the SQL statements to fail to execute in the new database.

[0003] In related technologies, in order to solve the keyword conflicts between different databases, the common solution is to modify the code of the business system to avoid keyword conflicts by modifying the underlying code, or to develop a new version of the database to adapt the compatibility of the syntax format specifications of the source database. However, whether it is to transform the old business system or to adapt the compatibility of the new database, it will bring huge R&D, testing and time costs, and it is extremely difficult.

[0004] Therefore, how to enable the database to correctly parse and identify business statements is a problem that needs to be solved urgently. Summary of the invention

[0005] The main purpose of this application is to provide a statement parsing method, device, equipment, storage medium and product, aiming to solve the technical problem of how to enable the database to correctly parse and identify business statements.

[0006] To achieve the above purpose, the present application proposes a sentence parsing method, which includes: Receive business statements; Determine a target field that is the same as a preset conflicting keyword from a business statement; the preset conflicting keyword has a corresponding preset replacement keyword; Replace the target field of the business statement with a preset replacement keyword to obtain a reconstructed business statement; Parse and reconstruct business statements.

[0007] In one embodiment, determining a target field that is the same as a preset conflicting keyword from a business statement includes: Get the identifier to be matched corresponding to each field in the business statement; For any field, the identifier to be matched is matched in a preset identifier set.

[0008] In some embodiments, before obtaining the identifier to be matched corresponding to each field in the business statement, the method further includes: Determine each keyword in the source database that cannot be resolved by the current database as a preset conflicting keyword; Determine the identifier corresponding to each preset conflicting keyword; The set of all identifiers is used as the preset identifier set corresponding to the source database.

[0009] In some embodiments, obtaining the identifier to be matched corresponding to each field in the business statement includes: Perform a hash operation on each field to obtain the identifier to be matched corresponding to each field.

[0010] In some embodiments, after parsing and reconstructing the business statement, the statement parsing method further includes: In the case where the reconstructed business statement fails to be parsed, obtaining the keyword in the reconstructed business statement that failed to be parsed; Add the identifier corresponding to the keyword that failed to be parsed to the preset identifier set corresponding to the source database; A prompt message is issued to inform the user to update the mapping table according to the prompt message, wherein the prompt message includes the keyword for which the parsing fails, and the mapping table includes a mapping relationship between the preset conflicting keyword and the preset replacement keyword.

[0011] In some embodiments, after issuing a prompt message to update a mapping table including a mapping relationship between a preset conflict keyword and a preset replacement keyword, the statement parsing method further includes: In response to updates of the mapping table and the preset identifier set, reloading the mapping table and the preset identifier set; Returns the target field that is identical to the preset conflict keyword determined from the business statement.

[0012] In addition, to achieve the above purpose, the present application also proposes a sentence parsing device, which includes: A statement receiving module, used for receiving business statements; A conflict detection module, used to determine a target field that is the same as a preset conflict keyword from a business statement; the preset conflict keyword has a corresponding preset replacement keyword; A field replacement module is used to replace the target field of the business statement with a preset replacement keyword to obtain a reconstructed business statement; The statement parsing module is used to parse and reconstruct business statements.

[0013] In addition, to achieve the above-mentioned purpose, the present application also proposes a statement parsing device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the statement parsing method described above.

[0014] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the statement parsing method described above are implemented.

[0015] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the statement parsing method described above are implemented.

[0016] One or more technical solutions proposed in this application have at least the following technical effects: Since the corresponding replacement keywords are configured in advance for the preset conflicting keywords, when receiving a business statement, the target database can replace the corresponding fields according to the mapping relationship when the conflicting keywords are found, and reconstruct the business statement that could not be correctly parsed into a new business statement, so that the business statement can be parsed by the target database and complete subsequent business execution. Without involving rewriting the underlying code of the source database and developing a new version of the target database, the correct parsing and identification of the business statement is achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0019] Figure 1 A schematic diagram of the module architecture of the sentence parsing system provided in an embodiment of the present application is shown; Figure 2 A flow chart of a sentence parsing method provided by an embodiment of the present application is shown; Figure 3 A schematic diagram showing a flow chart of a sentence parsing method provided by another embodiment of the present application is shown; Figure 4 A schematic diagram of a mapping table provided by an exemplary embodiment of the present application is shown; Figure 5 A schematic diagram of the process of step S120 provided in an embodiment of the present application is shown; Figure 6 A schematic diagram of the process of step S140 provided in an embodiment of the present application is shown; Figure 7 A flowchart of a sentence parsing method provided by an exemplary embodiment of the present application is shown; Figure 8 A flowchart of a sentence parsing method provided by another exemplary embodiment of the present application is shown; Fig. 9 A schematic diagram showing the structure of a sentence parsing device provided in an embodiment of the present application is shown; Fig.10 A schematic diagram of the structure of a sentence parsing device provided in an embodiment of the present application is shown.

[0020] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0021] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0022] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0023] The main solution of the embodiment of the present application is: receiving a business statement; determining a target field that is the same as a preset conflict keyword from the business statement; the preset conflict keyword has a corresponding preset replacement keyword; replacing the target field of the business statement with the preset replacement keyword to obtain a reconstructed business statement; and parsing the reconstructed business statement.

[0024] In the related art, the migration of various systems between different databases is normalized. However, due to the differences in syntax specifications between different databases, after the database is replaced, the business statements of the original business system trigger the keywords of the new database, resulting in the inability to parse and execute the business statements normally.

[0025] Related technologies For the above situation, the following two solutions are usually adopted: 1. Modify the code of the business system so that the generated business statements avoid keyword conflicts. 2. Conduct technical research on the new database and make compatibility adaptation by developing a new version. For solution 1, the cost of transforming the old business system is too high; for solution 2, compatibility adaptation requires huge R&D, testing and time costs, and based on the database architecture, it may also cause the stability of the database to deteriorate, or even make the transformation impossible to implement.

[0026] In summary, whether it is the transformation of old business systems or the development of new databases to achieve compatibility adaptation, it will bring huge R&D, testing and time costs.

[0027] Based on this, the present application provides a solution to enable the database to correctly parse and identify business statements.

[0028] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or a sentence parsing device capable of realizing the above functions, etc. The following takes the sentence parsing device as an example to illustrate this embodiment and the following embodiments.

[0029] Before explaining the sentence parsing method provided in the embodiment of the present application, for ease of understanding, the application scenarios involved in the embodiment of the present application are briefly described. The application scenarios at least include: The source database, the front-end operating system, and the current database.

[0030] The source database and the current database may have differences in database syntax format specifications. For example, the same keyword can be parsed and identified in the source database, but conflicts in the current database.

[0031] In the embodiment of the present application, the foreground operating system can be designed in conjunction with the source database, and the business statements generated by the foreground operating system can be correctly parsed and identified by the source database, that is, they comply with the grammatical format specifications of the source database.

[0032] As an example, due to business needs, the data in the source database is migrated to the current database, that is, the current database is used to replace the source database, and the current database is connected to the front-end operating system. All business operations performed by users on the front-end operating system are transferred to the current database for parsing and execution.

[0033] It is understandable that, since the foreground operating system is adapted to the source database but not to the current database, the generated business statements may not conform to the syntax format specification of the current database, that is, they cannot be correctly parsed and executed.

[0034] For parts not described in detail here, please refer to the relevant parts of the following embodiments.

[0035] Reference Figure 1 , Figure 1Schematic diagram of the module architecture of the statement parsing system provided in the embodiment of the present application. Specifically, the statement parsing system 100 may include a foreground operating system 110 and a current database 120. The current database may include an interface module 121, a parsing interception module 122, a parsing module 123 and a storage module 124.

[0036] The front-end operating system 110 is used to accept business requirements and generate corresponding business statements.

[0037] The interface module 121 is used to connect to the foreground operating system 110 and receive the business statement sent by the foreground operating system 110 .

[0038] The parsing and interception module 122 is used to reconstruct the received business statement to obtain a reconstructed business statement.

[0039] The parsing module 123 is used to parse and execute the reconstructed business statement.

[0040] The storage module 124 is used to store data.

[0041] Regarding the interaction between the various modules in the sentence parsing system, please refer to the relevant parts in the following embodiments.

[0042] Reference Figure 2 , Figure 2 A flowchart of a statement parsing method provided in accordance with an embodiment of the present application.

[0043] In this embodiment, the statement parsing method includes steps S110 to S140: Step S110: receiving a business statement.

[0044] In actual database applications, if you need to add, delete, modify, or search data in a database, you usually need to use Structured Query Language (SQL). Based on SQL syntax, you can combine keywords supported by the database to form SQL statements that can be recognized, parsed, and executed by the database, i.e., business statements.

[0045] As mentioned above, in this embodiment, a front-end operating system can be pre-set for the current database. Users (such as staff) accept business needs through the front-end operating system, generate corresponding business statements based on the syntax format specifications of the source database according to actual business needs, and send the business statements to the current database, which is received by the interface module.

[0046] In some implementations, to meet business needs, semantic parsing (Text-to-SQL) in natural language processing (NLP) technology can be used to semantically understand the content input by the user (or staff), and then automatically convert it into a SQL query statement corresponding to the source database through a preset template.

[0047] Among them, the front-end operating system is designed to match the source database, not the current database. Therefore, some contents of the SQL business statements generated by the front-end operating system may be incompatible with the current database.

[0048] Step S120: determining a target field that is the same as the preset conflicting keyword from the business statement.

[0049] Among them, the preset conflicting keywords have corresponding preset replacement keywords.

[0050] Specifically, the business statement can be split into multiple fields (i.e., keywords) according to the SQL statement specification. For example, for the business statement "SELECT A FROM B", it can be split into four fields: "SELECT", "A", "FROM", and "B". In some implementations, the field can be confirmed according to the space bar in the business statement, so as to be split.

[0051] In this embodiment, the preset conflicting keyword refers to a keyword that can be correctly parsed by the source database but cannot be correctly parsed by the current database (parsing module). The preset replacement keyword refers to a keyword set by the user (or a preset software program), corresponding one-to-one to the preset conflicting keyword, and can be correctly parsed by the current database (parsing module).

[0052] In one implementation, the target field that is the same as the preset conflicting keyword can be directly determined from the business statement by field matching. When the business statement contains fewer keywords, it is faster to obtain the target field by directly performing field matching; however, when the business statement contains a large number of keywords, the efficiency of field matching is very low.

[0053] Therefore, in another implementation, to improve the acquisition efficiency of the target field, refer to Figure 3 Before steps S110 to S140, the statement parsing method further includes the following steps S210 to S230: Step S210: determine each keyword in the source database that cannot be resolved by the current database as a preset conflicting keyword.

[0054] Specifically, based on the SQL statement specification of the source database, the original statement in the source database (including all keywords in the source database) can be traversed and parsed in the current database. During the parsing process of the original statement by the parsing module, if there is a field in the original statement that cannot be parsed, the field is determined as a preset conflicting keyword.

[0055] After obtaining the preset conflicting keywords, in some implementations, the user can set corresponding preset replacement keywords for each preset conflicting keyword in SQL, XML, JSON, etc. format. The preset replacement keywords meet the format specification of the current database and can be correctly parsed and identified by the parsing module of the current database.

[0056] For example, in the source database, the keyword "cycle" cannot be correctly parsed in the current database. Based on the format specification of the current database, the user can set the corresponding preset replacement keyword "cycleA" for the "cycle" field and record it in the following format: Figure 4 In the file shown, it is a mapping relationship between preset conflict keywords and preset replacement keywords.

[0057] In other embodiments, a software program may be preset to configure a corresponding preset replacement keyword for the preset conflicting keyword. The preset software program is set based on the format specifications of the source database and the current database. The preset conflicting keyword is input into the preset software program. The preset software program may output a corresponding keyword that can be parsed by the current database and has the same functional meaning as the preset conflicting keyword based on the format specifications of the current database as the preset replacement keyword.

[0058] In the following embodiments, for ease of understanding, the mapping relationships are stored in the form of a mapping table. The content recorded in the mapping table hereinafter is the mapping relationship between the preset conflicting keywords and the preset replacement keywords in this embodiment.

[0059] Step S220: determining the identifier corresponding to each preset conflicting keyword.

[0060] In some implementations, the preset conflicting keywords can be calculated by a hash algorithm to obtain an identifier (SQLID) of each preset conflicting keyword. Specifically, the generation of the SQLID is based on the hash value of the SQL text, which is usually calculated by the MD5 algorithm. The SQLID of the preset conflicting keyword can be used to uniquely mark the preset conflicting keyword in the source database. Since the SQLID supports pre-compilation and caching, the efficiency of subsequent matching analysis can be improved.

[0061] Step S230: taking the set of all identifiers as the preset identifier set corresponding to the source database.

[0062] For example, the preset identifier is set to Ssqlid, and there are n preset conflicting keywords in total, then the preset identifier set is ASsqlid: {Ssqlid1 (hash KS1), Ssqlid2 (hash KS2), ... Ssqlidn (hash KSn)}.

[0063] In some embodiments, see Figure 5 , step S120 may include the following steps S121 to S122: Step S121, obtaining the identifier to be matched corresponding to each field in the business statement.

[0064] As mentioned above, after the interface module receives the business statement, it can send the business statement to the parsing and intercepting module, and the parsing and intercepting module can split the business statement according to the grammatical specification of the SQL statement to obtain multiple fields.

[0065] In this embodiment, the parsing and interception module performs a hash operation on each of the multiple fields, thereby obtaining a hash value of each field as a corresponding identifier to be matched.

[0066] Step S122: for any field, match the identifier to be matched in a preset identifier set.

[0067] Referring to the preset identifier set obtained in step S230 , a traversal match may be performed in the preset identifier set for each identifier to be matched.

[0068] If the preset identifier set includes the identifier to be matched, the field corresponding to the identifier to be matched is determined as the target field, that is, the field that cannot be correctly parsed in the current database needs to be reconstructed through step S130.

[0069] If the preset identifier set does not include the identifier to be matched, it means that the entire business statement itself has met the format specification of the current database. At this time, the parsing interception module directly sends the business statement to the parsing module, so that the parsing module parses, identifies and executes the business statement.

[0070] In this embodiment, by obtaining the SQLID corresponding to each field in the business statement, and using a traversal method to match the SQLID in a preset identifier set, faster matching efficiency can be guaranteed when the number of business statement fields is large. At the same time, the SQLID is used to uniquely identify the field, and the SQLID can be used to support pre-compilation and caching features, thereby improving the efficiency of subsequent analysis.

[0071] Step S130: Replace the target field of the business statement with a preset replacement keyword to obtain a reconstructed business statement.

[0072] As described above, when the target field in the business statement is obtained, the preset replacement keyword corresponding to the target field can be obtained by searching the mapping table in step S210. After obtaining the preset replacement keyword, the target field of the business statement is replaced with the preset replacement keyword to obtain a reconstructed business statement.

[0073] For example, assuming that the business statement is "SELECT A FROM B", where A and B are target fields, by searching the mapping table, it is determined that the preset replacement keyword corresponding to A is A1, and the preset replacement keyword corresponding to B is B1. The parsing interception module replaces A with A1 and replaces B with B1, and the reconstructed business statement is "SELECT A1 FROM B1".

[0074] Step S140: parsing and reconstructing the business statement.

[0075] After the parsing interception module obtains the reconstructed business statement, the reconstructed business statement may be sent to the parsing module for further parsing.

[0076] In this embodiment, step S140 may include the following two situations: Case ①: The reconstructed business statement is parsed successfully; Case ②: Failed to parse the reconstructed business statement.

[0077] For situation ①, directly execute the reconstructed business statement, obtain the data corresponding to the reconstructed business statement through the storage module and feed it back to the foreground operating system.

[0078] For situation ②, the reason may be that the pre-established mapping table is incomplete. For the source database, there are still some keywords that have not been configured with corresponding preset replacement keywords. These keywords have not been added to the preset conflict keywords, resulting in the inability to be correctly parsed by the current database.

[0079] like Figure 6 As shown, in some implementations, when the reconstructed business statement fails to be parsed, in order to ensure that the business statement can be parsed normally later, the statement parsing method may further include the following steps S141 to S144: Step S141, obtaining keywords in the reconstructed business statement that failed to be parsed.

[0080] It is understandable that, in the process of the parsing module parsing the reconstructed business statement, the parsing module may automatically mark the fields that cannot be parsed and identified, that is, the keywords that failed to parse.

[0081] Step S142: adding the identifier corresponding to the keyword that failed to be parsed to the preset identifier set corresponding to the source database.

[0082] Step S143: issuing a prompt message to update a mapping table, wherein the mapping table includes a mapping relationship between preset conflicting keywords and preset replacement keywords.

[0083] As described above, after obtaining the keyword for which parsing failed, the identifier corresponding to the keyword can be calculated by hash operation.

[0084] The keyword that failed to parse is the field in the source database that cannot be correctly parsed by the current database, is not added to the mapping table, and is not configured with the corresponding preset replacement keyword. In order to ensure the integrity of the mapping relationship and improve the success rate of parsing subsequent business statements, the identifier corresponding to the keyword that failed to parse can be added to the preset identifier set.

[0085] In the case where the preset replacement keyword is configured by the user, a prompt message may be issued to prompt the user to configure a corresponding preset replacement keyword for the keyword, and the configuration result is updated in the mapping table.

[0086] In the case where the preset replacement keyword is automatically generated by a preset software program, the keyword can be input into the preset software program to generate a corresponding preset replacement keyword, thereby automatically completing the update of the mapping table.

[0087] Step S144: in response to the update of the mapping table and the preset identifier set, reload the mapping table and the preset identifier set.

[0088] After the mapping table is updated, the preset identifier set and the mapping table are reloaded into the parsing interception module to achieve dynamic update of the mapping relationship.

[0089] Step S145 , returning to execute determining from the business statement a target field that is identical to the preset conflicting keyword.

[0090] In some implementations, the process may return to step S110 and re-execute the statement parsing method provided in this embodiment on the business statement received by the interface module, which will not be described in detail in the embodiments of the present application.

[0091] In other implementations, the reconstructed business statement may also be input into the interface module as a new business statement, thereby reducing some repeated retrieval and replacement operations to improve parsing efficiency.

[0092] In this embodiment, when parsing fails, the keyword for which parsing failed is obtained, and the user is prompted to configure the keyword, thereby ensuring the integrity of the mapping relationship. After the user configures the corresponding preset replacement keyword for the keyword, it can be updated to the mapping table, so that when the keyword appears again in the future, it can be successfully replaced, reducing repeated errors. In the process of continuous parsing and replacement of business statements, the mapping table is gradually enriched and complete, so that the analysis and replacement efficiency of business statements is continuously improved.

[0093] The present embodiment provides a statement parsing method. Since corresponding replacement keywords are configured in advance for preset conflicting keywords, when a business statement is received, the target database can search whether the business statement includes the conflicting keywords. When the conflicting keywords are found, they are replaced according to the mapping relationship, and the business statement that could not be correctly parsed is reconstructed into a new business statement, so that the business statement can be parsed by the target database and subsequent business execution can be completed. Correct parsing and identification of the business statement is achieved without rewriting the underlying code of the source database and developing a new version of the target database.

[0094] For example, to help understand the implementation process of the sentence parsing method obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Figure 7 as well as Figure 8 , specifically: Before receiving a business statement, such as Figure 7 As shown, the statements of the source database can be first traversed and parsed in the current database to obtain the preset conflicting keywords; a corresponding preset replacement keyword is configured for each preset conflicting keyword, and a mapping relationship between the preset conflicting keywords and the preset replacement keywords is established; based on the preset conflicting keywords, after a hash operation, a preset identifier set is obtained, which includes a preset identifier corresponding to each preset conflicting keyword; finally, the preset identifier set and the mapping relationship are loaded into the parsing interception module.

[0095] When receiving a business statement, such as Figure 8 As shown, when a business statement is received, a hash operation is performed to obtain the identifier to be matched corresponding to each field in the business statement, and the identifier to be matched is matched with a preset identifier set.

[0096] If the target field cannot be matched, the business statement can be directly parsed.

[0097] If the target field is matched, the mapping relationship is searched, and the target field is replaced with the corresponding preset replacement keyword to obtain the reconstructed business statement. The reconstructed business statement is parsed. If the reconstructed business statement can be parsed correctly, the reconstructed business statement can be executed. If the reconstructed business statement cannot be parsed correctly, the fields that cannot be parsed in the reconstructed business statement are obtained, updated to the mapping relationship and the preset identifier set, the mapping relationship and the preset identifier set are reloaded, and the step of "obtaining the identifier to be matched corresponding to each field in the reconstructed business statement" is re-executed for the reconstructed business statement.

[0098] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the sentence parsing method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0099] This application also provides a sentence parsing device, please refer to Fig. 9 , the sentence parsing device 200 comprises: The statement receiving module 210 is used to receive a business statement.

[0100] The conflict detection module 220 is used to determine the target field that is the same as the preset conflict keyword from the business statement; the preset conflict keyword has a corresponding preset replacement keyword.

[0101] The field replacement module 230 is used to replace the target field of the business statement with a preset replacement keyword to obtain a reconstructed business statement.

[0102] The statement parsing module 240 is used to parse and reconstruct business statements.

[0103] The statement parsing device 210 provided by the present application adopts the statement parsing method in the above embodiment, which can solve the technical problem of how to enable the database to correctly parse and identify business statements. Compared with the prior art, the beneficial effects of the statement parsing device 210 provided by the present application are the same as the beneficial effects of the statement parsing method provided by the above embodiment, and other technical features in the statement parsing device 210 are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0104] The present application provides a statement parsing device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the statement parsing method in the above-mentioned embodiment 1.

[0105] Reference below Fig.10, which shows a schematic diagram of the structure of a sentence parsing device suitable for implementing the embodiment of the present application. The sentence parsing device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.10 The sentence parsing device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0106] like Fig.10 As shown, the sentence parsing device 300 may include a processing device 310 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM: Read Only Memory) 320 or the program loaded from the storage device 330 to the random access memory (RAM: Random Access Memory) 340. In the RAM340, various programs and data required for the operation of the sentence parsing device are also stored. The processing device 310, the ROM320 and the RAM340 are connected to each other through the bus 350. The input / output (I / O) interface 360 ​​is also connected to the bus. Generally, the following systems can be connected to the I / O interface 360: an input device 370 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 380 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 330 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 390. The communication device 390 can allow the sentence parsing device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a sentence parsing device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.

[0107] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through a communication device, or installed from a storage device 330, or installed from a ROM 320. When the computer program is executed by the processing device 310, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0108] The statement parsing device provided by the present application adopts the statement parsing method in the above embodiment, which can solve the technical problem of how to enable the database to correctly parse and identify business statements. Compared with the prior art, the beneficial effects of the statement parsing device provided by the present application are the same as the beneficial effects of the statement parsing method provided by the above embodiment, and other technical features in the statement parsing device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0109] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0110] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0111] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, the computer-readable program instructions being used to execute the statement parsing method in the above-mentioned embodiment.

[0112] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0113] The computer-readable storage medium may be included in the sentence parsing device; or may exist independently without being assembled into the sentence parsing device.

[0114] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the statement parsing device, the statement parsing device can write computer program codes for performing the operations of the present application in one or more programming languages ​​or a combination thereof. The programming languages ​​include object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0115] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0116] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0117] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned statement parsing method, and can solve the technical problem of enabling the database to correctly parse and identify business statements. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the statement parsing method provided in the above-mentioned embodiment, and will not be elaborated here.

[0118] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned statement parsing method when executed by a processor.

[0119] The computer program product provided by the present application can solve the technical problem of how to enable the database to correctly parse and identify business statements. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the statement parsing method provided by the above embodiment, which will not be repeated here.

[0120] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A sentence parsing method, characterized in that: The statement parsing method comprises: receiving business statements; Determine a target field that is the same as a preset conflicting keyword from a business statement; the preset conflicting keyword has a corresponding preset replacement keyword; Replacing the target field of the business statement with the preset replacement keyword to obtain a reconstructed business statement; The reconstructed business statement is parsed.

2. The sentence parsing method according to claim 1, characterized in that: The step of determining, from the business statement, a target field that is identical to a preset conflicting keyword includes: Obtaining the identifier to be matched corresponding to each field in the business statement; For any of the fields, the identifier to be matched is matched in a preset identifier set.

3. The sentence parsing method according to claim 2, characterized in that: Before obtaining the identifier to be matched corresponding to each field in the business statement, the method further includes: Determine each keyword in the source database that cannot be resolved by the current database as a preset conflicting keyword; Determine an identifier corresponding to each of the preset conflicting keywords; The set of all the identifiers is used as a preset identifier set corresponding to the source database.

4. The sentence parsing method according to claim 2, characterized in that: The obtaining the identifier to be matched corresponding to each field in the business statement includes: A hash operation is performed on each of the fields to obtain an identifier to be matched corresponding to each of the fields.

5. The sentence parsing method according to claim 2, characterized in that: After parsing the reconstructed business statement, the statement parsing method further includes: In the case where the reconstructed business statement fails to be parsed, obtaining a keyword in the reconstructed business statement that failed to be parsed; Adding the identifier corresponding to the keyword that failed to be parsed to the preset identifier set corresponding to the source database; A prompt message is issued to inform the user to update the mapping table according to the prompt message, wherein the prompt message includes the keyword for which the parsing fails, and the mapping table includes a mapping relationship between the preset conflicting keyword and the preset replacement keyword.

6. The sentence parsing method according to claim 5, characterized in that: After issuing the prompt information to update the mapping table, wherein the mapping table includes the mapping relationship between the preset conflicting keywords and the preset replacement keywords, the statement parsing method further includes: In response to updates of the mapping table and the preset identifier set, reloading the mapping table and the preset identifier set; Returns the target field that is identical to the preset conflict keyword determined from the business statement.

7. A sentence parsing device, characterized in that: The sentence parsing device comprises: A statement receiving module, used for receiving business statements; A conflict detection module, used to determine a target field that is the same as a preset conflict keyword from a business statement; the preset conflict keyword has a corresponding preset replacement keyword; A field replacement module, used to replace the target field of the business statement with the preset replacement keyword to obtain a reconstructed business statement; A statement parsing module is used to parse the reconstructed business statement.

8. A sentence parsing device, characterized in that: The statement parsing device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the statement parsing method according to any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the statement parsing method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the statement parsing method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Navigation method based on multi-file jump, electronic equipment and storage medium

    CN121052178A

  • A navigation method based on multi-file jumping, an electronic device, and a storage medium

    CN121052178B

  • Operational statement optimization method and device, equipment and storage medium

    CN121350081A