File comparison method, electronic equipment and storage medium
By using the data comparison method obtained by the camera device in the smart seal, the problem that files may be replaced after the smart seal is unlocked is solved, effective monitoring and prevention of files is achieved, and the security of the sealing process is improved.
Patent Information
- Application Number
- CN202310399888.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-14
- Publication Date
- 2024-10-18
AI Technical Summary
The file may be replaced after the smart seal is unlocked, resulting in security risks during the sealing process. Existing technology cannot effectively prevent file replacement.
The first data is obtained through the camera device as the original group data, and the data obtained each time is compared as the comparison group data to determine whether the difference is within the preset range to prevent file movement and replacement.
It effectively prevents files from moving after the smart seal is unlocked, avoids risks caused by changing files, and improves the security of the sealing process.
Smart Images

Figure CN118803153A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of smart seals, and in particular relates to a file comparison method, an electronic device and a storage medium. Background Art
[0002] The main steps of the existing similar technology are: the central processor controls the camera to photograph the document to be stamped to form photo A; the smart seal moves down and stamps on the document to be stamped; the central processor controls the camera to photograph the document to be stamped to form photo B; the central processor compares photo A and photo B. If there is a difference between photo A and photo B, the central processor determines that the stamping does not meet the requirements and proceeds to the next step; the central processor sends an alarm message to the remote control terminal through a signal transmitter; the remote control terminal receives the alarm message through a signal receiver and displays the alarm message through an alarm display; the user of the remote control terminal obtains information about the replacement of the document stamped by the smart seal through the alarm display.
[0003] For the existing technology, the smart seal adopts a dual-camera solution. The camera takes a photo once before stamping and takes a second photo after stamping. When the photos taken by the two cameras are the same picture, it can be concluded that the document to be stamped has not been replaced during the stamping process, and it is a normal stamping procedure.
[0004] The inventor discovered that the smart seal product uses the camera on the device to take a photo of the stamped document for identification and compare it with the document of the original application. When the similarity reaches a certain threshold, it is assessed to be the same document, and a command is issued to unlock the smart seal to allow stamping. However, the document identification and comparison takes a certain amount of time, during which the stamped document may be replaced. After the smart seal is unlocked, the document can be replaced for stamping, which creates a security risk in the use of the seal. Summary of the invention
[0005] The embodiments of the present invention aim to solve at least one of the above technical problems.
[0006] In a first aspect, an embodiment of the present invention provides a file comparison method for a smart seal, comprising: acquiring a first graphic scanned by a camera device and cutting a text file in the first graphic to obtain first file block data; calculating position information in the first file block data to obtain original group data; acquiring a second graphic scanned by the camera device and cutting a text file in the second graphic to obtain second file block data; calculating position information in the second file block data to obtain comparison group data; and determining whether the difference between the original group data and the comparison group data is within a preset range.
[0007] In a second aspect, an embodiment of the present invention provides an electronic device, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any one of the above-mentioned file comparison methods of the present invention.
[0008] In a third aspect, an embodiment of the present invention provides a storage medium, in which one or more programs including execution instructions are stored, and the execution instructions can be read and executed by an electronic device (including but not limited to a computer, a server, or a network device, etc.) to execute any of the above-mentioned file comparison methods of the present invention.
[0009] In a fourth aspect, an embodiment of the present invention further provides a computer program product, wherein the computer program product comprises a computer program stored on a storage medium, wherein the computer program comprises program instructions, and when the program instructions are executed by a computer, the computer executes any one of the above-mentioned file comparison methods.
[0010] The embodiment of the present invention uses the first data acquired by the camera device as the original group data and each subsequent data acquired as the comparison group data, and compares the comparison group data with the original group data, which can effectively prevent the file from being moved after the smart seal is unlocked and avoid the risk of replacing the file. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0012] Figure 1 A flowchart of an embodiment of a file comparison method of the present invention;
[0013] Figure 2 A flowchart of another embodiment of the file comparison method of the present invention;
[0014] Figure 3 A flowchart of another embodiment of the file comparison method of the present invention;
[0015] Figure 4 A process flow chart of a file comparison method provided by one embodiment of the present invention;
[0016] Figure 5 It is a schematic structural diagram of an embodiment of an electronic device of the present invention. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0018] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application may be combined with each other.
[0019] The present invention may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0020] In the present invention, "module", "device", "system" and the like refer to related entities applied to computers, such as hardware, a combination of hardware and software, software or software in execution, etc. In detail, for example, an element can be, but is not limited to, a process, a processor, an object, an executable element, an execution thread, a program and / or a computer running on a processor. In addition, an application or script program running on a server, a server can all be an element. One or more elements can be in an execution process and / or thread, and an element can be localized on a computer and / or distributed between two or more computers, and can be operated by various computer-readable media. An element can also communicate through local and / or remote processes according to a signal with one or more data packets, for example, a signal from a data that interacts with another element in a local system, a distributed system, and / or a network on the Internet through a signal to interact with other systems.
[0021] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include" and "comprise" include not only those elements, but also other elements that are not explicitly listed, or also include elements inherent to such processes, methods, articles or equipment. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or equipment that includes the elements.
[0022] The embodiment of the present invention provides a file comparison method, which can be applied to an electronic device. The electronic device can be a computer, a server, or other electronic products, etc., which is not limited in the present invention.
[0023] Please refer to Figure 1 , which shows a file comparison method provided by an embodiment of the present invention, which is used for smart seals.
[0024] like Figure 1 As shown, in step 101, a first graphic scanned by a camera device is obtained and a text file in the first graphic is cut to obtain first file block data;
[0025] In step 102, the position information in the first file block data is calculated to obtain the original group data;
[0026] In step 103, the second graphic scanned by the camera device is acquired and the text file in the second graphic is cut to obtain second file block data;
[0027] In step 104, the position information in the second file block data is calculated to obtain comparison group data;
[0028] In step 105, it is determined whether the difference between the original group data and the comparison group data is within a preset range.
[0029] In this embodiment, for step 101, a camera device is used to scan the current document that needs to be stamped, and a frame of data during the scanning process of the current stamped document by the camera device is intercepted, and the intercepted frame of data is graphically processed to obtain a first graphic; based on the first graphic obtained after the graphical processing, it is determined whether the first graphic contains text information. If the first graphic does not contain text information, the first graphic is deleted and a frame of data is re-intercepted based on the scanning process of the current stamped document by the camera device for graphical processing to obtain the first graphic again until it is determined that the first graphic contains text information; after obtaining the first graphic containing text information, the first graphic is cropped and the cropped image is saved, the image containing text information is the file block, and all image blocks are the first graphic block data, wherein the cropping method can be based on preset rules or by a random algorithm.
[0030] Afterwards, for step 102, the file block data after cutting is recorded, and each file block is marked with a serial number, wherein the marking method is to mark the serial number by the size and position information of the file block; obtain the valid file blocks among all the file blocks after cutting, and determine whether the file block is a valid file block by using the ratio of pure color pixels in the file block. If it is an invalid file block, the first graphic is abandoned, and a frame of data is re-intercepted and processed graphically based on the process of scanning the current stamped file by the camera device, and the first graphic is re-obtained, and the first graphic is cut again until it is determined that the number of all file blocks is greater than the preset threshold. When it is confirmed that all the file blocks in the file block data are qualified, the different pure color pixels in all the file blocks are calculated according to the serial number, and the original group data is obtained according to the different pure color pixels in all the file blocks, wherein the original group data is the stamped file data obtained before the stamped file is stamped, and generally the frame data obtained by the camera device for the first time or the first few times when the stamped file is ready to be stamped is obtained through a series of processing. The original group data is used as reference data and compared with the data obtained later.
[0031] Afterwards, for step 103; based on the camera device, scan the current document that needs to be stamped, intercept a frame of data during the scanning process of the current stamped document by the camera device, and perform graphical processing on the intercepted frame of data to obtain a second graphic; based on the second graphic obtained after the graphical processing, determine whether the second graphic contains text information. If the second graphic does not contain text information, delete the two graphics and based on the process of the camera device scanning the current stamped document, intercept a frame of data again for graphical processing to obtain the second graphic again, until it is determined that the second graphic contains text information; crop the second graphic, save the cropped image, and obtain second graphic block data, wherein the method of cropping the second graphic is the same as the method of cropping the first graphic, and the shape, size, and position information of the cropping are consistent.
[0032] Then, for step 104, each file block in the second file block data is marked with a serial number, and the serial number marking method is the same as the marking method of each file block in the first file block data. File blocks at the same position use the same serial number, wherein each file block serial number in the second file block data corresponds to each file block serial number in the first file block data; different pure color pixels in all file blocks are calculated according to the serial numbers, and when the value of the different pure color pixel points of each file block in the second file block data is different from the value of the different pure color pixel points of each file block in the first file block data, the second file block data is determined to be comparison group data, and the comparison group data is determined based on the values of the different pure color pixels in all file blocks.
[0033] Finally, for step 105, the values of the pure color pixels in the first file block data and the second file block data are compared with the original group data and the comparison group data according to the same sequence number. If the value of the pure color pixel of a file block in the second file block data is different from or different from the value of the pure color pixel of the corresponding file block in the first file block data, then a file block in the second file block data is marked as an abnormal block and included in the abnormal data group, and an abnormal reminder is issued; if the value of the pure color pixel of a file block in the second file block data is the same as the value of the pure color pixel of the corresponding file block in the first file block data, it is normal and the stamped document continues to be monitored.
[0034] The method of the embodiment of the present application uses the first data acquired by the camera device as the original group data, and each subsequent data acquired as the comparison group data, and compares the comparison group data with the original group data, which can effectively prevent the file from moving after the smart seal is unlocked and avoid the risk of replacing the file.
[0035] In some optional embodiments, at least one frame of data is captured during the scanning process of the camera device, and the at least one frame of data is processed to obtain a first graphic corresponding to the at least one frame of data, and a text file in the first graphic is obtained. If the first graphic does not contain a text file, the first graphic converted from at least one frame of data during the scanning process of the camera device continues to be captured until the first graphic contains the text file. For example, a frame of data is captured during the scanning process of the camera device, the frame data is processed into a graph, and the graphic is binarized, wherein the binarization of the graphic includes setting a grayscale value of the graphic, when the grayscale value of the graphic is lower than a threshold value, it is black, otherwise it is white; then, it is determined whether the graphic corresponding to the frame data contains a text file, and if it does not contain a text file, a frame of data during the scanning process of the camera device continues to be captured for processing until the processed graphic contains a text file.
[0036] Please refer to Figure 2, which shows another file comparison method provided by an embodiment of the present invention, for smart seal. Figure 1 A flowchart of the steps further defined in step 101 of "cutting the text file in the first graphic".
[0037] like Figure 2 As shown, in step 201, the first graphic is cut based on the text file in the first graphic to obtain graphic data;
[0038] In step 202, it is confirmed whether the image in the graphic data is deformed. If the image is deformed, the image is corrected using a matrix model.
[0039] In this embodiment, for step 201, the outline of the text file in the graphic is calculated, the graphic is cropped, and the cropped graphic data is saved; then, for step 202, it is determined whether the cropped graphic data is deformed. If deformation occurs, it is corrected using a matrix model to restore the normal text file state.
[0040] The method of the embodiment of the present application determines whether the cropped graphic data is deformed, and processes the deformed graphic data, so that the original group data used for comparison is more accurate.
[0041] In some optional embodiments, after the text file in the first graphic is cropped, the number of cropped blocks of the text file in the first graphic, the area information of the number of cropped blocks, and the size information of the number of cropped blocks are obtained, and the number of cropped blocks of the text file, the area information of the number of cropped blocks, and the size information of the number of cropped blocks are marked with serial numbers. The file blocks, sizes, and positions that have been set for cutting are cut according to the preset settings and marked with serial numbers. After the number of cropped blocks of the text file is marked with serial numbers, it is determined whether the number of cropped blocks of the text file in the first graphic is a valid file block. If the number of cropped blocks of the text file contains invalid file blocks, they are directly deleted, valid file blocks are retained, and invalid file blocks are deleted; if the number of invalid file blocks is greater than the preset number, the first graphic is determined to be invalid, and the first graphic is re-obtained until the number of valid file blocks in the first graphic reaches the preset number. For example, obtain the cropped file block, identify whether it is a valid file block, only save the valid file block, and directly delete the invalid file block. If the proportion of pure color pixels exceeds the set threshold (temporarily set to 90%), it is considered invalid. If the number of invalid file blocks exceeds the threshold, the first graphic of this time is abandoned and the first graphic that meets the standard is obtained again.
[0042] In some optional embodiments, the different pure color pixels of all file blocks after the serial number marking are calculated, and the values of the different pure color pixels of all file blocks are recorded. It is determined whether the original group data has such value according to the values of the different pure color pixels of all file blocks. If the original group data does not have such value, the scanning and calculation are continued until the first group data with value is obtained, and the first group data is used as the original group data. The different pure color pixels in all file blocks are calculated according to the serial number, and the values of the different pure color pixels in the corresponding file blocks are recorded to determine whether the original group data has a value. If the original group data is empty, the current group data is set as the original group data, otherwise, the current group data is set as the comparison group data; if the original group data has a value, the current data is the comparison group data, and the serial number is cut and marked according to the number of file blocks, and the different pure color pixels in all file blocks are calculated according to the serial number and the values of the different pure color pixels in the corresponding file blocks are recorded. For example, the cropped image is binarized to obtain the width and height of the cropped image, pixels of different colors are initialized to 0, and the threshold is set to 40 to determine whether the grayscale value of the pixel is greater than the set threshold, thereby determining the color of the pixel, classifying the determined pixel by color, and finally obtaining the values of different pure color pixels.
[0043] Please refer to Figure 3 , which shows another file comparison method provided by an embodiment of the present invention, for smart seal. Figure 1 A flowchart of the steps further defined in step 105 of "determining whether the difference between the original group data and the comparison group data is within a preset range".
[0044] like Figure 3 As shown, in step 301, it is confirmed whether the number of file blocks in the original group data is consistent with the number of file blocks in the comparison group data;
[0045] In step 302, if the number of file blocks in the original group data is inconsistent with the number of file blocks in the comparison group data, an abnormality reminder is issued.
[0046] In this embodiment, for step 301, the number of all file blocks in the original group data is compared with the number of all file blocks in the comparison group data to confirm whether the number of all file blocks in the original group data is consistent with the number of all file blocks in the comparison group data.
[0047] For step 302, if the number of all file blocks in the original group data is inconsistent with the number of all file blocks in the comparison group data, it is determined that the current stamped file has been moved or replaced, and monitoring is exited and an abnormal reminder is issued to the background or management personnel.
[0048] The method of the embodiment of the present application can prevent the operation of stealing and replacing the stamped document during the stamping process by comparing the comparison group data with the original group data.
[0049] In some optional embodiments, if the number of file blocks in the original group data is consistent with the number of file blocks in the comparison group data, then the difference between the values of the pure color pixel points of the file blocks with the same sequence number in the original group data and the comparison group data is compared to see whether it exceeds the preset difference threshold, wherein the file blocks with the same sequence number are a file block pair; at the same time, it is determined whether the number of file block pairs exceeding the preset difference threshold exceeds the preset number threshold, and if the number of file block pairs exceeding the preset difference threshold exceeds the preset number threshold, an abnormal reminder is issued, for example, if the number of file blocks in the original group data is the same as the number of file blocks in the comparison group data, the value of the pure color pixel points in the file blocks is compared with the sequence number to compare the original group data with the comparison group data, and if the value of a certain pure color pixel point exceeds the value of the comparison data, it is marked as an abnormal block and included in the abnormal data group, and an abnormal reminder is issued to the background or management personnel. Until the comparison of the original group data and the comparison group data is completed, wherein the number in the abnormal data group is compared with the total amount of the original group data to determine whether it exceeds the set threshold, if it exceeds the set threshold, it is considered abnormal and monitoring is stopped, otherwise it is considered normal. The comparison process is repeated continuously until an abnormality occurs or the document is stamped.
[0050] It should be noted that the implementation methods of steps 103 and 104 of the technical solution in this application are the same as those of steps 101 and 102, and will not be repeated here.
[0051] It should be noted that the technical solution of the present application is to obtain a frame of data from a streaming media service, convert it into a graphic, detect whether the graphic contains a text file, and cut and correct the text file to convert it into recognizable data. Take N file blocks through a random algorithm, calculate the area and size information of the N blocks distributed in the text file, cut the file blocks, and mark and sort them. Identify the different pure color pixels in the file blocks and save them in the corresponding file blocks, then continuously obtain new frame data, perform the above operations, copy the number, position, and size information of the file blocks calculated in the above operations, re-calculate the cutting and marking, and continuously compare with the original group data obtained for the first time to determine whether there are any differences; use the time difference method to extract the motion area in the graphic by using pixel-based time difference and thresholding in two or three adjacent frames in a continuous graphic sequence.
[0052] The present application also provides an alternative solution, based on feature code positioning monitoring, by starting the streaming media service, obtaining frame data, and judging whether there is a text file in the identification area through an algorithm. If no text file is obtained, continue to obtain frame data until a text file is obtained. The outline of the text file is calculated through the obtained text file, the text file is cut, the feature value to be scanned is obtained, the feature value coordinates are obtained, and the current feature value coordinates are recorded. Repeat the above steps to calculate whether the coordinate value of the feature code obtained each time is consistent with the coordinate value of the current feature code. If there is a deviation, it is considered that the file has moved.
[0053] It should be noted that the file comparison method of the present application can be applied during the file identification and comparison. Once the file is found to be moved, the smart seal will no longer be unlocked based on the comparison result. The file movement has the risk of replacing the file. In order to avoid the risk, the seal will no longer be unlocked. It is smarter and safer to use the seal. It can prevent someone from using the smart seal to replace the stamped file before or after unlocking.
[0054] Please refer to Figure 4 , which shows an implementation flow chart of the file comparison method of the present invention.
[0055] like Figure 4 As shown, step 1: start the camera and start the streaming service;
[0056] Step 2: Determine whether the camera is started normally and the streaming media service is normal. If abnormal, restart the camera and streaming media service;
[0057] Step 3: intercept a frame of data, process the frame data into graphics, perform binary processing on the graphics, set the grayscale value below the threshold to black, and vice versa to white;
[0058] Step 4: Determine whether the frame data contains a text file, if so, proceed to the next step, otherwise repeat step 3;
[0059] Step 5: Calculate the outline of the text file in the frame data, perform graphic cutting, and save the cut graphic data;
[0060] Step 6: Determine whether the cropped graphic data is deformed. If so, correct it using a matrix model to restore the normal text file state.
[0061] Step 7: Use a random algorithm to calculate the number, location, size and other information of the cut file blocks required for this mobile monitoring, and save the results of this calculation for use in the next comparison.
[0062] Step 8: Using the results calculated in step 7, cut the set file blocks, sizes, and positions, cut according to these settings and mark the serial numbers;
[0063] Step 9: Get the cropped file block, identify whether it is a valid file block, only save the valid file block, and directly delete the invalid file block. If the proportion of pure color pixels exceeds the set threshold (temporarily 90%), it is considered invalid. If the invalid file block exceeds the threshold, the frame data of this time is abandoned and start again from step 3;
[0064] Step 10: Calculate the different pure color pixels in all file blocks according to the sequence number, and record the values of the different pure color pixels in the corresponding file blocks;
[0065] Step 11: Determine whether the original group data has a value. If the original group data is empty, set the current group data as the original group data. Otherwise, set the current group data as the comparison group data, and re-execute step 3 and subsequent steps.
[0066] Step 12: If the original group data has a value, the current data is the comparison group data, and it is necessary to obtain the calculation result of step 7, use step 8 to cut and mark the data, and proceed to steps 9 and 10;
[0067] Step 13: The first stage is to compare the original data and the total amount of file blocks in the comparison data to see if they are consistent. If the deviation is too large, it is considered that the original group data and the comparison group data do not match, and monitoring is stopped;
[0068] Step 14: compare the original group data with the comparison group data according to the values of the pure color pixels in the file block according to the sequence number. If the value of a pure color pixel exceeds the value of the comparison data, it is marked as an abnormal block and included in the abnormal data group, otherwise it is a normal block;
[0069] Step 15: Repeat step 14 until the original group data and the comparison group data are all compared, wherein the number in the abnormal data group is compared with the total amount of the original group data to determine whether it exceeds the set threshold. If it exceeds the set threshold, it is considered abnormal and monitoring is stopped. Otherwise, it is considered normal.
[0070] Step 16: Repeat the monitoring from step 3 continuously until the monitoring is exited or the monitoring is abnormal, and the mobile monitoring is stopped.
[0071] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of combined actions, but those skilled in the art should be aware that the present invention is not limited by the described order of actions, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention. In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0072] In some embodiments, an embodiment of the present invention provides a non-volatile computer-readable storage medium, which stores one or more programs including execution instructions, and the execution instructions can be read and executed by an electronic device (including but not limited to a computer, a server, or a network device, etc.) to execute any of the above-mentioned file comparison methods of the present invention.
[0073] In some embodiments, an embodiment of the present invention further provides a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes any one of the above-mentioned file comparison methods.
[0074] In some embodiments, an embodiment of the present invention also provides an electronic device, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a file comparison method.
[0075] Figure 5 is a schematic diagram of the hardware structure of an electronic device for executing a file comparison method provided by another embodiment of the present application, such as Figure 5 As shown, the device includes:
[0076] One or more processors 510 and memory 520, Figure 5 A processor 510 is taken as an example.
[0077] The device for executing the file comparison method may further include: an input device 530 and an output device 540 .
[0078] The processor 510, the memory 520, the input device 530 and the output device 540 may be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.
[0079] The memory 520 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the file comparison method in the embodiment of the present application. The processor 510 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 520, that is, the file comparison method in the above method embodiment is implemented.
[0080] The memory 520 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created according to the use of the file comparison device, etc. In addition, the memory 520 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 520 may optionally include a memory remotely arranged relative to the processor 510, and these remote memories may be connected to the file comparison device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0081] The input device 530 can receive input digital or character information and generate signals related to user settings and function control of the file comparison device. The output device 540 can include display devices such as display screens.
[0082] The one or more modules are stored in the memory 520, and when executed by the one or more processors 510, the file comparison method in any of the above method embodiments is executed.
[0083] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of the present application.
[0084] The electronic devices of the embodiments of the present application exist in various forms, including but not limited to:
[0085] (1) Mobile communication equipment: This type of equipment is characterized by having mobile communication functions and its main purpose is to provide voice and data communications. This type of terminal includes: smart phones, multimedia phones, functional phones, and low-end phones.
[0086] (2) Ultra-mobile personal computer devices: These devices belong to the category of personal computers, have computing and processing functions, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, etc.
[0087] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players, handheld game consoles, e-books, smart toys, and portable car navigation devices.
[0088] (4) Other onboard electronic devices with data interaction functions, such as on-board devices installed in vehicles.
[0089] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0090] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0091] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A document comparison method for smart seal, comprising: Acquire a first graphic scanned by a camera device and cut a text file in the first graphic to obtain first file block data; Calculating the position information in the first file block data to obtain the original group data; Acquire a second graphic scanned by the camera device and cut a text file in the second graphic to obtain second file block data; Calculating the position information in the second file block data to obtain comparison group data; It is determined whether the difference between the original group data and the comparison group data is within a preset range.
2. The method according to claim 1, wherein: The obtaining of the first graphic scanned by the camera device comprises: intercepting at least one frame of data during the scanning process of the camera device, processing the at least one frame of data, and obtaining a first graphic corresponding to the at least one frame of data; The text file in the first graphic is obtained. If the first graphic does not contain the text file, the first graphic converted from at least one frame of data captured during the scanning process of the camera device is continuously obtained until the first graphic contains the text file.
3. The method according to claim 1, wherein: The cutting of the text file in the first graphic comprises: Cutting the first graphic based on the text file in the first graphic to obtain graphic data; It is confirmed whether the image in the graphic data is deformed. If the image is deformed, the image is corrected using a matrix model.
4. The method according to claim 1, wherein: After the text file in the first graphic is cut, the method further comprises: Acquire the number of cut blocks of the text file in the first graphic, area information of the cut blocks, and size information of the cut blocks; The number of cut blocks of the text file, the area information of the number of cut blocks, and the size information of the number of cut blocks are marked with serial numbers.
5. The method according to claim 4, wherein: After obtaining the number of cut blocks of the text file in the first graphic, the method further comprises: Determining whether the number of cut blocks of the text file in the first graph is a valid file block; If the number of cut blocks contains invalid file blocks, the invalid file blocks are deleted; If the number of the invalid file blocks is greater than a preset number, the first graphic is determined to be invalid, and the first graphic is reacquired.
6. The method according to claim 4, wherein: After the number of cut blocks of the text file, the area information of the cut blocks, and the size information of the cut blocks are marked with serial numbers, the method further includes: Calculate the pixel points of different pure colors of all file blocks after the serial number marking, and record the values of the pixel points of different pure colors of all file blocks; Determine whether the original group data has a value. If the original group data has no value, continue scanning and calculating until a first group data with a value is obtained, and use the first group data as the original group data.
7. The method according to claim 1, wherein: The determining whether the difference between the original group data and the comparison group data is within a preset range includes: confirming whether the number of file blocks in the original group data is consistent with the number of file blocks in the comparison group data; If the number of file blocks in the original group data is inconsistent with the number of file blocks in the comparison group data, an abnormal reminder is issued.
8. The method according to claim 7, wherein: After confirming whether the number of file blocks in the original group data is consistent with the number of file blocks in the comparison group data, the method further includes: If the number of file blocks in the original group data is consistent with the number of file blocks in the comparison group data, comparing whether the difference between the values of pure color pixels of the file blocks with the same sequence number in the original group data and the comparison group data exceeds a preset difference threshold, wherein the file blocks with the same sequence number are a file block pair; Determine whether the number of file block pairs exceeding a preset difference threshold exceeds a preset number threshold; If the number of file block pairs exceeding the preset difference threshold exceeds the preset number threshold, an abnormal reminder is issued.
9. An electronic device, comprising: At least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the method described in any one of claims 1 to 8.
10. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
