Data comparison method and device, computer equipment and storage medium

The method addresses the inefficiencies of character-by-character SQL comparison by segmenting and encoding SQL statements, enhancing efficiency and accuracy in large-scale platforms.

CN119202014AActive Publication Date: 2024-12-27PING AN BANK CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411080760.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-12-27
Estimated Expiration
2044-08-07

AI Technical Summary

Technical Problem

Existing SQL difference comparison methods consume significant computing resources and time due to character-by-character comparisons, especially in large-scale job platforms, leading to low efficiency and system response speed issues.

Method used

A data comparison method involving segmentation, low-resolution and high-resolution encoding, and parsing of SQL statements to identify changes, reducing the need for character-by-character comparisons.

Benefits of technology

This approach significantly reduces computing resources and time required for SQL difference comparison, improving efficiency and accuracy by segmenting and encoding SQL statements before parsing for changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119202014A_ABST
    Figure CN119202014A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of artificial intelligence and the field of financial science and technology, and relates to a data comparison method and device, computer equipment and a storage medium, and the method comprises the steps: obtaining an updated SQL statement and an original SQL statement corresponding to a target job when the update information of the target job is detected; segmenting the updated SQL statement and the original SQL statement to obtain a first segment content and a second segment content; encoding the first segment content to obtain a first encoding value; encoding the second segment content to obtain a second encoding value; comparing the first coded value with the second coded value, and screening out a first specified coded value and a second specified coded value which are different in numerical value; obtaining a first specified segment content corresponding to the first specified coded value, and obtaining a second specified segment content corresponding to the second specified coded value; and comparing the first specified segment content with the second specified segment content to obtain change information. According to the method and the device, the comparison efficiency of SQL difference comparison is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence development technology and financial technology, and in particular to data comparison methods, devices, computer equipment and storage media. Background Art

[0002] In the financial insurance sector, financial companies usually build equity systems to improve business marketing effectiveness. As an important part of the user incentive mechanism, the accuracy and efficiency of the equity system directly affect the user experience and business operation results. Traditionally, this type of equity system relies on the big data platform to regularly run batch jobs, extract user behavior data from massive data by executing complex SQL statements, and then determine whether the user meets the preset criteria to trigger the corresponding equity distribution.

[0003] However, this processing method that relies on highly customized SQL statements has significant risks: a small change in the SQL statement, even a change of one character, may lead to job execution failure or data extraction deviation, directly endangering the accuracy of downstream rights distribution, and ultimately affecting customer satisfaction and business stability. In view of this, effective monitoring and difference identification of SQL statements have become key links to ensure the stable operation of the system. However, the real challenge is that SQL statements are often long and complex, with short ones reaching hundreds of lines and long ones exceeding four or five hundred lines, and big data platforms can usually only provide job-level SQL change notifications, and cannot accurately point out the specific changes.

[0004] Traditional SQL difference comparison methods usually use a character-by-character comparison of the previous and next versions of SQL statements. Although this processing method is intuitive, its performance bottleneck is particularly prominent when facing large-scale job platforms. Considering that modern big data job platforms may manage tens of millions of jobs, each job corresponds to one or more SQL queries. If this processing method is used to compare differences one by one, it will consume huge computing resources and time, seriously affecting the system response speed, and the comparison efficiency is low, and it cannot meet actual business needs. Summary of the invention

[0005] The purpose of the embodiments of the present application is to propose a data comparison method, apparatus, computer equipment and storage medium to solve the technical problem that the existing SQL difference comparison method usually adopts a method of comparing the SQL statements of the previous and later versions character by character. This processing method consumes huge computing resources and time, seriously affects the system response speed, and has low comparison efficiency.

[0006] In order to solve the above technical problems, the present application embodiment provides a data comparison method, which adopts the following technical solution:

[0007] When update information corresponding to the target job is detected, an update SQL statement and an original SQL statement corresponding to the target job are obtained;

[0008] Based on a preset segmentation strategy, the update SQL statement and the original SQL statement are segmented to obtain first segment content corresponding to the update SQL statement and second segment content corresponding to the original SQL statement;

[0009] Performing low-resolution encoding and high-resolution encoding on the first segment content to obtain corresponding first low-resolution encoding values ​​and first high-resolution encoding values, and generating a first encoding value based on the first low-resolution encoding value and the first high-resolution encoding value;

[0010] Performing low-resolution encoding and high-resolution encoding on the second segment content to obtain corresponding second low-resolution encoding values ​​and second high-resolution encoding values, and generating a second encoding value based on the second low-resolution encoding value and the second high-resolution encoding value;

[0011] Compare the first coding value and the second coding value to select the first designated coding value and the second designated coding value with different values;

[0012] Acquire a first designated segment content corresponding to the first designated coding value from the first segment content, and acquire a second designated segment content corresponding to the second designated coding value from the second segment content;

[0013] Based on a preset parser, the first designated segment content and the second designated segment content are compared and processed to obtain corresponding change information.

[0014] Further, the step of segmenting the update SQL statement and the original SQL statement based on a preset segmentation strategy to obtain first segment content corresponding to the update SQL statement and second segment content corresponding to the original SQL statement specifically includes:

[0015] Get the preset segment value;

[0016] Constructing a segmentation algorithm based on the segmentation values;

[0017] The update SQL statement and the original SQL statement are segmented based on the segmentation algorithm to obtain the first segment content corresponding to the update SQL statement and the second segment content corresponding to the original SQL statement.

[0018] Furthermore, the step of respectively performing low-resolution encoding and high-resolution encoding on the first segment content to obtain a corresponding first low-resolution encoding value and a first high-resolution encoding value, and generating a first encoding value based on the first low-resolution encoding value and the first high-resolution encoding value specifically includes:

[0019] Performing low-resolution encoding on the first segment content based on a preset first hash algorithm to obtain the corresponding first low-resolution encoding value;

[0020] Performing high-resolution encoding on the first segmented content based on a preset second hash algorithm to obtain the corresponding first high-resolution encoding value;

[0021] The first low-resolution coding value and the first high-resolution coding value are concatenated to obtain the first coding value.

[0022] Furthermore, the step of concatenating the first low-resolution coded value and the first high-resolution coded value to obtain the first coded value specifically includes:

[0023] Get the preset splicing order;

[0024] Based on the splicing order, the first low-resolution coding value and the first high-resolution coding value are spliced ​​to obtain corresponding spliced ​​data;

[0025] The concatenated data is used as the first encoding value.

[0026] Furthermore, the step of comparing the first coding value and the second coding value to select the first designated coding value and the second designated coding value having different values ​​specifically includes:

[0027] Get the preset comparison algorithm;

[0028] Compare the first coding value with the second coding value based on the comparison algorithm to obtain a corresponding comparison result;

[0029] The comparison result is subjected to data analysis to select the first designated coding value and the second designated coding value having different numerical values ​​from the first coding value and the second coding value.

[0030] Furthermore, the step of performing a comparison process on the first designated segment content and the second designated segment content based on a preset parser to obtain corresponding change information specifically includes:

[0031] Based on the parser, the first segment content and the second segment content are parsed respectively to obtain a first syntax tree corresponding to the first segment content and a second syntax tree corresponding to the second segment content;

[0032] Performing preset formatting processing on the first syntax tree and the second syntax tree respectively to obtain a first SQL string corresponding to the first syntax tree and a second SQL string corresponding to the second syntax tree;

[0033] Performing a difference comparison between the first SQL string and the second SQL string based on a preset difference comparison algorithm to obtain a corresponding difference comparison result;

[0034] Performing line number mapping processing on the difference comparison result to obtain corresponding line number change information;

[0035] The change information is generated based on the first SQL character string, the second SQL character string, and the row number change information.

[0036] Further, after the step of generating the change information based on the first SQL string, the second SQL string and the row number change information, the method further includes:

[0037] generating change reminder information based on the target job and the change information;

[0038] Obtain the communication method corresponding to the preset task leader;

[0039] Based on the communication method, the change reminder information is sent to the operation person in charge.

[0040] In order to solve the above technical problems, the embodiment of the present application further provides a data comparison device, which adopts the following technical solution:

[0041] A first acquisition module, configured to acquire an update SQL statement and an original SQL statement corresponding to a target job when update information corresponding to the target job is detected;

[0042] A processing module, configured to perform segmentation processing on the update SQL statement and the original SQL statement respectively based on a preset segmentation strategy, to obtain a first segmentation content corresponding to the update SQL statement, and to obtain a second segmentation content corresponding to the original SQL statement;

[0043] a first encoding module, configured to perform low-resolution encoding and high-resolution encoding on the first segment content respectively to obtain a corresponding first low-resolution encoding value and a first high-resolution encoding value, and generate a first encoding value based on the first low-resolution encoding value and the first high-resolution encoding value;

[0044] a second encoding module, configured to perform low-resolution encoding and high-resolution encoding on the second segment content respectively to obtain a corresponding second low-resolution encoding value and a second high-resolution encoding value, and generate a second encoding value based on the second low-resolution encoding value and the second high-resolution encoding value;

[0045] A first comparison module, used for comparing the first coding value and the second coding value, and screening out the first designated coding value and the second designated coding value with different values;

[0046] A second acquisition module, configured to acquire first designated segment content corresponding to the first designated coding value from the first segment content, and acquire second designated segment content corresponding to the second designated coding value from the second segment content;

[0047] The second comparison module is used to compare the first specified segment content with the second specified segment content based on a preset parser to obtain corresponding change information.

[0048] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:

[0049] The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of any one of the data comparison methods proposed in the embodiments of the present application are implemented.

[0050] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:

[0051] The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of any one of the data comparison methods proposed in the embodiments of the present application are implemented.

[0052] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0053] When the update information corresponding to the target job is detected, the application obtains the update SQL statement and the original SQL statement corresponding to the target job; then the update SQL statement and the original SQL statement are segmented based on a preset segmentation strategy to obtain a first segmentation content corresponding to the update SQL statement, and a second segmentation content corresponding to the original SQL statement; then the first segmentation content is low-resolution encoded and high-resolution encoded to obtain a corresponding first low-resolution encoding value and a first high-resolution encoding value, and a first encoding value is generated based on the first low-resolution encoding value and the first high-resolution encoding value; and then the second segmentation content is low-resolution encoded and high-resolution encoded to obtain a first low-resolution encoding value and a first high-resolution encoding value. The high-resolution code and the high-resolution code obtain the corresponding second low-resolution code value and the second high-resolution code value, and generate the second code value based on the second low-resolution code value and the second high-resolution code value; further compare the first code value and the second code value to screen out the first designated code value and the second designated code value with different values; and obtain the first designated segment content corresponding to the first designated code value from the first segment content, and obtain the second designated segment content corresponding to the second designated code value from the second segment content; finally, compare the first designated segment content and the second designated segment content based on a preset parser to obtain corresponding change information. The present application uses a segmentation strategy to segment the update SQL statement and the original SQL statement respectively, and then performs low-resolution encoding and high-resolution encoding on the first segment content to obtain a first code value, and performs low-resolution encoding and high-resolution encoding on the second segment content to obtain a second code value, and then uses the first code value and the second code value to perform a comparison process, and screens out the first designated code value and the second designated code value with different values, and then uses a parser to compare the first designated segment content corresponding to the first designated code value and the second designated segment content corresponding to the second designated code value, so as to quickly and accurately obtain the corresponding change information. The present application performs SQL difference comparison by adopting a comparison method of segmenting the SQL statement and then performing code comparison, and no longer needs to perform a character-by-character comparison of the previous and next versions of the SQL statement, which greatly reduces the computing resources and time of the SQL difference comparison, effectively improves the comparison efficiency of the SQL difference comparison, and improves the comparison accuracy of the SQL difference comparison. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0055] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;

[0056] Figure 2 A flowchart according to an embodiment of the data comparison method of the present application;

[0057] Figure 3 is a structural schematic diagram of an embodiment of a data comparison device according to the present application;

[0058] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION

[0059] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0060] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0061] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0062] like Figure 1As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0063] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0064] The terminal devices 101, 102, and 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, desktop computers, and the like.

[0065] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .

[0066] It should be noted that the data comparison method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the data comparison device is generally set in the server / terminal device.

[0067] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0068] Continue to refer Figure 2, shows a flow chart of an embodiment of the data comparison method according to the present application. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted. The data comparison method provided in the embodiment of the present application can be applied to any scenario where SQL statement comparison of related operations is required, and the data comparison method can be applied to products in these scenarios, for example, SQL statement comparison of related operations in the financial insurance field. The data comparison method comprises the following steps:

[0069] Step S201, when update information corresponding to a target job is detected, an update SQL statement and an original SQL statement corresponding to the target job are obtained.

[0070] In this embodiment, the electronic device (eg, Figure 1 The server / terminal device shown in the figure) can obtain the updated SQL statement and the original SQL statement through a wired connection or a wireless connection. It should be pointed out that the above-mentioned wireless connection method may include but is not limited to 3G / 4G / 5G connection, Wi F i connection, Bluetooth connection, Wi MAX connection, Zigbee connection, UWB (Ultra Wi DeBand) connection, and other wireless connection methods currently known or to be developed in the future. The execution subject of this application may specifically be an operation platform. In the field of finance and insurance, in order to improve the business marketing effect, the construction and maintenance of the rights and interests system has become a crucial link. The rights and interests system provides users with a flexible and changeable rights and interests experience by defining and managing various rights and interests packages (usually including services, resources or privileges that users can enjoy). The rights and interests system determines whether the user has completed the standard behavior mainly by running the job batch on the big data platform. In the job, SQL statements are mainly relied on to retrieve data from the data table, and then the data is analyzed to determine whether the user has met the preset standard conditions to trigger the corresponding rights and interests distribution. When a job, such as the SQL statement of the target job, is modified, the big data platform will push an update message corresponding to the target job. This update message often only contains which job's SQL statement has been modified, but does not reveal the specific content of the SQL statement modification. The above-mentioned updated SQL statement corresponding to the target job refers to the current version of the SQL statement corresponding to the target job, and the above-mentioned original SQL statement corresponding to the target job refers to the previous version of the SQL statement corresponding to the target version.

[0071] Step S202: segment the update SQL statement and the original SQL statement based on a preset segmentation strategy to obtain first segment content corresponding to the update SQL statement and second segment content corresponding to the original SQL statement.

[0072] In this embodiment, the number of the first segment content and the second segment content includes multiple, and the segment content can also be a substring. The specific implementation process of segmenting the update SQL statement and the original SQL statement based on the preset segmentation strategy to obtain the first segment content corresponding to the update SQL statement and the second segment content corresponding to the original SQL statement will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated on here.

[0073] Step S203 , performing low-resolution encoding and high-resolution encoding on the first segment content to obtain corresponding first low-resolution encoding values ​​and first high-resolution encoding values, and generating a first encoding value based on the first low-resolution encoding value and the first high-resolution encoding value.

[0074] In the present embodiment, the above-mentioned low-resolution encoding and high-resolution encoding of the first segmented content are respectively performed to obtain the corresponding first low-resolution coding value and first high-resolution coding value, and the specific implementation process of generating the first coding value based on the first low-resolution coding value and the first high-resolution coding value will be further described in detail in the subsequent specific embodiments of the present application and will not be elaborated on here.

[0075] Step S204: performing low-resolution encoding and high-resolution encoding on the second segment content to obtain corresponding second low-resolution encoding values ​​and second high-resolution encoding values, and generating a second encoding value based on the second low-resolution encoding value and the second high-resolution encoding value.

[0076] In this embodiment, the specific implementation process of respectively performing low-resolution encoding and high-resolution encoding on the second segmented content to obtain corresponding second low-resolution coding values ​​and second high-resolution coding values, and generating the second coding value based on the second low-resolution coding value and the second high-resolution coding value can refer to the aforementioned specific implementation method of respectively performing low-resolution encoding and high-resolution encoding on the first segmented content to obtain corresponding first low-resolution coding values ​​and first high-resolution coding values, and generating the first coding value based on the first low-resolution coding value and the first high-resolution coding value, and will not be repeated here.

[0077] Step S205 , comparing the first coding value and the second coding value to select the first designated coding value and the second designated coding value with different values.

[0078] In this embodiment, the above-mentioned specific implementation process of comparing the first coding value and the second coding value to screen out the first designated coding value and the second designated coding value with different numerical values ​​will be further described in detail in the subsequent specific embodiments of this application and will not be elaborated in detail here.

[0079] Step S206: acquiring first designated segment content corresponding to the first designated coding value from the first segment content, and acquiring second designated segment content corresponding to the second designated coding value from the second segment content.

[0080] In this embodiment, the first segment content may be content matched according to the first designated coding value to obtain the corresponding first designated segment content, and the second segment content may be content matched according to the second designated coding value to obtain the corresponding second designated segment content.

[0081] Step S207: Compare the first designated segment content with the second designated segment content based on a preset parser to obtain corresponding change information.

[0082] In this embodiment, the above-mentioned specific implementation process of comparing the first specified segment content with the second specified segment content based on the preset parser to obtain the corresponding change information will be further described in detail in subsequent specific embodiments of the present application and will not be elaborated here.

[0083] The present application uses a segmentation strategy to segment the update SQL statement and the original SQL statement respectively, and then performs low-resolution encoding and high-resolution encoding on the first segment content to obtain a first code value, and performs low-resolution encoding and high-resolution encoding on the second segment content to obtain a second code value, and then uses the first code value and the second code value to perform a comparison process, and screens out the first designated code value and the second designated code value with different values, and then uses a parser to compare the first designated segment content corresponding to the first designated code value and the second designated segment content corresponding to the second designated code value, so as to quickly and accurately obtain the corresponding change information. The present application performs SQL difference comparison by adopting a comparison method of segmenting the SQL statement and then performing code comparison, and no longer needs to perform a character-by-character comparison of the previous and next versions of the SQL statement, which greatly reduces the computing resources and time of the SQL difference comparison, effectively improves the comparison efficiency of the SQL difference comparison, and improves the comparison accuracy of the SQL difference comparison.

[0084] In some optional implementations of this embodiment, step S202 includes the following steps:

[0085] Get the preset segment value.

[0086] In this embodiment, there is no specific limitation on the value of the above segmentation value, which can be set according to actual usage requirements. Specifically, by collecting a certain number of SQL statements from the operation platform as samples, these samples are representative and can cover the common SQL types and structures in the operation platform. Then, according to the average length of the above SQL statements, a preliminary segmentation size (for example, 100 characters per segment) is set as the above segmentation value. This segmentation size is an adjustable initial value, which can be adjusted later according to the actual effect.

[0087] A segmentation algorithm is constructed based on the segmentation values.

[0088] In this embodiment, a segmentation algorithm is written, which can segment the SQL statement into multiple substrings (i.e., segment contents) according to the set segmentation values. If the end of the SQL statement is not enough to form a complete segment, the remaining part can be processed as a segment.

[0089] The update SQL statement and the original SQL statement are segmented based on the segmentation algorithm to obtain the first segment content corresponding to the update SQL statement and the second segment content corresponding to the original SQL statement.

[0090] In this embodiment, by running the segmentation algorithm and segmenting the update SQL statement and the original SQL statement according to the segmentation logic in the segmentation algorithm, the first segmentation content corresponding to the update SQL statement and the second segmentation content corresponding to the original SQL statement are obtained. If the structure of the SQL statement is relatively fixed (such as the fixed part of the SELECT, INSERT, UPDATE and other statements), the SQL statement can be segmented at the structural demarcation point to retain the integrity of the structure. In addition, when segmenting, special characters in the SQL statement (such as spaces, commas, semicolons, etc.) can be considered to perform more natural segmentation without affecting the structure of the SQL statement.

[0091] The present application obtains a preset segmentation value; then constructs a segmentation algorithm based on the segmentation value; and then performs segmentation processing on the update SQL statement and the original SQL statement based on the segmentation algorithm to obtain the first segmentation content corresponding to the update SQL statement, and obtain the second segmentation content corresponding to the original SQL statement. The present application uses a segmentation algorithm constructed based on a preset segmentation value to perform segmentation processing on the update SQL statement and the original SQL statement, so as to quickly and intelligently obtain the first segmentation content corresponding to the update SQL statement, and obtain the second segmentation content corresponding to the original SQL statement, thereby effectively improving the processing efficiency of the segmentation processing of the update SQL statement and the original SQL statement.

[0092] In some optional implementations, step S203 includes the following steps:

[0093] The first segment content is low-resolution encoded based on a preset first Hash algorithm to obtain the corresponding first low-resolution encoding value.

[0094] In this embodiment, the first hash algorithm may specifically adopt a fast hash algorithm with fast calculation speed and low resource consumption, such as CRC32, FNV-1 and other hash algorithms. The first segment content is hashed using the first hash algorithm, and the first hash value obtained by the calculation is used as the first low-resolution encoded value. The first low-resolution encoded value is subsequently stored or cached for subsequent comparison.

[0095] The first segmented content is encoded with high resolution based on a preset second hash algorithm to obtain the corresponding first high resolution encoding value.

[0096] In this embodiment, the second hash algorithm may specifically adopt a hash algorithm with higher resolution but slower calculation speed, such as MD5 or SHA-256. The first segment content is hashed using the second hash algorithm, and the calculated second hash value is used as the first high-resolution encoding value. The first high-resolution encoding value is subsequently stored or cached for subsequent comparison.

[0097] The first low-resolution coding value and the first high-resolution coding value are concatenated to obtain the first coding value.

[0098] In this embodiment, the above-mentioned splicing processing of the first low-resolution coding value and the first high-resolution coding value to obtain the specific implementation process of the first coding value will be further described in detail in subsequent specific embodiments of the present application and will not be elaborated in detail here.

[0099] The present application performs low-resolution encoding on the first segmented content based on a preset first hash algorithm to obtain the corresponding first low-resolution encoding value; and performs high-resolution encoding on the first segmented content based on a preset second hash algorithm to obtain the corresponding first high-resolution encoding value; and subsequently splices the first low-resolution encoding value and the first high-resolution encoding value to obtain the first encoding value. The present application performs low-resolution encoding and high-resolution encoding on the first segmented content based on a preset first hash algorithm and a second hash algorithm, respectively, to achieve rapid and intelligent generation of the corresponding first low-resolution encoding value and first high-resolution encoding value, and then subsequently splices the first low-resolution encoding value and the first high-resolution encoding value to obtain the first encoding value, thereby effectively improving the generation efficiency of the first encoding value.

[0100] In some optional implementations, the step of concatenating the first low-resolution coded value and the first high-resolution coded value to obtain the first coded value comprises the following steps:

[0101] Get the preset splicing order.

[0102] In this embodiment, the splicing order can be set according to actual needs and safety considerations. For example, the first low-resolution code value can be firstly spliced, and then the first high-resolution code value can be spliced, or any other order can be adopted.

[0103] The first low-resolution coding value and the first high-resolution coding value are spliced ​​based on the splicing order to obtain corresponding splicing data.

[0104] In this embodiment, according to the determined splicing order, the first low-resolution coded value and the first high-resolution coded value are directly spliced ​​into a longer coded data, namely the spliced ​​data. The splicing process can be implemented by a string concatenation operator (such as + in Python, + or template string in JavaScript, + or StringBuilder / StringBuffer in Java, etc.).

[0105] The concatenated data is used as the first encoding value.

[0106] The present application obtains a preset splicing order; then splices the first low-resolution coding value and the first high-resolution coding value based on the splicing order to obtain corresponding splicing data; and subsequently uses the splicing data as the first coding value. The present application uses the splicing order to splice the first low-resolution coding value and the first high-resolution coding value to quickly and intelligently generate a first coding value that meets the requirements, effectively improving the generation efficiency and generation intelligence of the first coding value.

[0107] In some optional implementations of this embodiment, step S205 includes the following steps:

[0108] Get the preset comparison algorithm.

[0109] In this embodiment, the above comparison algorithm specifically adopts a sliding window comparison method.

[0110] The first coding value and the second coding value are compared based on the comparison algorithm to obtain a corresponding comparison result.

[0111] In this embodiment, by using a sliding window and setting each window length of the sliding window to the above segment value, the first code value and the second code value are subjected to a sliding comparison process of matching segments. If the same code value is found in the sliding comparison process of a certain group of code values ​​in the first code value, it means that the content of the segment corresponding to the certain group of code values ​​has not changed. If the same code value is not found in the sliding comparison process of a certain group of code values ​​in the first code value, it means that the content of the segment corresponding to the certain group of code values ​​has changed, that is, the content of the segment has been updated.

[0112] The comparison result is subjected to data analysis to select the first designated coding value and the second designated coding value having different numerical values ​​from the first coding value and the second coding value.

[0113] In this embodiment, data analysis is performed on the comparison result to find out the designated segment content that has been updated, and the first designated coding value and the second designated coding value corresponding to the designated segment content are selected from the first coding value and the second coding value.

[0114] The present application obtains a preset comparison algorithm; then compares the first coding value and the second coding value based on the comparison algorithm to obtain a corresponding comparison result; and subsequently performs data analysis on the comparison result to correspondingly screen out the first designated coding value and the second designated coding value with different values ​​from the first coding value and the second coding value. The present application uses a comparison algorithm to compare the first coding value and the second coding value, and then performs data analysis on the obtained comparison result, so as to quickly and accurately screen out the first designated coding value and the second designated coding value with different values ​​from the first coding value and the second coding value, effectively improving the comparison efficiency of the comparison processing of the first coding value and the second coding value, and ensuring the accuracy of the obtained comparison result.

[0115] In some optional implementations, step S207 includes the following steps:

[0116] The first segment content and the second segment content are parsed based on the parser to obtain a first syntax tree corresponding to the first segment content and a second syntax tree corresponding to the second segment content.

[0117] In the present embodiment, the above-mentioned parser can specifically adopt ANTLR. ANTLR (Another Tool for Language Recognition) is a powerful parser generator, which can be used to read, process, execute or translate structured text or binary files. For SQL, ANTLR provides a ready-made grammar file (grammar), which can be easily converted into a syntax tree (AST, Abstract Syntax Tree). The parsing process of ANTLR includes: parsing the original SQL string into a syntax tree through the SQL grammar file of ANTLR. This process ignores the format of the original SQL (such as line breaks, spaces, etc.), and only pays attention to its structure (such as keywords such as SELECT, FROM, WHERE and the relationship between them).

[0118] The first syntax tree and the second syntax tree are respectively subjected to a preset formatting process to obtain a first SQL string corresponding to the first syntax tree and a second SQL string corresponding to the second syntax tree.

[0119] In this embodiment, a formatting rule is pre-set, and the content of the formatting rule is that each node occupies one line. Specifically, by traversing the syntax tree, according to the above formatting rule, each node in the syntax tree is spliced ​​into an SQL string again in a one-node-one-line manner to ensure that each node occupies one line, thereby obtaining a SQL string with a unified format.

[0120] A difference comparison is performed on the first SQL string and the second SQL string based on a preset difference comparison algorithm to obtain a corresponding difference comparison result.

[0121] In this embodiment, the above difference comparison algorithm can specifically adopt the longest common subsequence LCS, dynamic programming and other algorithms. By using the difference comparison algorithm to compare the first SQL string with the second SQL string, the difference between the first SQL string and the second SQL string can be found to obtain the corresponding difference comparison result. The difference is usually manifested as the addition, deletion or replacement of characters.

[0122] Perform line number mapping processing on the difference comparison result to obtain corresponding line number change information.

[0123] In this embodiment, since the SQL string has been formatted as one line per node, the difference between the first SQL string and the second SQL string can be mapped to a specific line number and used as the corresponding line number change information.

[0124] The change information is generated based on the first SQL character string, the second SQL character string, and the row number change information.

[0125] In this embodiment, the first SQL string, the second SQL string, and the row number change information may be integrated to obtain integrated information, and the integrated information may be used as the change information.

[0126] The present application parses the first segment content and the second segment content based on the parser to obtain a first syntax tree corresponding to the first segment content and a second syntax tree corresponding to the second segment content; then performs preset formatting on the first syntax tree and the second syntax tree to obtain a first SQL string corresponding to the first syntax tree and a second SQL string corresponding to the second syntax tree; then performs a difference comparison on the first SQL string and the second SQL string based on a preset difference comparison algorithm to obtain a corresponding difference comparison result; subsequently performs line number mapping on the difference comparison result to obtain corresponding line number change information; finally, generates the change information based on the first SQL string, the second SQL string and the line number change information. The present application compares the first specified segment content and the second specified segment content based on the use of a parser and a difference comparison algorithm, so as to realize the rapid and accurate generation of corresponding change information, improve the generation efficiency of change information, and ensure the data accuracy of the obtained change information. In addition, the difference comparison result will be mapped to a line number to obtain corresponding line number change information, and then the change information will be generated based on the first SQL string, the second SQL string and the line number change information, so that relevant personnel can intuitively locate the change position of the second SQL string relative to the first SQL string through the line number change information, thereby improving the user experience of relevant personnel.

[0127] In some optional implementations of this embodiment, after the step of generating the change information based on the first SQL string, the second SQL string, and the row number change information, the electronic device may further perform the following steps:

[0128] Generate change reminder information based on the target job and the change information.

[0129] In this embodiment, the job identifier of the target job is obtained, and then the job identifier and the change information are filled into the corresponding positions in the preset change reminder information template to generate the corresponding change reminder information. The above-mentioned change reminder information template can be an information template including a job identifier area and a change information area pre-built according to actual business needs.

[0130] Get the communication method corresponding to the preset job leader.

[0131] In this embodiment, the operation person in charge may be the administrator of the operation platform. The above communication information may include emails, text messages, instant messages, etc.

[0132] Based on the communication method, the change reminder information is sent to the operation person in charge.

[0133] In this embodiment, the change reminder information can be sent to the communication terminal corresponding to the operation person in charge by using the communication method.

[0134] This application generates change reminder information based on the target job and the change information; then obtains the communication method corresponding to the preset job leader; and subsequently sends the change reminder information to the job leader based on the communication method. After generating the change information based on the first SQL string, the second SQL string, and the row number change information, this application will also intelligently generate change reminder information based on the target job and the change information, and then send the change reminder information to the job leader according to the communication method corresponding to the job leader, so that the job leader can intuitively locate the changes in the second SQL string relative to the first SQL string by checking the change reminder information, thereby improving the user experience of the job leader and improving the efficiency of the job leader in confirming SQL.

[0135] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0136] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned change information, the above-mentioned change information can also be stored in a node of a blockchain.

[0137] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0138] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0139] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0140] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0141] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0142] Further references Figure 3 , as a response to the above Figure 2 In order to realize the method shown in the figure, the present application provides an embodiment of a data comparison device, and the device embodiment is Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0143] like Figure 3 As shown, the data comparison device 300 described in this embodiment includes: a first acquisition module 301, a processing module 302, a first encoding module 303, a second encoding module 304, a first comparison module 305, a second acquisition module 306 and a second comparison module 307. Among them:

[0144] A first acquisition module, configured to acquire an update SQL statement and an original SQL statement corresponding to a target job when update information corresponding to the target job is detected;

[0145] A processing module, configured to perform segmentation processing on the update SQL statement and the original SQL statement respectively based on a preset segmentation strategy, to obtain a first segmentation content corresponding to the update SQL statement, and to obtain a second segmentation content corresponding to the original SQL statement;

[0146] a first encoding module, configured to perform low-resolution encoding and high-resolution encoding on the first segment content respectively to obtain a corresponding first low-resolution encoding value and a first high-resolution encoding value, and generate a first encoding value based on the first low-resolution encoding value and the first high-resolution encoding value;

[0147] a second encoding module, configured to perform low-resolution encoding and high-resolution encoding on the second segment content respectively to obtain a corresponding second low-resolution encoding value and a second high-resolution encoding value, and generate a second encoding value based on the second low-resolution encoding value and the second high-resolution encoding value;

[0148] A first comparison module, used for comparing the first coding value and the second coding value, and screening out the first designated coding value and the second designated coding value with different values;

[0149] A second acquisition module, configured to acquire first designated segment content corresponding to the first designated coding value from the first segment content, and acquire second designated segment content corresponding to the second designated coding value from the second segment content;

[0150] The second comparison module is used to compare the first specified segment content with the second specified segment content based on a preset parser to obtain corresponding change information.

[0151] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the data comparison method in the above-mentioned implementation mode, and are not described in detail here.

[0152] In some optional implementations of this embodiment, the processing module 302 includes:

[0153] A first acquisition submodule is used to acquire a preset segment value;

[0154] A construction submodule, used for constructing a segmentation algorithm based on the segmentation values;

[0155] The segmentation submodule is used to segment the update SQL statement and the original SQL statement based on the segmentation algorithm to obtain the first segment content corresponding to the update SQL statement and the second segment content corresponding to the original SQL statement.

[0156] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the data comparison method in the above-mentioned implementation mode, and are not described in detail here.

[0157] In some optional implementations of this embodiment, the first encoding module 303 includes:

[0158] A first encoding submodule, configured to perform low-resolution encoding on the first segmented content based on a preset first hash algorithm to obtain the corresponding first low-resolution encoding value;

[0159] A second encoding submodule, configured to perform high-resolution encoding on the first segmented content based on a preset second hash algorithm to obtain the corresponding first high-resolution encoding value;

[0160] The splicing submodule is used to splice the first low-resolution coding value and the first high-resolution coding value to obtain the first coding value.

[0161] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the data comparison method in the above-mentioned implementation mode, and will not be described in detail here.

[0162] In some optional implementations of this embodiment, the splicing submodule includes:

[0163] An acquisition unit, used for acquiring a preset splicing order;

[0164] a splicing unit, configured to splice the first low-resolution coded value and the first high-resolution coded value based on the splicing order to obtain corresponding spliced ​​data;

[0165] A determining unit is configured to use the spliced ​​data as the first encoding value.

[0166] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the data comparison method in the above-mentioned implementation mode, and are not described in detail here.

[0167] In some optional implementations of this embodiment, the first comparison module 305 includes:

[0168] The second acquisition submodule is used to acquire a preset comparison algorithm;

[0169] A first comparison submodule, used for comparing the first coding value with the second coding value based on the comparison algorithm to obtain a corresponding comparison result;

[0170] The screening submodule is used to perform data analysis on the comparison result to correspondingly screen out the first designated coding value and the second designated coding value having different numerical values ​​from the first coding value and the second coding value.

[0171] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the data comparison method in the above-mentioned implementation mode, and are not described in detail here.

[0172] In some optional implementations of this embodiment, the second comparison module 307 includes:

[0173] A parsing submodule, configured to parse the first segment content and the second segment content respectively based on the parser to obtain a first syntax tree corresponding to the first segment content and a second syntax tree corresponding to the second segment content;

[0174] a processing submodule, configured to perform preset formatting processing on the first syntax tree and the second syntax tree respectively, to obtain a first SQL string corresponding to the first syntax tree, and to obtain a second SQL string corresponding to the second syntax tree;

[0175] A second comparison submodule, configured to perform a difference comparison between the first SQL string and the second SQL string based on a preset difference comparison algorithm to obtain a corresponding difference comparison result;

[0176] A mapping submodule, used to perform line number mapping processing on the difference comparison result to obtain corresponding line number change information;

[0177] The first generating submodule is used as a submodule, and is used to generate the change information based on the first SQL string, the second SQL string and the row number change information.

[0178] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the data comparison method in the above-mentioned implementation mode, and are not described in detail here.

[0179] In some optional implementations of this embodiment, the second comparison module 307 further includes:

[0180] A second generating submodule, configured to generate change reminder information based on the target job and the change information;

[0181] The third acquisition submodule is used to acquire the communication method corresponding to the preset operation person in charge;

[0182] The sending submodule is used to send the change reminder information to the operation person in charge based on the communication method.

[0183] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the data comparison method in the above-mentioned implementation mode, and are not described in detail here.

[0184] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.

[0185] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital processors (DSPs), embedded devices, etc.

[0186] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0187] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk equipped on the computer device 4, a smart memory card (Smart Med ia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the data comparison method, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.

[0188] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run the computer-readable instructions stored in the memory 41 or process data, such as computer-readable instructions for running the data comparison method.

[0189] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.

[0190] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0191] In the embodiment of the present application, the updated SQL statement and the original SQL statement are segmented by using a segmentation strategy, and then the first segment content is encoded by low resolution and high resolution to obtain a first code value, and the second segment content is encoded by low resolution and high resolution to obtain a second code value, and then the first code value and the second code value are compared and processed to screen out the first designated code value and the second designated code value with different values, and then the parser is used to compare the first designated segment content corresponding to the first designated code value and the second designated segment content corresponding to the second designated code value, so as to quickly and accurately obtain the corresponding change information. The present application performs SQL difference comparison by adopting a comparison method of segmenting SQL statements and then performing code comparison, and no longer needs to perform character-by-character comparison of the previous and next versions of SQL statements, which greatly reduces the computing resources and time of SQL difference comparison, effectively improves the comparison efficiency of SQL difference comparison, and improves the comparison accuracy of SQL difference comparison.

[0192] The present application also provides another embodiment, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the data comparison method as described above.

[0193] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0194] In the embodiment of the present application, the updated SQL statement and the original SQL statement are segmented by using a segmentation strategy, and then the first segment content is encoded by low resolution and high resolution to obtain a first code value, and the second segment content is encoded by low resolution and high resolution to obtain a second code value, and then the first code value and the second code value are compared and processed to screen out the first designated code value and the second designated code value with different values, and then the parser is used to compare the first designated segment content corresponding to the first designated code value and the second designated segment content corresponding to the second designated code value, so as to quickly and accurately obtain the corresponding change information. The present application performs SQL difference comparison by adopting a comparison method of segmenting SQL statements and then performing code comparison, and no longer needs to perform character-by-character comparison of the previous and next versions of SQL statements, which greatly reduces the computing resources and time of SQL difference comparison, effectively improves the comparison efficiency of SQL difference comparison, and improves the comparison accuracy of SQL difference comparison.

[0195] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0196] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. A data comparison method, characterized in that: The steps include: When update information corresponding to the target job is detected, an update SQL statement and an original SQL statement corresponding to the target job are obtained; Based on a preset segmentation strategy, the update SQL statement and the original SQL statement are segmented to obtain first segment content corresponding to the update SQL statement and second segment content corresponding to the original SQL statement; Performing low-resolution encoding and high-resolution encoding on the first segment content to obtain corresponding first low-resolution encoding values ​​and first high-resolution encoding values, and generating a first encoding value based on the first low-resolution encoding value and the first high-resolution encoding value; Performing low-resolution encoding and high-resolution encoding on the second segment content to obtain corresponding second low-resolution encoding values ​​and second high-resolution encoding values, and generating a second encoding value based on the second low-resolution encoding value and the second high-resolution encoding value; Compare the first coding value and the second coding value to select the first designated coding value and the second designated coding value with different values; Acquire a first designated segment content corresponding to the first designated coding value from the first segment content, and acquire a second designated segment content corresponding to the second designated coding value from the second segment content; Based on a preset parser, the first designated segment content and the second designated segment content are compared and processed to obtain corresponding change information.

2. The data comparison method according to claim 1, characterized in that: The step of segmenting the update SQL statement and the original SQL statement based on a preset segmentation strategy to obtain first segment content corresponding to the update SQL statement and second segment content corresponding to the original SQL statement specifically includes: Get the preset segment value; Constructing a segmentation algorithm based on the segmentation values; The update SQL statement and the original SQL statement are segmented based on the segmentation algorithm to obtain the first segment content corresponding to the update SQL statement and the second segment content corresponding to the original SQL statement.

3. The data comparison method according to claim 1, characterized in that: The step of respectively performing low-resolution encoding and high-resolution encoding on the first segment content to obtain a corresponding first low-resolution encoding value and a first high-resolution encoding value, and generating a first encoding value based on the first low-resolution encoding value and the first high-resolution encoding value specifically includes: Performing low-resolution encoding on the first segment content based on a preset first hash algorithm to obtain the corresponding first low-resolution encoding value; Performing high-resolution encoding on the first segmented content based on a preset second hash algorithm to obtain the corresponding first high-resolution encoding value; The first low-resolution coding value and the first high-resolution coding value are concatenated to obtain the first coding value.

4. The data comparison method according to claim 3, characterized in that: The step of concatenating the first low-resolution coded value and the first high-resolution coded value to obtain the first coded value specifically includes: Get the preset splicing order; Based on the splicing order, the first low-resolution coding value and the first high-resolution coding value are spliced ​​to obtain corresponding spliced ​​data; The concatenated data is used as the first encoding value.

5. The data comparison method according to claim 1, characterized in that: The step of comparing the first coding value and the second coding value to select the first designated coding value and the second designated coding value with different values ​​specifically includes: Get the preset comparison algorithm; Compare the first coding value with the second coding value based on the comparison algorithm to obtain a corresponding comparison result; The comparison result is subjected to data analysis to select the first designated coding value and the second designated coding value having different numerical values ​​from the first coding value and the second coding value.

6. The data comparison method according to claim 1, characterized in that: The step of comparing the first designated segment content with the second designated segment content based on a preset parser to obtain corresponding change information specifically includes: Based on the parser, the first segment content and the second segment content are parsed respectively to obtain a first syntax tree corresponding to the first segment content and a second syntax tree corresponding to the second segment content; Performing preset formatting processing on the first syntax tree and the second syntax tree respectively to obtain a first SQL string corresponding to the first syntax tree and a second SQL string corresponding to the second syntax tree; Performing a difference comparison between the first SQL string and the second SQL string based on a preset difference comparison algorithm to obtain a corresponding difference comparison result; Performing line number mapping processing on the difference comparison result to obtain corresponding line number change information; The change information is generated based on the first SQL character string, the second SQL character string, and the row number change information.

7. The data comparison method according to claim 6, characterized in that: After the step of generating the change information based on the first SQL string, the second SQL string and the row number change information, the method further includes: generating change reminder information based on the target job and the change information; Obtain the communication method corresponding to the preset task leader; Based on the communication method, the change reminder information is sent to the operation person in charge.

8. A data comparison device, characterized in that: include: A first acquisition module, configured to acquire an update SQL statement and an original SQL statement corresponding to a target job when update information corresponding to the target job is detected; A processing module, configured to segment the update SQL statement and the original SQL statement based on a preset segmentation strategy, to obtain first segmentation content corresponding to the update SQL statement, and to obtain second segmentation content corresponding to the original SQL statement; a first encoding module, configured to perform low-resolution encoding and high-resolution encoding on the first segment content respectively to obtain a corresponding first low-resolution encoding value and a first high-resolution encoding value, and generate a first encoding value based on the first low-resolution encoding value and the first high-resolution encoding value; a second encoding module, configured to perform low-resolution encoding and high-resolution encoding on the second segment content respectively to obtain a corresponding second low-resolution encoding value and a second high-resolution encoding value, and generate a second encoding value based on the second low-resolution encoding value and the second high-resolution encoding value; A first comparison module, used for comparing the first coding value and the second coding value, and screening out the first designated coding value and the second designated coding value with different values; A second acquisition module, configured to acquire first designated segment content corresponding to the first designated coding value from the first segment content, and acquire second designated segment content corresponding to the second designated coding value from the second segment content; The second comparison module is used to compare the first specified segment content with the second specified segment content based on a preset parser to obtain corresponding change information.

9. A computer device, comprising a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the data comparison method according to any one of claims 1 to 7 when executing the computer-readable instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the data comparison method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Data comparison method and device, storage medium and computer equipment

    CN115129745A

  • Text coding method and device, electronic equipment and storage medium

    CN116127983A

  • Tail biting convolutional code encoding method and decoding method adopting hash function

    CN116743189A

  • Data updating method and device and electronic equipment

    CN117407405A

  • Semantic document analysis

    US8949242B1