CN109828985B - Form difference query method and device - Google Patents

Form difference query method and device Download PDF

Info

Publication number
CN109828985B
CN109828985B CN201811614062.6A CN201811614062A CN109828985B CN 109828985 B CN109828985 B CN 109828985B CN 201811614062 A CN201811614062 A CN 201811614062A CN 109828985 B CN109828985 B CN 109828985B
Authority
CN
China
Prior art keywords
data
column
difference
row
displaying
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811614062.6A
Other languages
Chinese (zh)
Other versions
CN109828985A (en
Inventor
李斌
张广奇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Datang Software Technologies Co Ltd
Original Assignee
Datang Software Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Datang Software Technologies Co Ltd filed Critical Datang Software Technologies Co Ltd
Priority to CN201811614062.6A priority Critical patent/CN109828985B/en
Publication of CN109828985A publication Critical patent/CN109828985A/en
Application granted granted Critical
Publication of CN109828985B publication Critical patent/CN109828985B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the invention provides a form difference query method and a form difference query device, wherein the method comprises the following steps: calling a first form and a second form; inquiring whether the data of each row in the corresponding column of the second form is different from the data of the corresponding row in the first form or not based on the data of each column of the first form; and displaying all the queried difference data marks on the first form and/or the second form. The method can be directly realized on the terminal equipment through programming without using third-party difference analysis software, so that the risk of data leakage in the form is avoided; the method can realize the difference comparison of the whole form data at one time, is accurate and efficient, and improves the working efficiency.

Description

Form difference query method and device
Technical Field
The invention relates to the technical field of computers, in particular to a form difference query method and a form difference query device.
Background
In the prior art, the difference comparison of different form data can be generally realized by the following two schemes. In the first scheme, query functions such as SUMPMODUCT and VLOOKUP are called in a form file; however, since the functions are all based on the comparison of data in a certain column in the form, only the difference before and after the data in a certain column is changed can be compared, the data in the whole form cannot be compared, and the function setting is performed in each comparison, so that input errors are easy to occur, and no result is output; performing difference query operation by using third-party difference analysis software; however, for sensitive data, there is a security risk in using third-party software for operation, and the third-party software may occupy a large amount of resources such as system operation, memory, and the like.
Therefore, the method for performing difference comparison on form data in the prior art has the problems that the method is not safe enough and cannot query the whole form data at one time, so that a scheme capable of ensuring data safety and performing difference comparison on the whole form data at one time is urgently needed.
Disclosure of Invention
In view of this, embodiments of the present invention provide a form difference query method and apparatus, so as to solve the problems that the existing form difference query scheme is not secure enough and cannot query the whole form data at one time.
In order to solve the above problem, the invention discloses a form difference query method, which comprises the following steps:
calling a first form and a second form;
inquiring whether the data of each row in the corresponding column of the second form is different from the data of the corresponding row in the first form or not based on the data of each column of the first form;
and displaying all the queried difference data marks on the first form and/or the second form.
Preferably, before invoking the first form and the second form, the method includes:
receiving an operation of opening a Visual Basic editor in an Excel report file; the Excel report file comprises a first worksheet and a second worksheet;
the invoking the first form and the second form includes:
calling the first worksheet and the second worksheet in the Visual Basic editor.
Preferably, the step of querying whether the data of each row in the corresponding column of the second form is the same as the data of the corresponding row in the first form based on the data of each column of the first form includes:
s1: judging whether first data of an M (M is more than or equal to 1 and less than or equal to the row number of the first form) row in an N (N is more than or equal to 1 and less than or equal to the row number of the first form) column of the first form is the same as second data of an M row in an N column corresponding to the second form;
s2: executing a first scheme if the second data is the same as the first data; the first scheme includes: judging whether the third data of the M +1 th line in the Nth column of the first form is the same as the fourth data of the M +1 th line in the Nth column corresponding to the second form or not;
executing a second scheme if the second data is different from the first data; the second aspect includes: marking and displaying the second data and/or the first data in a form where the second data and/or the first data are located; and after the mark is displayed, returning to the step of executing the first scheme;
s3: step S2 is executed in a loop each time the current row number is +1 until all rows in the nth column of the first form and the second form are queried;
s4: sequentially executing the step S1 and the step S2, and inquiring data of all rows in the N +1 th column of the first form and the second form;
s5: and each time the current column number is +1, circularly executing the step S4 until all columns in the first form and the second form are queried.
Preferably, the displaying all the queried difference data marks on the first form and/or the second form includes:
under the condition that the difference data does not comprise data with a null value, marking and displaying a cell where the difference data is located, or displaying the difference data through one of a font, a font size and a color which are different from form data to which the difference data belongs;
and under the condition that the difference data comprises data with null values, marking and displaying the cells in which the difference data are positioned.
The embodiment of the invention also discloses a form difference query device, which comprises:
the calling module is used for calling the first form and the second form;
the query module is used for querying whether the data of each row in the corresponding column of the second form is different from the data of the corresponding row in the first form or not based on the data of each column of the first form;
and the display module is used for marking and displaying all the inquired difference data on the first form and/or the second form.
Preferably, the apparatus further comprises:
the opening module is used for receiving the operation of opening the Visual Basic editor in the Excel report file; the Excel report file comprises a first worksheet and a second worksheet;
the calling module comprises: and the calling submodule is used for calling the first worksheet and the second worksheet in the Visual Basic editor.
Preferably, the query module comprises:
an S1 sub-module, configured to determine whether first data in an M (M is greater than or equal to 1 and less than or equal to the number of rows of the first form) row in an N-th (N is greater than or equal to 1 and less than or equal to the number of columns of the first form) column of the first form is the same as second data in an M-th row in an N-th column corresponding to the second form;
an S2 sub-module for executing a first scheme if the second data is the same as the first data; the first scheme includes: judging whether the third data of the M +1 th line in the Nth column of the first form is the same as the fourth data of the M +1 th line in the Nth column corresponding to the second form or not;
executing a second scheme if the second data is different from the first data; the second aspect includes: marking and displaying the second data and/or the first data in a form where the second data and/or the first data are located; after the mark is displayed, returning to the step of executing the first scheme;
the sub-module of S3 is used for circularly executing the step S2 for the current row number +1 each time until all rows in the Nth column of the first form and the second form are inquired;
the S4 sub-module is configured to execute step S1 and step S2 in sequence, and query data of all rows in the N +1 th column of the first form and the second form;
and the sub-module of S5 is used for circularly executing the step S4 for the current column number +1 each time until all columns in the first form and the second form are queried.
Preferably, the display module includes:
the first display sub-module is used for marking and displaying the cell where the difference data is located under the condition that the difference data does not include data with a null value, or displaying the difference data through one of a font, a font size and a color which are different from the form data to which the difference data belongs;
and the second display submodule is used for marking and displaying the cell where the difference data is located under the condition that the difference data comprises data with null values.
Compared with the prior art, the invention has the following advantages:
in the embodiment of the present invention, a first form and a second form are called, and based on each column of data of the first form, whether there is a difference between data of each row in a corresponding column of the second form and data of a corresponding row in the first form is queried, and finally, all queried difference data are marked and displayed on the first form and/or the second form. The method can be directly realized on the terminal equipment through programming without using third-party difference analysis software, so that the risk of data leakage in the form is avoided; the method can realize the difference comparison of the whole form data at one time, is accurate and efficient, and improves the working efficiency.
Drawings
FIG. 1 is a flowchart illustrating a form difference query method according to a first embodiment of the present invention;
FIG. 2-1 shows a flowchart of a form difference query method implemented under a visual basic editor of an Excel report file in the second embodiment of the present invention;
2-2 is a diagram illustrating a first form with "data of this week" as the form name in the second embodiment of the present invention;
2-3 are diagrams illustrating a second form with "last week data" as the form name in the second embodiment of the present invention;
FIGS. 2-4 are schematic diagrams of pages after a visual basic editor is opened according to a second embodiment of the present invention;
FIGS. 2-5 are schematic diagrams of an edit page of a visual basic editor in accordance with a second embodiment of the present invention;
FIGS. 2-6 are schematic views of the running page of the visual basic editor in the second embodiment of the present invention;
FIGS. 2-7 are schematic views of a running result page of a visual basic editor in the second embodiment of the present invention;
fig. 3 shows a block diagram of a form difference query apparatus in a third embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example one
Referring to fig. 1, a flowchart of a form difference query method in an embodiment of the present invention is shown, which specifically includes the following steps:
step 101, calling a first form and a second form.
In an embodiment of the present invention, the form may be an electronic file that represents a plurality of data in the form of rows and columns, wherein the plurality of data are respectively located at intersections of the rows and columns in the form. Specifically, the form may be an Excel report file containing M (M ≧ 1) rows and N (N ≧ 1) columns of data, a spreadsheet drawn in the document containing M rows and N columns of data, or a matrix containing M rows and N columns of data. The form existence form is not particularly limited in the embodiment of the present invention. In addition, if the two sets of data to be compared for difference do not exist in the form of a form, the two sets of data need to be respectively recorded into two forms, so as to facilitate the subsequent calling of the form file for difference query.
Specifically, the embodiment of the present invention needs to compare the difference between two form files, so that two form files to be compared, that is, the first form and the second form, need to be called first. For example, the first form may be the week's data collected during a particular work session, while the second form may be the last week's data, i.e., the last week's data. When the form file is called, firstly, the storage paths of the two form files in the terminal equipment need to be acquired, and then the form file stored in the specific path is called through a programming language.
For example, if the Visual Basic programming language (VISUAL BASIC) environment is used to query for differences between two Excel forms, the process of calling the two Excel form files can be as follows:
firstly, a project of Visual Basic is newly established, a button is set, and names are given to the button and each layer object of Excel is defined. The reason for defining the object of each layer of Excel is because Excel organizes objects in a hierarchical structure, and the object model of Excel contains many different object elements. Wherein the first layer: application object, Excel itself; a second layer: a workbooks object set, which refers to the workbook file of Excel; and a third layer: a set of works objects, representing a worksheet of Excel; a fourth layer: the Cells and Range objects point to Cells in the Excel worksheet, so the above layer objects need to be defined first.
For example, the following language can be used to define the layer objects of Excel:
application' definition of Excel object
Dim xlboot As excel
Worksheet for definition of Dim xlsheet As excel
Then, if the first form and the second form are two different worksheets in the same Excel workbook, the programming language for calling one of the form files may be: 'Set xlsheet ═ xlapp. workbets. open (app. path & "\ upper week data. xls")', meaning that the existing upper week data. xls workbook file is opened in the path app. path.
In addition, if the first form and the second form are located in the same Excel workbook, since the Excel report file has the function of a visual basic editor, the visual basic editor can be directly opened in the Excel workbook containing the first form and the second form, and the first form and the second form can be called in a visual basic editing environment. Namely:
preferably, before invoking the first form and the second form, the method includes:
receiving an operation of opening a visual basic editor in an Excel report file; the Excel report file comprises a first worksheet and a second worksheet; the invoking the first form and the second form includes:
calling the first worksheet and the second worksheet in the Visual Basic editor.
In the embodiment of the invention, after the Excel report file is opened, two methods can be used for entering the visual basic editor interface. The method comprises the following steps: find "tools" menu in Excel menu, choose "macros", enter and then choose "Visual Basic editor". The method 2 comprises the following steps: and (3) inputting an Alt + F11 shortcut key on a keyboard, and opening a visual basic editing page. After entering a visual basic editing page, the worksheet file can be called by directly using the 'sheet name' in the program.
The Excel self-contained Visual Basic editor function is used for carrying out form difference query, the problem that other programming software needs to call a program of a form file at first is avoided, the flow of difference query is simplified, and simplicity and high efficiency are achieved.
Step 102, based on each column of data of the first form, querying whether there is a difference between data of each row in a corresponding column of the second form and data of a corresponding row in the first form.
In the embodiment of the invention, a reference column is selected from the first form, and is compared with a corresponding column in the second form according to the reference column. During comparison, the data in the first row of the reference column are compared line by line, and finally the comparison is completed; then, by the same method, taking the other line of the first form as a reference line, and comparing line by line; until finally all columns and rows of the first form and the second form are round-robin.
It should be noted that, in the comparison process, if a data value of a certain cell in the first form is empty, that is, the cell has no data, and in a cell corresponding to the corresponding second form, the data value is not empty, at this time, it is also considered that there is a difference between the data at the cells corresponding to the two forms.
Preferably, the step of querying whether the data of each row in the corresponding column of the second form is the same as the data of the corresponding row in the first form based on the data of each column of the first form includes:
s1: judging whether the data of the M (M is more than or equal to 1 and less than or equal to the row number of the first form) row in the N (N is more than or equal to 1 and less than or equal to the row number of the first form) column of the first form is the same as the data of the M row in the N column corresponding to the second form;
s2: executing a first scheme if the data is the same; the first scheme includes: judging whether the data of the M +1 th line in the Nth column of the first form is the same as the data of the M +1 th line in the Nth column corresponding to the second form;
in the case that the data are different, executing a second scheme; the second aspect includes: marking and displaying the data in the form where the data is located; and after the mark is displayed, returning to the step of executing the first scheme;
s3: step S2 is executed in a loop each time the current row number is +1 until all rows in the nth column of the first form and the second form are queried;
s4: sequentially executing the step S1 and the step S2, and inquiring data of all rows in the N +1 th column of the first form and the second form;
s5: and each time the current column number is +1, circularly executing the step S4 until all columns in the first form and the second form are queried.
In the embodiment of the present invention, step S1 is first entered: and judging whether the first data of the M (the M is more than or equal to 1 and less than or equal to the row number of the first form) row in the Nth (the N is more than or equal to 1 and less than or equal to the column number of the first form) column in the first form is the same as the second data of the M (the M is more than or equal to 1 and less than or equal to the row number of the first form) row in the Nth column corresponding to the. Specifically, it may be determined whether first data located at column 1 and row 1 of the first form is the same as second data located at column 1 and row 1 of the second form, starting with N ═ 1 and M ═ 1.
Step S2: according to the judgment result of the step S1, it is possible to perform the two schemes. And if the first data is the same as the second data, executing a first scheme, namely the current line number is +1, and continuously comparing the first data in the first form with the next data corresponding to the second data in the second form. Specifically, the third data of the 1 st column and 2 nd row of the first form may be compared with the fourth data of the 1 st column and 2 nd row of the second form. And if the comparison result is still the same, continuing to be the current line number +1, and comparing the third data in the first form with the next data corresponding to the fourth data in the second form. In the comparison process, if the two data are judged to be different, executing a second scheme, namely: marking and displaying the difference data in a form where the difference data are located; and after the mark is displayed, returning to the step of executing the first scheme. Namely, the current line number +1, the next data corresponding to the first data in the first form and the second data in the second form are continuously compared.
Step S3: and (4) circularly executing the step S2 each time the current line number is +1 until all the lines of the nth column of the first form and the second form are queried. Specifically, if the number of lines in the first form is less than that in the second form, the query may be stopped after all lines in the first form are queried, and the data corresponding to the cells in the remaining lines in the second form are set as difference data. If the number of lines in the first form is greater than that in the second form, the query may be stopped after all lines in the second form are queried, and the data corresponding to the cells in the remaining lines in the first form are set as difference data.
Step S4: and sequentially executing the step S1 and the step S2, and inquiring data of all rows of the N +1 th columns of the first form and the second form.
Step S5: and each time the current column number is +1, circularly executing the step S4 until all columns in the first form and the second form are queried. Similarly, if the number of columns in the first form is less than that in the second form, the query may be stopped after all columns in the first form are queried, and the data corresponding to the cells in the remaining columns in the second form are set as difference data. If the number of columns of the first form is greater than that of the second form, the query may be stopped after all columns of the second form are queried, and data corresponding to cells of the remaining columns of the first form are set as difference data.
Step 103, displaying all the queried difference data marks on the first form and/or the second form.
In the embodiment of the present invention, in the process of performing a comparison query on the first form and the second form in step 102, if difference data is queried, the difference data is marked in a preset manner, so that a user can visually see which data is the difference data. When marking, the data which are different in the two forms can be marked in the first form and the second form simultaneously or only one of the forms can be marked as required.
Preferably, when the difference data does not include data with a null value, the cell in which the difference data is located is marked and displayed, or the difference data is displayed through at least one of a font, a font size and a color which are different from the form data to which the difference data belongs;
and under the condition that the difference data comprises data with null values, marking and displaying the cells in which the difference data are positioned.
In the embodiment of the present invention, for the queried difference data, the difference data needs to be marked and displayed. In the first method, the cells where the difference data are located can be selected to be marked and displayed; for example, the whole color of the cell may be highlighted in a different color from the original form, or color marks may be made at four corners of the cell; in the second method, a font size, a color, and the like, which are different from the form data to which the difference data belongs, may be optionally set for the difference data, so as to distinguish the difference data from the same data.
It is to be noted that the second method cannot be used in the case where the difference data includes data whose value is null. Because the cell in which the data with the null value is located has no data, the cell is an empty cell. Then, the corresponding font, font size, color, etc. cannot be set for the empty cell.
Example two
Fig. 2-1 is a form difference query method implemented under a Visual Basic editor of an Excel report file according to a second embodiment of the present invention, which is a preferred implementation method of the form difference query method according to the first embodiment of the present invention, and specifically includes the following steps:
step 201, opening an Excel report file, and placing a first form and a second form which need to be queried for differences in the same Excel workbook as a first worksheet and a second worksheet respectively.
In the embodiment of the present invention, for example, the first worksheet and the second worksheet may be "data of the present week" and "data of the previous week" which need to be compared, respectively, and the "data of the present week" and the "data of the previous week" are put into the same Excel workbook, that is, as shown in schematic diagrams 2-2 and 2-3.
2-2 show a schematic diagram of a first form with "data of this week" as the form name; FIGS. 2-3 show a schematic of a second form with "data of last week" as the form name. The first row of data in both forms is the field name, and all the data in both forms is located at the intersection of the row and column.
Step 202, opening a Visual Basic editor in the Excel report file.
As previously mentioned, there may be two ways to open the Visual Basic editor. A 'tool' menu can be found in an Excel menu, a 'macro' is selected, and a 'Visual Basic editor' is selected after the Excel menu is entered; and an Alt + F11 shortcut key can be input on a keyboard, so that a visual basic editing page can be opened.
As shown in fig. 2-4, a schematic view of a page is shown after opening a visual basic editor. A menu bar is arranged at the top end of the page and comprises menu commands of development, debugging, saving and the like of an application program; a tool bar is arranged below the menu bar and comprises a plurality of commonly used shortcut buttons; the left side of the page is provided with a tool box in which various controls are placed; the blank area in the middle of the page is a window designer window used for editing and designing programs. In addition, the page also comprises an engineering resource manager window, an attribute window, a form layout window and the like.
Step 203, inputting a program code of the form difference query method on an editing page of the visual basic editor.
In an embodiment of the present invention, FIGS. 2-5 show schematic diagrams of an edit page of a visual basic editor. Specifically, program code may be entered in an edit box under the "general" word of the frame designer window by double clicking on the location option of the frame designer window (i.e., the area within the dashed box in FIGS. 2-4).
According to the method steps S1-S5 in the form difference query method in the embodiment of the invention, corresponding program codes can be designed. The following is example code written according to method steps S1-S5:
sub data comparison ()
Figure BDA0001925453800000101
Figure BDA0001925453800000111
It should be noted that the above codes are only one of the code implementation methods for the purpose of the present invention, and other implementation codes written by those skilled in the art according to the actual situation on the spirit of the present invention are also within the protection scope of the present invention.
And step 204, running the program code in the visual basic editor.
In an embodiment of the present invention, fig. 2-6 show schematic views of a running page of a visual basic editor. After the code editing is completed, click can be made on the virtual basic editor toolbar in FIGS. 2-6 within the dotted circle
Figure BDA0001925453800000121
And checking the running condition by the play key.
Step 205, checking the running result in the first form and/or the second form.
In an embodiment of the present invention, fig. 2-7 show schematic views of a running result page of a visual basic editor. In fig. 2 to 7, the cell filled in black is the cell in which the difference data is located.
In summary, in the embodiment of the present invention, a first form and a second form are called, and based on each column of data of the first form, whether there is a difference between data of each row in a corresponding column of the second form and data of a corresponding row in the first form is queried, and finally, all queried difference data are marked and displayed on the first form and/or the second form. The method can be directly realized on the terminal equipment through programming without using third-party difference analysis software, so that the risk of data leakage in the form is avoided; the method can realize the difference comparison of the whole form data at one time, is accurate and efficient, and improves the working efficiency.
In addition, the difference between the first form and the second form is inquired by running codes in a Visual Basic editor of the Excel report file, the step that other programming tools need to call the first form and the second form is omitted, the difference data of the first form and the second form can be quickly and accurately inquired, and the method is simple, quick, safe and reliable.
EXAMPLE III
Referring to fig. 3, a block diagram illustrating a structure of a form difference query apparatus 300 in a third embodiment of the present invention may specifically include:
a calling module 301, configured to call a first form and a second form;
a query module 302, configured to query whether there is a difference between data of each row in a corresponding column of the second form and data of a corresponding row in the first form based on data of each column of the first form;
a display module 303, configured to display all the queried difference data marks on the first form and/or the second form.
Preferably, the apparatus 300 further comprises:
the opening module is used for receiving the operation of opening the VB editor in the Excel report file; the Excel report file comprises a first worksheet and a second worksheet;
the calling module 301 includes: and the calling submodule is used for calling the first worksheet and the second worksheet in the VB editor.
Preferably, the query module 302 comprises:
an S1 sub-module, configured to determine whether first data in an M (M is greater than or equal to 1 and less than or equal to the number of rows of the first form) row in an N-th (N is greater than or equal to 1 and less than or equal to the number of columns of the first form) column of the first form is the same as second data in an M-th row in an N-th column corresponding to the second form;
an S2 sub-module for executing a first scheme if the second data is the same as the first data; the first scheme includes: judging whether the third data of the M +1 th line in the Nth column of the first form is the same as the fourth data of the M +1 th line in the Nth column corresponding to the second form or not;
executing a second scheme if the second data is different from the first data; the second aspect includes: marking and displaying the second data and/or the first data in a form where the second data and/or the first data are located; and after the mark is displayed, returning to the step of executing the first scheme;
the sub-module of S3 is used for circularly executing the step S2 for the current row number +1 each time until all rows in the Nth column of the first form and the second form are inquired;
the S4 sub-module is configured to execute step S1 and step S2 in sequence, and query data of all rows in the N +1 th column of the first form and the second form;
and the sub-module of S5 is used for circularly executing the step S4 for the current column number +1 each time until all columns in the first form and the second form are queried.
Preferably, the display module 303 includes:
the first display sub-module is used for marking and displaying the cell where the difference data is located under the condition that the difference data does not include data with null value, or displaying the difference data through one of a font, a font size and a color which are distinguished from the form data to which the difference data belongs;
and the second display submodule is used for marking and displaying the cell where the difference data is located under the condition that the difference data comprises data with null values.
The form difference query device 300 provided in the embodiment of the present invention can implement each process implemented by the form difference query method in the method embodiment of fig. 1, and is not described here again to avoid repetition.
In the embodiment of the present invention, a first form and a second form are called, and based on each column of data of the first form, whether there is a difference between data of each row in a corresponding column of the second form and data of a corresponding row in the first form is queried, and finally, all queried difference data are marked and displayed on the first form and/or the second form. The method can be directly realized on the terminal equipment through programming without using third-party difference analysis software, so that the risk of data leakage in the form is avoided; the method can realize the difference comparison of the whole form data at one time, is accurate and efficient, and improves the working efficiency.
Preferably, an embodiment of the present invention further provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, where the computer program, when executed by the processor, implements each process of the above-mentioned form difference query method embodiment, and can achieve the same technical effect, and details are not repeated here to avoid repetition.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the above-mentioned form difference query method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may 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 instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (6)

1. A form difference query method, the method comprising:
calling a first form and a second form;
inquiring whether the data of each row in the corresponding column of the second form is different from the data of the corresponding row in the first form or not based on the data of each column of the first form;
displaying all the queried difference data marks on the first form and/or the second form;
before the first form and the second form are called, the method comprises the following steps:
receiving an operation of opening a Visual Basic editor in an Excel report file; the Excel report file comprises a first worksheet and a second worksheet;
the invoking the first form and the second form includes:
calling the first worksheet and the second worksheet in the Visual Basic editor;
the querying whether there is a difference between the data of each row in the corresponding column of the second form and the data of the corresponding row in the first form based on each column of the first form includes:
if the number of the rows of the first form is less than that of the second form, stopping querying after all rows of the first form are queried, and setting data corresponding to cells of the rest rows of the second form as difference data; if the number of the columns of the first form is more than that of the second form, stopping querying after all the columns of the second form are queried, and setting data corresponding to cells of the rest columns of the first form as the difference data.
2. The method of claim 1, wherein the step of querying whether the data of each row in the corresponding column of the second form is the same as the data of the corresponding row in the first form based on the data of each column of the first form comprises:
s1: judging whether first data of an M (M is more than or equal to 1 and less than or equal to the row number of the first form) row in an N (N is more than or equal to 1 and less than or equal to the row number of the first form) column of the first form is the same as second data of an M row in an N column corresponding to the second form;
s2: executing a first scheme if the second data is the same as the first data; the first scheme includes: judging whether the third data of the M +1 th line in the Nth column of the first form is the same as the fourth data of the M +1 th line in the Nth column corresponding to the second form or not;
executing a second scheme if the second data is different from the first data; the second aspect includes: marking and displaying the second data and/or the first data in a form where the second data and/or the first data are located; and after the mark is displayed, returning to the step of executing the first scheme;
s3: step S2 is executed in a loop each time the current row number is +1 until all rows in the nth column of the first form and the second form are queried;
s4: sequentially executing the step S1 and the step S2, and inquiring data of all rows in the N +1 th column of the first form and the second form;
s5: and each time the current column number is +1, circularly executing the step S4 until all columns in the first form and the second form are queried.
3. The method of claim 1, wherein the displaying all the queried difference data marks on the first form and/or the second form comprises:
under the condition that the difference data does not comprise data with a null value, marking and displaying a cell where the difference data is located, or displaying the difference data through one of a font, a font size and a color which are different from form data to which the difference data belongs;
and under the condition that the difference data comprises data with null values, marking and displaying the cells in which the difference data are positioned.
4. An apparatus for querying a form difference, the apparatus comprising:
the calling module is used for calling the first form and the second form;
the query module is used for querying whether the data of each row in the corresponding column of the second form is different from the data of the corresponding row in the first form or not based on the data of each column of the first form;
the display module is used for marking and displaying all the inquired difference data on the first form and/or the second form;
the device further comprises:
the opening module is used for receiving the operation of opening the Visual Basic editor in the Excel report file; the Excel report file comprises a first worksheet and a second worksheet;
the calling module comprises: a calling submodule, configured to call the first worksheet and the second worksheet in the Visual Basic editor;
the querying whether there is a difference between the data of each row in the corresponding column of the second form and the data of the corresponding row in the first form based on each column of the first form includes:
if the number of the rows of the first form is less than that of the second form, stopping querying after all rows of the first form are queried, and setting data corresponding to cells of the rest rows of the second form as difference data; if the number of the columns of the first form is more than that of the second form, stopping querying after all the columns of the second form are queried, and setting data corresponding to cells of the rest columns of the first form as the difference data.
5. The apparatus of claim 4, wherein the query module comprises:
an S1 sub-module, configured to determine whether first data in an M (M is greater than or equal to 1 and less than or equal to the number of rows of the first form) row in an N-th (N is greater than or equal to 1 and less than or equal to the number of columns of the first form) column of the first form is the same as second data in an M-th row in an N-th column corresponding to the second form;
an S2 sub-module for executing a first scheme if the second data is the same as the first data; the first scheme includes: judging whether the third data of the M +1 th line in the Nth column of the first form is the same as the fourth data of the M +1 th line in the Nth column corresponding to the second form or not;
executing a second scheme if the second data is different from the first data; the second aspect includes: marking and displaying the second data and/or the first data in a form where the second data and/or the first data are located; and after the mark is displayed, returning to the step of executing the first scheme;
the sub-module of S3 is used for circularly executing the step S2 for the current row number +1 each time until all rows in the Nth column of the first form and the second form are inquired;
the S4 sub-module is configured to execute step S1 and step S2 in sequence, and query data of all rows in the N +1 th column of the first form and the second form;
and the sub-module of S5 is used for circularly executing the step S4 for the current column number +1 each time until all columns in the first form and the second form are queried.
6. The apparatus of claim 4, wherein the display module comprises:
the first display sub-module is used for marking and displaying the cell where the difference data is located under the condition that the difference data does not include data with a null value, or displaying the difference data through one of a font, a font size and a color which are different from the form data to which the difference data belongs;
and the second display submodule is used for marking and displaying the cell where the difference data is located under the condition that the difference data comprises data with null values.
CN201811614062.6A 2018-12-27 2018-12-27 Form difference query method and device Active CN109828985B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811614062.6A CN109828985B (en) 2018-12-27 2018-12-27 Form difference query method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811614062.6A CN109828985B (en) 2018-12-27 2018-12-27 Form difference query method and device

Publications (2)

Publication Number Publication Date
CN109828985A CN109828985A (en) 2019-05-31
CN109828985B true CN109828985B (en) 2021-06-25

Family

ID=66860561

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811614062.6A Active CN109828985B (en) 2018-12-27 2018-12-27 Form difference query method and device

Country Status (1)

Country Link
CN (1) CN109828985B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112329388A (en) * 2020-11-30 2021-02-05 深圳集智数字科技有限公司 Data display method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1801197A (en) * 2005-01-07 2006-07-12 环隆电气股份有限公司 Difference data integration and comparison method
CN101807207A (en) * 2010-03-22 2010-08-18 北京大用科技有限责任公司 Method for sharing document based on content difference comparison
CN102200968A (en) * 2011-05-30 2011-09-28 深圳市五巨科技有限公司 Method and device for removing duplications of EXCEL form data
CN105740465A (en) * 2016-03-04 2016-07-06 浪潮软件集团有限公司 Flexible custom comparison method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1801197A (en) * 2005-01-07 2006-07-12 环隆电气股份有限公司 Difference data integration and comparison method
CN101807207A (en) * 2010-03-22 2010-08-18 北京大用科技有限责任公司 Method for sharing document based on content difference comparison
CN102200968A (en) * 2011-05-30 2011-09-28 深圳市五巨科技有限公司 Method and device for removing duplications of EXCEL form data
CN105740465A (en) * 2016-03-04 2016-07-06 浪潮软件集团有限公司 Flexible custom comparison method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"https://zhidao.baidu.com/question2015351486776373588.html";ynzsvt;《百度经验》;20170825;第1-2页 *
"也谈比较两个表格的异同";陈秀峰;《电脑爱好者》;20040229;第50页 *

Also Published As

Publication number Publication date
CN109828985A (en) 2019-05-31

Similar Documents

Publication Publication Date Title
US7512897B2 (en) Integrated method for creating a refreshable web query
US9075787B2 (en) Defining a reusable spreadsheet-function by extracting the function from a complex calculation in a spreadsheet document
US7117430B2 (en) Spreadsheet error checker
US5255363A (en) Graph-based programming system and associated method
US8151181B2 (en) Method and apparatus for form automatic layout
JPH0525345B2 (en)
US20040237030A1 (en) System and method of implementing calculation fields in an electronic form
EP0615200A2 (en) System and methods for management of electronic modelling systems
US20130290837A1 (en) Method and Apparatus for Correcting Document Formatting Based on Source Document
US20050010862A1 (en) Method and system for manipulating labelled data for data entry in management applications
US7146561B2 (en) Method and system in an electronic spreadsheet for comparing series of cells
CN109828985B (en) Form difference query method and device
CN115114146A (en) Interface test method, device, equipment and storage medium
CN109992759B (en) Table object editing method and device, electronic equipment and storage medium
WO2020264014A1 (en) Systems and methods to facilitate rapid data entry for document review
CN107015738A (en) A kind of text selection method and equipment
CN115562665A (en) Page access method and device, computer equipment and readable storage medium
CN114090611A (en) Method and device for generating cable inventory by terminal wiring table and electronic equipment
US20170139552A1 (en) Tools on-demand
US8321799B1 (en) Tabular data sorting and display
CN115982121A (en) Method and device for generating nuclear power DCS safety control display device database
US9773087B2 (en) Method and system for creating a device layout
CN115688679A (en) Processing method and device for webpage embedded document based on RPA
Hoppe et al. Excel Manual: For Introduction to the Practice of Statistics 4e
CN113553798A (en) Seal inserting method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant