CN109446055B - Printing program testing method, device, computer equipment and storage medium - Google Patents

Printing program testing method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN109446055B
CN109446055B CN201811026058.8A CN201811026058A CN109446055B CN 109446055 B CN109446055 B CN 109446055B CN 201811026058 A CN201811026058 A CN 201811026058A CN 109446055 B CN109446055 B CN 109446055B
Authority
CN
China
Prior art keywords
data
operation result
data table
printing
program
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
CN201811026058.8A
Other languages
Chinese (zh)
Other versions
CN109446055A (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.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China 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 Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN201811026058.8A priority Critical patent/CN109446055B/en
Publication of CN109446055A publication Critical patent/CN109446055A/en
Application granted granted Critical
Publication of CN109446055B publication Critical patent/CN109446055B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to research and development management technology, and provides a printing program testing method, a printing program testing device, computer equipment and a storage medium. The method comprises the following steps: acquiring policy information corresponding to a first preset number of policies; calling a history printing program interface to respectively read the corresponding policy information of each policy to obtain first printing data, and writing the first printing data into a first data table; calling a current printing program interface to respectively read the corresponding policy information of each policy to obtain second printing data, and writing the second printing data into a second data table; comparing the first data table with the second data table; when the difference exists between the first data table and the second data table according to the comparison result, the difference data in the first data table is written into the first document, the difference data in the second data table is written into the second document, and the first document and the second document are used for judging whether the updated printing program is abnormal or not. By adopting the method, the test efficiency of the policy printing program can be improved.

Description

Printing program testing method, device, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of printing technologies, and in particular, to a method and apparatus for testing a printing program, a computer device, and a storage medium.
Background
To print the policy better, it is often necessary to update the print program of the policy to repair and optimize certain errors and vulnerabilities. When updating the policy printing program, the program is often subjected to unpredictable errors caused by unfamiliar business or incapacitation of codes in code development, so that the updated printing program is easy to generate errors when printing the policy in the historical data, and the printing program needs to be tested in order to reduce the error rate. However, in the conventional art, manual testing is generally performed by a tester with naked eyes, resulting in low test efficiency for the policy printing program.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a printing program testing method, apparatus, computer device, and storage medium capable of improving the testing efficiency of a policy printing program.
A print program testing method, the method comprising:
acquiring policy information corresponding to a first preset number of policies;
Calling a history printing program interface to respectively read the corresponding policy information of each policy to obtain first printing data, and writing the first printing data into a first data table;
calling a current printing program interface to respectively read the corresponding policy information of each policy to obtain second printing data, and writing the second printing data into a second data table;
comparing the first data table with the second data table;
when the difference exists between the first data table and the second data table according to the comparison result, the difference data in the first data table is written into a first document, the difference data in the second data table is written into a second document, and the first document and the second document are used for judging whether the updated printing program is abnormal or not.
In one embodiment, the comparing the first data table with the second data table includes:
respectively carrying out operation on each column of data in the first data table to obtain a first operation result set;
respectively carrying out operation on each column of data in the second data table to obtain a second operation result set;
and when any one first operation result in the first operation result set is different from the corresponding second operation result in the second operation result set, comparing the data of the corresponding column of the first operation result with the data of the corresponding column of the second operation result.
In one embodiment, the calculating the data of each column in the first data table to obtain a first operation result set includes:
when the data of any column in the first data table is numerical data, executing a first operation to obtain a first operation result set, wherein the first operation is summation or averaging;
and when the data of any column in the first data table contains non-numerical data, executing a second operation to obtain a first operation result set, wherein the second operation is hash operation.
In one embodiment, before comparing the first data table and the second data table, the method includes:
running a second preset number of comparison threads according to the first preset number;
the comparing the first data table with the second data table includes:
and comparing the first data table with the second data table through a second preset number of the comparison threads.
In one embodiment, the method further comprises:
and executing preset processing operations on the difference data in the first data table and the second data table, wherein the preset processing operations comprise at least one of font thickening, font amplifying, font reddening and highlighting.
In one embodiment, the method further comprises:
and counting the data of the preset type according to the first data table or the second data table, generating a report according to the counting result, and displaying the report.
A print program testing apparatus, the apparatus comprising:
the policy information acquisition module is used for acquiring the policy information corresponding to the first preset number of policies;
the first printing data acquisition module is used for calling the history printing program interface to respectively read the policy information corresponding to each policy to obtain first printing data, and writing the first printing data into the first data table;
the second print data acquisition module is used for calling the current print program interface to respectively read the policy information corresponding to each policy to obtain second print data, and writing the second print data into a second data table;
the comparison module is used for comparing the first data table with the second data table;
the judging module is used for writing the difference data in the first data table into a first document and writing the difference data in the second data table into a second document when judging that the first data table and the second data table are different according to the comparison result, and the first document and the second document are used for judging whether the updated printing program is abnormal or not.
In one embodiment, the comparison module is further configured to:
respectively carrying out operation on each column of data in the first data table to obtain a first operation result set; respectively carrying out operation on each column of data in the second data table to obtain a second operation result set; and when any one first operation result in the first operation result set is different from the corresponding second operation result in the second operation result set, comparing the data of the corresponding column of the first operation result with the data of the corresponding column of the second operation result.
A computer device comprising a memory storing a computer program and a processor which when executing the computer program performs the steps of:
acquiring policy information corresponding to a first preset number of policies;
calling a history printing program interface to respectively read the corresponding policy information of each policy to obtain first printing data, and writing the first printing data into a first data table;
calling a current printing program interface to respectively read the corresponding policy information of each policy to obtain second printing data, and writing the second printing data into a second data table;
Comparing the first data table with the second data table;
when the difference exists between the first data table and the second data table according to the comparison result, the difference data in the first data table is written into a first document, the difference data in the second data table is written into a second document, and the first document and the second document are used for judging whether the updated printing program is abnormal or not.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
acquiring policy information corresponding to a first preset number of policies;
calling a history printing program interface to respectively read the corresponding policy information of each policy to obtain first printing data, and writing the first printing data into a first data table;
calling a current printing program interface to respectively read the corresponding policy information of each policy to obtain second printing data, and writing the second printing data into a second data table;
comparing the first data table with the second data table;
when the difference exists between the first data table and the second data table according to the comparison result, the difference data in the first data table is written into a first document, the difference data in the second data table is written into a second document, and the first document and the second document are used for judging whether the updated printing program is abnormal or not.
According to the printing program testing method, the device, the computer equipment and the storage medium, the printing program testing device, the printing program testing method and the printing program testing device are characterized in that firstly, the policy information corresponding to the preset number of policies is acquired, then the historical printing program interfaces and the updated printing program interfaces are respectively called to read the printing data corresponding to each policy, then the obtained printing data are respectively written into two different data tables, then the data of the two data tables are compared, when the difference exists, the difference data in the two tables are respectively written into two different documents, and whether the updated printing program is abnormal or not is judged through the two documents.
Drawings
FIG. 1 is an application scenario diagram of a print program testing method in one embodiment;
FIG. 2 is a flow chart of a print program testing method according to one embodiment;
FIG. 3 is a flow chart of a print program testing method according to another embodiment;
FIG. 4 is a block diagram of a printer testing apparatus in one embodiment;
Fig. 5 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The printing program testing method provided by the application can be applied to an application environment shown in fig. 1. Wherein the terminal 102 communicates with the database 104 via a network. The terminal 102 obtains the policy information corresponding to the preset number of policies from the database, calls the historical printing program interface and the updated printing program interface respectively to read the policy information corresponding to each policy, obtains the first printing data corresponding to the historical printing program interface and the second printing data corresponding to the updated printing program interface, writes the first printing data and the second printing data into the first data table and the second data table respectively, compares the first data table with the second data table, and if the two data tables are judged to have differences according to the comparison result, the fact that the data printed by the updated printing program interface may have errors is indicated, and writes the difference data in the first data table and the second data table into the first document and the second document respectively, wherein the first document and the second document are used for judging whether the updated printing program has abnormality or not. The terminal 102 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, etc.
In one embodiment, as shown in fig. 2, a print program testing method is provided, and the method is applied to the terminal 102 in fig. 1 for illustration, and includes the following steps:
step S202, acquiring the policy information corresponding to the first preset number of policies.
Specifically, the policy information is stored in the database, and the policy information corresponding to each policy includes, but is not limited to, applicant information, insured information, insurance category, related fee information, insurance item information, and the like.
In this embodiment, the terminal selects a certain number of policy numbers from the database, and then obtains policy information corresponding to the policy numbers, where the policy number may be selected randomly or according to a certain condition, for example, the policy number with the policy generation time within a preset time period may be selected. Further, the terminal acquires the policy information corresponding to the policy numbers from the database.
Step S204, calling a history printing program interface to respectively read the corresponding policy information of each policy to obtain first printing data, and writing the first printing data into a first data table.
Specifically, the history print program interface refers to an interface corresponding to a history version of the print program preceding the print program updated this time. In one embodiment, when there are multiple historical program interfaces with different versions, in order to ensure the accuracy of the test, the called historical printing program interface may be the interface corresponding to the printing program with the shortest time distance between the updated printing program.
In one embodiment, the terminal directly takes the data returned by the historical printing program interface as first printing data; in another embodiment, the terminal calls the history printing program interface to print the policy information to obtain a print result picture, and then obtains first print data according to the print result picture, wherein the printing is virtual printing, for example, the print is performed by using an ADOBE virtual printing technology to obtain the print result picture and save the print result picture, the print result picture can be in pdf format or be converted into other picture formats such as jpg, and then the first print data is extracted from the print result picture, or the print result picture is converted into a data file format such as TXT format to obtain the first print data.
Further, the terminal writes the obtained first print data into the first data table, wherein the storage mode of the first print data is different according to the different structures of the first data table. In one embodiment, all print data corresponding to a policy is stored in a row of a data table, the row of data including a plurality of different fields, each field corresponding to a column of data. In another embodiment, all print data corresponding to one policy is stored in the data table in a plurality of rows, each row storing data of a different field.
Step S206, calling the current printing program interface to respectively read the corresponding policy information of each policy to obtain second printing data, and writing the second printing data into a second data table.
Specifically, the current printing program interface refers to an interface corresponding to a printing program updated after program upgrading based on a history version printing program.
In one embodiment, the terminal directly takes the data returned by the current printing program interface as second printing data; in another embodiment, the terminal invokes the current printing program interface to print the policy information to obtain a print result picture, and then obtains second print data according to the print result picture, wherein the printing is virtual printing, for example, printing is performed by using an ADOBE virtual printing technology to obtain the print result picture and storing the print result picture, the print result picture can be in pdf format or be converted into other picture formats such as jpg, then the second print data is extracted from the print result picture, or the print result picture is converted into a data file format such as TXT format, so as to obtain the second print data,
further, the terminal writes the second print data to the second data table.
Step S208, the first data table and the second data table are compared.
Specifically, the terminal compares the print data corresponding to each policy in the first data table with the print data of the policy in the second data table.
In one embodiment, to improve the comparison efficiency, the terminal may run a plurality of comparison threads, and then compare the first data table with the second data table through the plurality of comparison threads. The number of the comparison threads may be determined according to the number of the policies corresponding to the policy information acquired in step S202, and the more the number of the policies is, the more comparison threads may be correspondingly operated.
And step S210, when the difference exists between the first data table and the second data table according to the comparison result, writing the difference data in the first data table into the first document, and writing the difference data in the second data table into the second document.
Specifically, the print data in the first data table is different from the print data in the second data table for a certain policy, which is indicated by the difference between the first data table and the second data table. In this embodiment, when it is determined that there is a difference between the first data table and the second data table according to the comparison result, the terminal writes the difference data in the first data table into the first document, and writes the difference data in the second data table into the second document. In one embodiment, the first document and the second document are both TXT documents.
The first document and the second document are used for judging whether the updated printing program is abnormal or not, specifically, a first code segment corresponding to each field in the first document in the historical printing program is obtained respectively, a second code segment corresponding to each field in the updated printing program is compared with the first code segment and the second code segment respectively, if the second code segment is the code segment corresponding to the current update, the updated printing program is judged to be abnormal, otherwise, the updated printing program is judged to be abnormal. In one embodiment, the terminal outputs abnormality notification information when it is determined that the updated print program is abnormal.
According to the printing program testing method, the terminal firstly acquires the policy information corresponding to the preset number of policies, then respectively calls the historical printing program interfaces and the updated printing program interfaces to read the printing data corresponding to each policy, then respectively writes the obtained printing data into two different data tables, then compares the data of the two data tables, respectively writes the difference data in the two tables into two different documents when the difference exists, and judges whether the updated printing program is abnormal or not through the two documents.
In one embodiment, in step S208, comparing the first data table with the second data table includes: respectively carrying out operation on each column of data in the first data table to obtain a first operation result set; respectively carrying out operation on each column of data in the second data table to obtain a second operation result set; when any one first operation result in the first operation result set is different from the corresponding second operation result in the second operation result set, comparing the data of the corresponding column of the first operation result with the data of the corresponding column of the second operation result.
Wherein, each row of the first data table and the second data table corresponds to the print data of a policy, the print data of the policy comprises the print data corresponding to the information of the applicant, the print data corresponding to the information of the protected, the print data corresponding to the insurance type, and the like, and different print data are stored in different columns of the row data corresponding to the policy, namely, corresponding to different fields.
In this embodiment, the terminal performs an operation on each column of data in the first data table to obtain a first operation result corresponding to each column of data, where the first operation results corresponding to each column of data form a first operation result set; and the terminal calculates each row of data in the second data table to obtain a second operation result corresponding to each row of data, and the second operation results corresponding to each row of data form a second operation result set.
Further, the terminal compares the first operation result set with the second operation result set, and when comparing, the terminal compares the first operation result in the first operation result set with the second operation result corresponding to the second operation result set, wherein the corresponding means that the field name corresponding to the first operation result is the same as the field name corresponding to the second operation result. In one embodiment, since the first data table and the second data table are data tables with the same structure, when the positions of the column data corresponding to the two operation results are the same, the two operation results are the operation results corresponding to each other. If a certain first operation result in the first operation result set is an operation result of the third column data in the first data table, a second operation result corresponding to the first operation result in the second operation result set is an operation result of the third column data in the second data table.
Further, if the first operation result is the same as the second operation result corresponding to the first operation result, it is indicated that the column data corresponding to the first operation result is the same as the column data corresponding to the second operation result, otherwise, if the first operation result is not the same as the second operation result corresponding to the first operation result, it is indicated that the column data corresponding to the first operation result is not the same as the column data corresponding to the second operation result, and the same two columns of data may not be compared, and only the two different columns of data may be compared, so that the data amount of comparison may be reduced, and the comparison efficiency may be improved.
In one embodiment, each column of data in the first data table is operated to obtain a first operation result set, which includes: when the data of any column in the first data table is numerical data, executing a first operation to obtain a first operation result set, wherein the first operation is summation or averaging; when the data of any column in the first data table contains non-numerical data, executing a second operation to obtain a first operation result set, wherein the second operation is hash operation.
The numerical data comprises integer data, floating point data and date format data, and specifically, for integer data, such as the age 43 of an applicant, the original data can be directly operated; for floating point data, the data can be calculated after decimal places with certain precision are reserved, for example, the premium 1234.2 can be calculated after three decimal places 1234.200 are reserved; for date format data, such as 2017, 07 and 04, converting the date format data into 20170904, and performing operations, wherein the operations include, but are not limited to, summation, namely adding all data of each row of the column to obtain a first operation result; or averaging, namely summing, and dividing the obtained sum value by the total number of rows of the column to obtain a first operation result.
The non-numerical data includes data recorded in letters or characters, such as name of applicant, insurance type, etc., when any one column of data includes the non-numerical data, all the data in the column are combined into a character string, and a hash value corresponding to the character string is calculated to obtain a second operation result. Wherein, MD5 algorithm can be adopted in calculating hash value.
In this embodiment, when all the data in any column in the first data table are numerical data, the terminal performs summing or averaging operation to obtain a first operation result set, when the data in any column in the first data table contains non-numerical data, the terminal performs hash operation to obtain a second operation result, and performs corresponding operation by determining the type of data in a certain column in the data table, so that the operation result of each column of data in the data table can be accurately calculated, and whether the two columns of data are identical can be determined by directly comparing the operation results, thereby improving the comparison efficiency of the data.
It can be understood that, the operation is performed on each column of data in the second data table to obtain the second operation result set, which is referred to the implementation manner in the foregoing embodiment, and this application will not be repeated herein.
In one embodiment, the method further comprises: and performing preset processing operations on the difference data in the first data table and the second data table, wherein the preset processing operations comprise at least one of font thickening, font amplifying, font reddening and highlighting.
In this embodiment, by performing a preset processing operation on the difference data, the difference data can be highlighted, so that a tester can grasp the position of the difference data in the data table at a glance.
In one embodiment, the method further comprises: and counting the data of the preset type according to the first data table or the second data table, generating a report according to the counting result, and displaying the report.
Wherein the preset data types comprise insurance types, insurance policy number corresponding to the insurance types, channels and insurance policy number corresponding to the channels,
in this embodiment, statistics is performed according to the first data table or the second data table, so as to obtain which insurance types are related in the selected insurance policy, the number of insurance policies corresponding to each insurance type, and which channels are related in the selected insurance policy, and the number of insurance policies related to each channel, and generate a report according to the statistics result.
Further, the terminal displays the report, so that a tester can clearly grasp the coverage range of the selected policy, and the selected policy can be properly adjusted according to the coverage range of the policy. For example, when the insurance types or channels covered by the insurance policy are fewer, some insurance policies can be additionally added, and further tests are performed according to the method provided by the application, so that the accuracy of the tests is ensured, and the error rate of printing the insurance policy is reduced to the greatest extent.
In one embodiment, as shown in fig. 3, a print program testing method is provided, which includes the steps of:
step S302, acquiring policy information corresponding to a first preset number of policies;
step S304, calling a history printing program interface to respectively read the corresponding policy information of each policy to obtain first printing data, and writing the first printing data into a first data table;
step S306, calling the current printing program interface to respectively read the corresponding policy information of each policy to obtain second printing data, and writing the first printing data into a second data table;
step S308, judging whether the data of any column in the first data table contains non-numerical data;
Step S310, if not, executing a first operation to obtain a first operation result set, wherein the first operation is summation or averaging;
step S312, if yes, executing a second operation to obtain a first operation result set, wherein the second operation is hash operation;
step S314, judging whether the data in any column of the second data table contains non-numerical data;
step S316, if not, executing a first operation to obtain a second operation result set, wherein the first operation is summation or averaging;
in step S318, if yes, a second operation is performed to obtain a second operation result set, where the second operation is a hash operation.
Step S320, when any one of the first operation result set is different from the corresponding second operation result in the second operation result set, comparing the data in the corresponding column of the first operation result with the data in the corresponding column of the second operation result;
step S322, when the difference exists between the first data table and the second data table according to the comparison result, writing the difference data in the first data table into a first document, writing the difference data in the second data table into a second document, wherein the first document and the second document are used for judging whether the updated printing program is abnormal or not;
Step S324, performing preset processing operations on the difference data in the first data table and the second data table, wherein the preset processing operations comprise at least one of font thickening, font amplifying, font reddening and highlighting;
and step S326, counting the data of the preset type according to the first data table or the second data table, generating a report according to the counting result, and displaying the report.
It should be understood that, although the steps in the flowcharts of fig. 2-3 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 2-3 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily occur sequentially, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or steps.
In one embodiment, as shown in FIG. 4, there is provided a print program testing apparatus 400 comprising: a policy information acquisition module 402, a first print data acquisition module 404, a second print data acquisition module 406, a comparison module 408, and a judgment module 410, wherein:
the policy information obtaining module 402 is configured to obtain policy information corresponding to a first preset number of policies;
the first print data obtaining module 404 is configured to call the history print program interface to read the policy information corresponding to each policy respectively, obtain first print data, and write the first print data into the first data table;
a second print data obtaining module 406, configured to call the current print program interface to read the policy information corresponding to each policy, obtain second print data, and write the second print data into the second data table;
a comparison module 408, configured to compare the first data table with the second data table;
the judging module 410 is configured to, when it is judged that there is a difference between the first data table and the second data table according to the comparison result, write the difference data in the first data table into the first document, write the difference data in the second data table into the second document, and the first document and the second document are used to judge whether the updated printing program is abnormal.
In one embodiment, the comparison module 408 is further configured to perform an operation on each column of data in the first data table to obtain a first operation result set; respectively carrying out operation on each column of data in the second data table to obtain a second operation result set; when any one first operation result in the first operation result set is different from the corresponding second operation result in the second operation result set, comparing the data of the corresponding column of the first operation result with the data of the corresponding column of the second operation result.
In one embodiment, the comparison module 408 is further configured to perform a first operation to obtain a first operation result set when the data in any column in the first data table is numeric data, where the first operation is summation or averaging; when the data of any column in the first data table contains non-numerical data, executing a second operation to obtain a first operation result set, wherein the second operation is hash operation.
In one embodiment, the apparatus further comprises: the comparison thread running module is used for running a second preset number of comparison threads according to the first preset number; the comparison module 408 is configured to compare the first data table and the second data table through a second preset number of comparison threads.
In one embodiment, the apparatus further comprises: the preset processing operation execution module is used for executing preset processing operations on the difference data in the first data table and the second data table, wherein the preset processing operations comprise at least one of font thickening, font amplifying, font marking red and highlighting.
In one embodiment, the apparatus further comprises: the report display module is used for counting the data of the preset type according to the first data table or the second data table, generating a report according to the counting result and displaying the report.
For specific limitations of the printing program testing apparatus, reference may be made to the above limitations of the printing program testing method, and no further description is given here. The respective modules in the above-described printing program testing apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a terminal, and the internal structure of which may be as shown in fig. 5. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a print program testing method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 5 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory storing a computer program and a processor that when executing the computer program performs the steps of: acquiring policy information corresponding to a first preset number of policies; calling a history printing program interface to respectively read the corresponding policy information of each policy to obtain first printing data, and writing the first printing data into a first data table; calling a current printing program interface to respectively read the corresponding policy information of each policy to obtain second printing data, and writing the second printing data into a second data table; comparing the first data table with the second data table; when the difference exists between the first data table and the second data table according to the comparison result, the difference data in the first data table is written into the first document, the difference data in the second data table is written into the second document, and the first document and the second document are used for judging whether the updated printing program is abnormal or not.
In one embodiment, comparing the first data table with the second data table includes: respectively carrying out operation on each column of data in the first data table to obtain a first operation result set; respectively carrying out operation on each column of data in the second data table to obtain a second operation result set; when any one first operation result in the first operation result set is different from the corresponding second operation result in the second operation result set, comparing the data of the corresponding column of the first operation result with the data of the corresponding column of the second operation result.
In one embodiment, each column of data in the first data table is operated to obtain a first operation result set, which includes: when the data of any column in the first data table is numerical data, executing a first operation to obtain a first operation result set, wherein the first operation is summation or averaging; when the data of any column in the first data table contains non-numerical data, executing a second operation to obtain a first operation result set, wherein the second operation is hash operation.
In one embodiment, before comparing the first data table and the second data table, the processor when executing the computer program further performs the steps of: running a second preset number of comparison threads according to the first preset number; comparing the first data table with the second data table, including: and comparing the first data table with the second data table through a second preset number of comparison threads.
In one embodiment, the processor when executing the computer program further performs the steps of: and performing preset processing operations on the difference data in the first data table and the second data table, wherein the preset processing operations comprise at least one of font thickening, font amplifying, font reddening and highlighting.
In one embodiment, the processor when executing the computer program further performs the steps of: and counting the data of the preset type according to the first data table or the second data table, generating a report according to the counting result, and displaying the report.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of: acquiring policy information corresponding to a first preset number of policies; calling a history printing program interface to respectively read the corresponding policy information of each policy to obtain first printing data, and writing the first printing data into a first data table; calling a current printing program interface to respectively read the corresponding policy information of each policy to obtain second printing data, and writing the second printing data into a second data table; comparing the first data table with the second data table; when the difference exists between the first data table and the second data table according to the comparison result, the difference data in the first data table is written into the first document, the difference data in the second data table is written into the second document, and the first document and the second document are used for judging whether the updated printing program is abnormal or not.
In one embodiment, comparing the first data table with the second data table includes: respectively carrying out operation on each column of data in the first data table to obtain a first operation result set; respectively carrying out operation on each column of data in the second data table to obtain a second operation result set; when any one first operation result in the first operation result set is different from the corresponding second operation result in the second operation result set, comparing the data of the corresponding column of the first operation result with the data of the corresponding column of the second operation result.
In one embodiment, each column of data in the first data table is operated to obtain a first operation result set, which includes: when the data of any column in the first data table is numerical data, executing a first operation to obtain a first operation result set, wherein the first operation is summation or averaging; when the data of any column in the first data table contains non-numerical data, executing a second operation to obtain a first operation result set, wherein the second operation is hash operation.
In one embodiment, the computer program when executed by the processor further performs the steps of: running a second preset number of comparison threads according to the first preset number; comparing the first data table with the second data table, including: and comparing the first data table with the second data table through a second preset number of comparison threads.
In one embodiment, the computer program when executed by the processor further performs the steps of: and performing preset processing operations on the difference data in the first data table and the second data table, wherein the preset processing operations comprise at least one of font thickening, font amplifying, font reddening and highlighting.
In one embodiment, the computer program when executed by the processor further performs the steps of: and counting the data of the preset type according to the first data table or the second data table, generating a report according to the counting result, and displaying the report.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (10)

1. A print program testing method, the method comprising:
acquiring policy information corresponding to a first preset number of policies;
calling a history printing program interface to respectively read the corresponding policy information of each policy to obtain first printing data, and writing the first printing data into a first data table;
calling a current printing program interface to respectively read the corresponding policy information of each policy to obtain second printing data, and writing the second printing data into a second data table;
When the data of any column in the first data table is numerical data, executing a first operation to obtain a first operation result set, wherein the first operation is summation or averaging;
when the data of any column in the first data table contains non-numerical data, executing a second operation to obtain a first operation result set, wherein the second operation is hash operation;
respectively carrying out operation on each column of data in the second data table to obtain a second operation result set; each row of the first data table and the second data table corresponds to the printing data of one policy, the printing data of the policy comprises the printing data corresponding to the information of the applicant, the printing data corresponding to the information of the protected person and the printing data corresponding to the insurance type, and different printing data are stored in different columns of the row data corresponding to the policy, namely, corresponding to different fields;
comparing a first operation result in the first operation result set with a second operation result in the second operation result set; the field name corresponding to the first operation result is the same as the field name corresponding to the second operation result;
when any one first operation result in the first operation result set is different from the corresponding second operation result in the second operation result set, comparing the data of the corresponding column of the first operation result with the data of the corresponding column of the second operation result; if the first operation result is the same as the second operation result corresponding to the first operation result, the column data corresponding to the first operation result is the same as the column data corresponding to the second operation result, otherwise, if the first operation result is different from the second operation result corresponding to the first operation result, the column data corresponding to the first operation result is different from the column data corresponding to the second operation result, and the comparison may not be performed for the same two columns of data;
When judging that the first data table and the second data table have differences according to the comparison result, writing the difference data in the first data table into a first document, and writing the difference data in the second data table into a second document;
acquiring a first code segment corresponding to each field in the first document in a historical printing program and a second code segment corresponding to each field in the second document in a current printing program, comparing the first code segment with the second code segment, judging that the current printing program is not abnormal if the second code segment is a code segment corresponding to an updating program, and judging that the current printing program is abnormal if the second code segment is not a code segment corresponding to the updating program; the update program is a program that the current print program updates on the basis of the history print program.
2. The method according to claim 1, wherein the method further comprises:
and comparing the first data table with the second data table through a second preset number of comparison threads.
3. The method according to claim 1, wherein the method further comprises:
And executing preset processing operations on the difference data in the first data table and the second data table, wherein the preset processing operations comprise at least one of font thickening, font amplifying, font reddening and highlighting.
4. A method according to any one of claims 1 to 3, characterized in that the method further comprises:
and counting the data of the preset type according to the first data table or the second data table, generating a report according to the counting result, and displaying the report.
5. A print program testing apparatus, the apparatus comprising:
the policy information acquisition module is used for acquiring the policy information corresponding to the first preset number of policies;
the first printing data acquisition module is used for calling the history printing program interface to respectively read the policy information corresponding to each policy to obtain first printing data, and writing the first printing data into the first data table;
the second print data acquisition module is used for calling the current print program interface to respectively read the policy information corresponding to each policy to obtain second print data, and writing the second print data into a second data table;
the comparison module is used for executing a first operation to obtain a first operation result set when the data of any column in the first data table is numerical data, wherein the first operation is summation or averaging; when the data of any column in the first data table contains non-numerical data, executing a second operation to obtain a first operation result set, wherein the second operation is hash operation; respectively carrying out operation on each column of data in the second data table to obtain a second operation result set; each row of the first data table and the second data table corresponds to the printing data of one policy, the printing data of the policy comprises the printing data corresponding to the information of the applicant, the printing data corresponding to the information of the protected person and the printing data corresponding to the insurance type, and different printing data are stored in different columns of the row data corresponding to the policy, namely, corresponding to different fields; comparing a first operation result in the first operation result set with a second operation result in the second operation result set; the field name corresponding to the first operation result is the same as the field name corresponding to the second operation result; when any one first operation result in the first operation result set is different from the corresponding second operation result in the second operation result set, comparing the data of the corresponding column of the first operation result with the data of the corresponding column of the second operation result; if the first operation result is the same as the second operation result corresponding to the first operation result, the column data corresponding to the first operation result is the same as the column data corresponding to the second operation result, otherwise, if the first operation result is different from the second operation result corresponding to the first operation result, the column data corresponding to the first operation result is different from the column data corresponding to the second operation result, and the comparison may not be performed for the same two columns of data; the judging module is used for writing the difference data in the first data table into a first document and writing the difference data in the second data table into a second document when judging that the first data table and the second data table are different according to the comparison result; acquiring a first code segment corresponding to each field in the first document in a historical printing program and a second code segment corresponding to each field in the second document in a current printing program, comparing the first code segment with the second code segment, judging that the current printing program is not abnormal if the second code segment is a code segment corresponding to an updating program, and judging that the current printing program is abnormal if the second code segment is not a code segment corresponding to the updating program; the update program is a program that the current print program updates on the basis of the history print program.
6. The apparatus of claim 5, wherein the apparatus is further configured to:
and comparing the first data table with the second data table through a second preset number of comparison threads.
7. The apparatus of claim 5, further comprising a preset processing operation execution module, specifically configured to:
and executing preset processing operations on the difference data in the first data table and the second data table, wherein the preset processing operations comprise at least one of font thickening, font amplifying, font reddening and highlighting.
8. The apparatus of claim 5, further comprising a report presentation module, specifically configured to:
and counting the data of the preset type according to the first data table or the second data table, generating a report according to the counting result, and displaying the report.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 4 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 4.
CN201811026058.8A 2018-09-04 2018-09-04 Printing program testing method, device, computer equipment and storage medium Active CN109446055B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811026058.8A CN109446055B (en) 2018-09-04 2018-09-04 Printing program testing method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811026058.8A CN109446055B (en) 2018-09-04 2018-09-04 Printing program testing method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109446055A CN109446055A (en) 2019-03-08
CN109446055B true CN109446055B (en) 2024-02-02

Family

ID=65530865

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811026058.8A Active CN109446055B (en) 2018-09-04 2018-09-04 Printing program testing method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109446055B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112597021B (en) * 2020-12-24 2024-08-02 中国农业银行股份有限公司 Bank counter transaction automatic testing method and device based on linkage printer

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101120307A (en) * 2005-02-18 2008-02-06 佳能株式会社 Information processing apparatus for processing print data, method thereof and media in storage of control program of executing such method
WO2017036068A1 (en) * 2015-08-28 2017-03-09 中兴通讯股份有限公司 Method and system for realizing software automatic test
CN107741903A (en) * 2017-09-11 2018-02-27 平安科技(深圳)有限公司 Application compatibility method of testing, device, computer equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101120307A (en) * 2005-02-18 2008-02-06 佳能株式会社 Information processing apparatus for processing print data, method thereof and media in storage of control program of executing such method
WO2017036068A1 (en) * 2015-08-28 2017-03-09 中兴通讯股份有限公司 Method and system for realizing software automatic test
CN107741903A (en) * 2017-09-11 2018-02-27 平安科技(深圳)有限公司 Application compatibility method of testing, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN109446055A (en) 2019-03-08

Similar Documents

Publication Publication Date Title
CN109445842B (en) Rule generation method, device, computer equipment and storage medium
CN108388598B (en) Electronic device, data storage method, and storage medium
CN110008455B (en) Table editing method, apparatus, computer device and storage medium
CN109542761B (en) Software quality evaluation method, device and storage medium
CN110413922B (en) Page information display method, device, computer equipment and storage medium
CN111062186B (en) Text processing method, device, computer equipment and storage medium
CN109446055B (en) Printing program testing method, device, computer equipment and storage medium
CN109255104B (en) Batch template configuration method and device, computer equipment and storage medium
CN114327435A (en) Technical document generation method and device and computer readable storage medium
CN109241371B (en) Map data storage method, map data loading method, map data storage device, map data loading device and computer equipment
CN112463630A (en) Version difference testing method and device, computer equipment and storage medium
CN113434122A (en) Multi-role page creation method and device, server and readable storage medium
CN107392260B (en) Error calibration method and device for character recognition result
CN113032332B (en) Label data processing method, apparatus, computer device and storage medium
CN115359828A (en) Server firmware refreshing method, device, terminal and storage medium
CN115437571A (en) Data writing method and device, computer equipment and storage medium
CN112711605B (en) Fault analysis method, device, computer equipment and storage medium
CN112579571B (en) Monitoring data configuration, data monitoring method, device, equipment and storage medium
CN115017436A (en) Data interaction method and device of application program, computer equipment and storage medium
CN111124932B (en) Scheme verification method, system, device, computer equipment and storage medium
CN111400670B (en) Watermark adding method, device, equipment and storage medium
CN109544661B (en) Area map drawing method, apparatus, computer device and storage medium
CN111083007B (en) Test method, test device, computer equipment and storage medium
CN112420168B (en) Method, device, equipment and storage medium for writing data into database
CN116910038A (en) Information analysis method, apparatus, computer device and computer program product

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