CN113590467B - Data comparison method, system, computer device and computer readable storage medium - Google Patents

Data comparison method, system, computer device and computer readable storage medium Download PDF

Info

Publication number
CN113590467B
CN113590467B CN202110733538.3A CN202110733538A CN113590467B CN 113590467 B CN113590467 B CN 113590467B CN 202110733538 A CN202110733538 A CN 202110733538A CN 113590467 B CN113590467 B CN 113590467B
Authority
CN
China
Prior art keywords
script
test
processed
content
identifier
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
CN202110733538.3A
Other languages
Chinese (zh)
Other versions
CN113590467A (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 Health Insurance Company of China Ltd
Original Assignee
Ping An Health 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 Health Insurance Company of China Ltd filed Critical Ping An Health Insurance Company of China Ltd
Priority to CN202110733538.3A priority Critical patent/CN113590467B/en
Publication of CN113590467A publication Critical patent/CN113590467A/en
Application granted granted Critical
Publication of CN113590467B publication Critical patent/CN113590467B/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/3604Software analysis for verifying properties of programs
    • G06F11/3608Software analysis for verifying properties of programs using formal methods, e.g. model checking, abstract interpretation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • 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

Abstract

The embodiment of the invention provides a data comparison method, which comprises the following steps: receiving a script processing request sent by terminal equipment; in response to the script processing request: acquiring a first starting identifier and a first ending identifier of a test script file, and acquiring test script content based on the first starting identifier and the first ending identifier; acquiring a second initial identifier and a second termination identifier of the script file to be processed, acquiring script content to be processed based on the second initial identifier and the second termination identifier, calculating the similarity of the test script content and the script content to be processed, and comparing the similarity with a preset threshold value; determining that the content of the script to be processed enters a test state or determining that the script to be processed enters a test reject state according to the comparison result; by automatically comparing the test script content with the script content to be processed in the system, the script comparison efficiency is effectively improved.

Description

Data comparison method, system, computer device and computer readable storage medium
Technical Field
Embodiments of the present invention relate to the field of information technologies, and in particular, to a data comparison method, a system, a computer device, and a computer readable storage medium.
Background
In the process of testing the script by a tester, the shell script provided by the developer needs to be verified. However, current shell script verification typically relies on a tester to compare the shell script to be verified with a reference script in the system in a script verification system. Under the large environment that project iteration cycles are gradually shortened, only a tester is relied on to manually verify the shell script, and the problem of low verification efficiency of the shell script easily occurs.
Disclosure of Invention
In view of the above, the embodiments of the present invention provide a data comparison method, system, computer device and computer readable storage medium, which are used for solving the problem of low verification efficiency of the existing shell script.
The embodiment of the invention solves the technical problems through the following technical scheme:
a data comparison method, comprising:
receiving a script processing request sent by a terminal device, wherein the script processing request carries a test script file and a to-be-processed script file, and the script processing request is used for requesting comparison of the test script file and the to-be-processed script file;
responding to the script processing request: acquiring a first starting identifier and a first ending identifier of the test script file, and acquiring test script content based on the first starting identifier and the first ending identifier; acquiring a second starting identifier and a second ending identifier of the script file to be processed, acquiring script content to be processed based on the second starting identifier and the second ending identifier, calculating the similarity of the test script content and the script content to be processed, and comparing the similarity with a preset threshold; a kind of electronic device with high-pressure air-conditioning system
And according to the comparison result, determining that the content of the script to be processed enters a test state or determining that the script to be processed enters a test revetment state.
Optionally, if the test script file is a test script image, the script file to be processed is a script image to be processed; the first starting identifier and the first ending identifier of the test script file are obtained, and the test script content is obtained based on the first starting identifier and the first ending identifier; the step of obtaining the second starting identifier and the second ending identifier of the script file to be processed, and obtaining the script content to be processed based on the second starting identifier and the second ending identifier, further comprises the following steps:
identifying the test script image to obtain first content, the first start identifier and the first termination identifier;
identifying the script image to be processed to obtain second content, the second starting identifier and the second ending identifier;
extracting the test script content from the first content based on the first start identifier and the first end identifier; a kind of electronic device with high-pressure air-conditioning system
And extracting the script content to be processed from the second content based on the second starting identifier and the second ending identifier.
Optionally, the first start identifier and the first termination identifier of the test script are obtained, and the content of the test script is obtained based on the first start identifier and the first termination identifier; the step of obtaining the second starting identifier and the second ending identifier of the script to be processed and obtaining the content of the script to be processed based on the second starting identifier and the second ending identifier comprises the following steps:
acquiring original test script content based on the first starting identifier and the first ending identifier;
acquiring original script content to be processed based on the second starting identifier and the second ending identifier;
according to a first preset data format, converting the original test script content into a first variable;
according to a first preset data format, converting the original script content to be processed into a second variable;
converting the first variable into the test script content according to a second preset data format; a kind of electronic device with high-pressure air-conditioning system
And converting the second variable into the script content to be processed according to a second preset data format.
Optionally, the test script content includes a plurality of first script contents, and the script content to be processed includes a plurality of second script contents; the step of calculating the similarity between the test script content and the script content to be processed further comprises the following steps:
calculating a first similarity of each piece of first script content and each piece of second script content; a kind of electronic device with high-pressure air-conditioning system
And carrying out weighted summation on the first similarity, and obtaining the similarity.
Optionally, the test script content includes a plurality of first script contents, and the script content to be processed includes a plurality of second script contents; the step of calculating the similarity between the test script content and the script content to be processed further comprises the following steps:
obtaining a plurality of preset similarity algorithms;
according to each preset similarity algorithm, calculating the first similarity of each piece of first script content and each piece of second script content;
performing first weighted average on a plurality of first similarities corresponding to each piece of first script content to obtain a second similarity corresponding to each piece of first script content; a kind of electronic device with high-pressure air-conditioning system
And weighting and summing a plurality of second similarities to obtain the similarity.
Optionally, after the step of determining that the script content to be processed enters the test state according to the comparison result, the method further includes:
the script content to be processed is sent to a test server, and a test is executed on the script content to be processed to obtain a test result; a kind of electronic device with high-pressure air-conditioning system
And returning the comparison result and the test result to the terminal equipment.
Optionally, the step of sending the script content to be processed to a test server, and executing a test on the script content to be processed to obtain a test result includes:
the script content to be processed is sent to a workflow task scheduling component;
generating a test scheduling task according to the script content to be processed through the workflow task scheduling component, wherein the test scheduling task carries the script content to be processed;
the test scheduling task is sent to the test server; a kind of electronic device with high-pressure air-conditioning system
Executing the test scheduling task through the test server: and executing the test on the script content to be processed to obtain a test result.
In order to achieve the above object, an embodiment of the present invention further provides a data comparison system, including:
the receiving module is used for receiving a script processing request sent by the terminal equipment, wherein the script processing request carries a test script file and a to-be-processed script file, and the script processing request is used for requesting to compare the test script file and the to-be-processed script file;
a response module, configured to process a request in response to the script: acquiring a first starting identifier and a first ending identifier of the test script file, and acquiring test script content based on the first starting identifier and the first ending identifier; acquiring a second starting identifier and a second ending identifier of the script file to be processed, acquiring script content to be processed based on the second starting identifier and the second ending identifier, calculating the similarity of the test script content and the script content to be processed, and comparing the similarity with a preset threshold; a kind of electronic device with high-pressure air-conditioning system
The determining module is used for determining that the script content to be processed enters a test state or determining that the script to be processed enters a test revetment state according to the comparison result.
To achieve the above object, an embodiment of the present invention further provides a computer device including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the data comparison method as described above when executing the computer program.
To achieve the above object, an embodiment of the present invention also provides a computer-readable storage medium having stored therein a computer program executable by at least one processor to cause the at least one processor to perform the steps of the data comparison method as described above.
According to the data comparison method, the system, the computer equipment and the computer readable storage medium provided by the embodiment of the invention, the test script content is obtained based on the first starting identifier and the first ending identifier, the script content to be processed is obtained based on the second starting identifier and the second ending identifier, the similarity of the test script content and the script content to be processed is calculated, and the similarity is compared with a preset threshold value; determining that the content of the script to be processed enters a test state or determining that the script to be processed enters a test revetment state according to the comparison result; by automatically comparing the test script content with the script content to be processed in the system, the script comparison efficiency is effectively improved.
The invention will now be described in more detail with reference to the drawings and specific examples, which are not intended to limit the invention thereto.
Drawings
FIG. 1 is a flowchart illustrating a data comparison method according to a first embodiment of the present invention;
FIG. 2 is a flowchart showing steps for extracting test script content and script content to be processed in a data comparison method according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating steps for obtaining script contents to be processed in a data comparison method according to a first embodiment of the present invention;
FIG. 4 is a flowchart illustrating steps for obtaining similarity in a data comparison method according to a first embodiment of the present invention;
FIG. 5 is a flowchart showing steps for obtaining similarity in a data comparison method according to a first embodiment of the present invention;
FIG. 6 is a flowchart illustrating steps of performing a test on script content to be processed in a data comparison method according to a first embodiment of the present invention;
FIG. 7 is a flowchart illustrating steps of performing a test on script content to be processed in a data comparison method according to a first embodiment of the present invention;
FIG. 8 is a schematic diagram illustrating a program module of a data alignment system according to a second embodiment of the present invention;
fig. 9 is a schematic hardware structure of a computer device according to a third embodiment of the invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be noted that the descriptions of "first," "second," etc. in the embodiments of the present invention are for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions of the embodiments may be combined with each other, but it is necessary to base that the technical solutions can be realized by those skilled in the art, and when the technical solutions are contradictory or cannot be realized, the combination of the technical solutions should be considered to be absent and not within the scope of protection claimed in the present invention.
In the description of the present invention, it should be understood that the numerical references before the steps do not identify the order in which the steps are performed, but are merely used to facilitate description of the present invention and to distinguish between each step, and thus should not be construed as limiting the present invention.
Example 1
Referring to fig. 1, a flowchart of the steps of a data comparison method according to an embodiment of the invention is shown. It will be appreciated that the flow charts in the method embodiments are not intended to limit the order in which the steps are performed. The data comparison method is applied to a system constructed according to a Browser/Server (Browser/Server) architecture and through a Django framework, wherein the Django framework is a web application framework. The following description is exemplary with a computer device as an execution subject, and specifically follows:
as shown in fig. 1, the data comparison method may include steps S100 to S104, wherein:
step S100, a script processing request sent by a terminal device is received, wherein the script processing request carries a test script file and a to-be-processed script file, and the script processing request is used for requesting to compare the test script file and the to-be-processed script file.
The script file may be a shell script file. The script file to be processed and the test script file may be script files including script contents that have been developed by a development classmate, for example: the script file of the script content developed for the first time comprises a script file of the script content developed for the first time, which is generated after the code modification is carried out on the script content developed for the first time due to the change of the requirement. In an exemplary embodiment, the test script file and the script file to be processed may be written script text, or may be shell test script pictures.
The operator enters the system through a browser on the terminal equipment to execute the uploading operation of the script files to be processed and the test script files, and the system can store the script files to be processed and the test script files in the system after receiving the uploading operation of the operator on the system.
The system comprises a comparison tool module for realizing interaction with a user, namely, executing comparison operation on the content of the script uploaded by the user. The comparison tool module of the system comprises a first area and a second area, the system receives the script files to be processed and the test script files sent by the terminal equipment, the script files to be processed are displayed in the first area, and the test script files are displayed in the second area. And receiving a script processing request which is sent by the terminal equipment and is generated based on touch operation of a comparison button in the comparison tool module by a user.
Step S102, in response to the script processing request: acquiring a first starting identifier and a first ending identifier of the test script file, and acquiring test script content based on the first starting identifier and the first ending identifier; acquiring a second starting identifier and a second ending identifier of the script file to be processed, acquiring script content to be processed based on the second starting identifier and the second ending identifier, calculating the similarity of the test script content and the script content to be processed, and comparing the similarity with a preset threshold value.
In an exemplary embodiment, the comparison tool module includes a logic processing layer, where the logic processing layer is configured to invoke a shellCompare tool class to compare the test script and the to-be-processed script after acquiring a form submitted by a user (a shell script or a shell script picture submitted by the user). The technical means adopted by the identification of the shell script picture is mainly that two class libraries of Image, pytesseract of python are referenced, and the technical means adopted by the comparison of the shell script picture is mainly that a difflib class library is adopted. The difflib class library has the advantage of packaging the comparison segments between pictures to meet the continuous use of the systemization of the picture recognition technology.
In order to improve the recognition efficiency of the test script file and the script file to be processed, please refer to fig. 2, if the test script file is a test script image, the script file to be processed is a script image to be processed; the obtaining of the test script content and the script content to be processed can be obtained through the following operations: step S200, identifying the test script image to obtain first content, the first starting identifier and the first ending identifier; step S202, identifying the script image to be processed to obtain second content, the second starting identifier and the second ending identifier; step S204, extracting the test script content from the first content based on the first start identifier and the first end identifier; and step S206, extracting the script content to be processed from the second content based on the second start identifier and the second end identifier. When the test script file is a test script image and the script file to be processed is a script image to be processed, the system identifies corresponding shell test script content and shell script content to be processed in the test script image and the script image to be processed through Image, pytesseract two class libraries; and the script file content is rapidly positioned through the start mark and the end mark on the script file, so that the efficiency of acquiring the script file content is effectively improved.
In order to facilitate identifying and acquiring the script content to be processed and the test script content in the system, referring to fig. 3, the acquisition of the test script content and the script content to be processed may be obtained by the following operations, specifically including: step S300, acquiring original test script content based on the first starting identifier and the first ending identifier; step S302, acquiring original script content to be processed based on the second starting identifier and the second ending identifier; step S304, converting the original test script content into a first variable according to a first preset data format; step S306, converting the original script content to be processed into a second variable according to a first preset data format; step S308, converting the first variable into the test script content according to a second preset data format; and step S310, converting the second variable into the script content to be processed according to a second preset data format. The first preset data format is the format of str data type; the second preset data format is a json data type format. When the original test script content and the original script content to be processed are read, the original test script content and the original script content to be processed are temporarily stored in the system in the form of str character strings as variables, and the str character strings are converted to obtain the test script content and the script content to be processed. For example, a first variable corresponding to the original test script content and a second variable corresponding to the original script content to be processed are converted into the corresponding test script content in json format and the script content to be processed in json format by two strings of code command lines of "str= '{" key ":" wygest "," word ":" shellcom "}'," j=json. In this embodiment, the manner of storing the test script content and the script content to be processed can effectively improve the script multiplexing rate and reduce the script maintenance cost.
In order to improve accuracy of the similarity, as shown in fig. 4, the test script content includes a plurality of first script contents, and the script content to be processed includes a plurality of second script contents; the step of calculating the similarity between the test script content and the script content to be processed further comprises the following steps S400-S402, wherein: step S400, calculating the first similarity of each piece of first script content and each piece of second script content; and step S402, weighting and summing the first similarity to obtain the similarity. For example, the similarity may be calculated by a similarity algorithm such as edit distance (edit distance), cosine similarity (cosine similarity), and the like.
In other exemplary embodiments, in order to make the calculation result of the similarity closer to the actual similarity, as shown in fig. 5, the test script content includes a plurality of first script contents, and the script content to be processed includes a plurality of second script contents; the step of calculating the similarity between the test script content and the script content to be processed further comprises the following steps S500-S506, wherein: step S500, a plurality of preset similarity algorithms are obtained; step S502, calculating the first similarity of each piece of first script content and each piece of second script content according to each preset similarity algorithm; step S504, performing a first weighted average on the first similarities corresponding to each piece of first script content to obtain a second similarity corresponding to each piece of first script content; and step S506, weighting and summing a plurality of second similarity degrees to obtain the similarity degree. According to the embodiment of the application, at least two different types of similarity algorithms are adopted to calculate the similarity, and the calculation result corresponding to each algorithm is synthesized to serve as the final similarity, so that the influence on the accuracy of the final result, which is caused by larger error when the similarity is calculated by adopting one similarity algorithm, can be reduced.
And step S104, determining that the content of the script to be processed enters a test state or determining that the script to be processed enters a test revetment state according to the comparison result.
If the comparison result shows that the similarity is larger than the preset threshold value, determining that the script content to be processed enters a test state; and updating the data state of the script file to be processed at the same time to pass the comparison. If the comparison result shows that the similarity is smaller than the preset threshold value, determining that the script content to be processed enters a test reject state; updating the data state of the script file to be processed to be failed in comparison; and returning the comparison result to the terminal equipment for reference by the user.
Referring to fig. 6, after the step of determining that the script content to be processed enters the test state according to the comparison result, the method further includes: step S600, the script content to be processed is sent to a test server, and a test is executed on the script content to be processed to obtain a test result; and step S602, returning the comparison result and the test result to the terminal equipment. And returning the comparison result and the test result after the script content to be processed is executed to a template display layer of the terminal equipment for reference by a user. In other exemplary embodiments, a test report is generated according to the test result, and the test report is sent to the terminal device in the form of a mail.
In order to improve the testing efficiency of the script content to be processed, referring to fig. 7, testing the script content to be processed may also be implemented by the following operations, in which: step S700, the script content to be processed is sent to a workflow task scheduling component; step S702, generating a test scheduling task according to the script content to be processed through the workflow task scheduling component, wherein the test scheduling task carries the script content to be processed; step S704, transmitting the test scheduling task to the test server; and step S706, executing, by the test server, the test scheduling task: and executing the test on the script content to be processed to obtain a test result. Illustratively, according to the comparison result, calling an api (application program interface) corresponding to a dolphin scheduler scheduling component (workflow task scheduling component) through a shellcomputer tool class, transmitting json format script content to be processed to the workflow task scheduling component, generating a test scheduling task according to the json format script content to be processed, and executing the test scheduling task to test the script content to be processed to generate a test result. And generating test record data according to the execution operation of the test scheduling task, and storing the test record data in a local database.
In an exemplary embodiment, the method further includes monitoring an execution duration of the test scheduling task, generating an alarm signal if the execution duration of the test scheduling task is greater than a preset duration threshold, and returning the alarm signal to the terminal device to notify the terminal device that the execution of the script content to be processed fails. Because the execution time of the script task can be set, the time required for verifying the script is greatly reduced, and the working freedom degree is improved, thereby improving the testing efficiency of the testing classmates.
According to the data comparison method provided by the embodiment of the invention, the test script content is obtained based on the first starting identifier and the first ending identifier, the script content to be processed is obtained based on the second starting identifier and the second ending identifier, the similarity of the test script content and the script content to be processed is calculated, and the similarity is compared with a preset threshold value; determining that the content of the script to be processed enters a test state or determining that the script to be processed enters a test revetment state according to the comparison result; by automatically comparing the test script content with the script content to be processed in the system, the script comparison efficiency is effectively improved, and the script test efficiency is further improved. By applying the technical framework, the secondary development of the script is facilitated.
Example two
With continued reference to fig. 8, a schematic diagram of program modules of the data alignment system of the present invention is shown. In this embodiment, the data alignment system 20 may include or be divided into one or more program modules, and one or more program modules are stored in a storage medium and executed by one or more processors to implement the present invention and the above-described data alignment method. Program modules depicted in the embodiments of the present invention are directed to a series of computer program instruction segments capable of performing the specified functions and that are more suitable than the program itself for describing the execution of the data alignment system 20 on a storage medium. The following description will specifically describe functions of each program module of the present embodiment:
a receiving module 800, configured to receive a script processing request sent by a terminal device, where the script processing request carries a test script file and a script file to be processed, and the script processing request is used to request to compare the test script file and the script file to be processed;
a response module 802, configured to process a request in response to the script: acquiring a first starting identifier and a first ending identifier of the test script file, and acquiring test script content based on the first starting identifier and the first ending identifier; acquiring a second starting identifier and a second ending identifier of the script file to be processed, acquiring script content to be processed based on the second starting identifier and the second ending identifier, calculating the similarity of the test script content and the script content to be processed, and comparing the similarity with a preset threshold; a kind of electronic device with high-pressure air-conditioning system
A determining module 804, configured to determine, according to the comparison result, that the content of the script to be processed enters a testing state or that the script to be processed enters a testing reject state.
In an exemplary embodiment, if the test script file is a test script image, the script file to be processed is a script image to be processed; the response module 802 is further configured to: identifying the test script image to obtain first content, the first start identifier and the first termination identifier; identifying the script image to be processed to obtain second content, the second starting identifier and the second ending identifier; extracting the test script content from the first content based on the first start identifier and the first end identifier; and extracting the script content to be processed from the second content based on the second start identifier and the second end identifier.
In an exemplary embodiment, the response module 802 is further configured to: acquiring original test script content based on the first starting identifier and the first ending identifier; acquiring original script content to be processed based on the second starting identifier and the second ending identifier; according to a first preset data format, converting the original test script content into a first variable; according to a first preset data format, converting the original script content to be processed into a second variable; converting the first variable into the test script content according to a second preset data format; and converting the second variable into the script content to be processed according to a second preset data format.
In an exemplary embodiment, the test script content includes a plurality of first script content, and the script content to be processed includes a plurality of second script content; the response module 802 is further configured to: calculating a first similarity of each piece of first script content and each piece of second script content; and weighting and summing the first similarity to obtain the similarity.
In an exemplary embodiment, the response module 802 is further configured to: obtaining a plurality of preset similarity algorithms; according to each preset similarity algorithm, calculating the first similarity of each piece of first script content and each piece of second script content; performing first weighted average on a plurality of first similarities corresponding to each piece of first script content to obtain a second similarity corresponding to each piece of first script content; and weighting and summing the second similarity to obtain the similarity.
In an exemplary embodiment, the determining module 804 is further configured to: the script content to be processed is sent to a test server, and a test is executed on the script content to be processed to obtain a test result; and returning the comparison result and the test result to the terminal equipment.
In an exemplary embodiment, the determining module 804 is further configured to: the script content to be processed is sent to a workflow task scheduling component; generating a test scheduling task according to the script content to be processed through the workflow task scheduling component, wherein the test scheduling task carries the script content to be processed; the test scheduling task is sent to the test server; and executing the test scheduling task through the test server: and executing the test on the script content to be processed to obtain a test result.
Example III
Referring to fig. 9, a hardware architecture diagram of a computer device according to a third embodiment of the invention is shown. In this embodiment, the computer device 2 is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction. The computer device 2 may be a rack server, a blade server, a tower server, or a rack server (including a stand-alone server, or a server cluster made up of multiple servers), or the like. As shown in fig. 9, the computer device 2 includes, but is not limited to, at least a memory 21, a processor 22, a network interface 23, and a data alignment system 20 that are communicatively coupled to each other via a system bus. Wherein:
in this embodiment, the memory 21 includes at least one type of computer-readable storage medium including flash memory, a hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the memory 21 may be an internal storage unit of the computer device 2, such as a hard disk or a memory of the computer device 2. In other embodiments, the memory 21 may also be an external storage device of the computer device 2, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the computer device 2. Of course, the memory 21 may also include both internal storage units of the computer device 2 and external storage devices. In this embodiment, the memory 21 is typically used to store an operating system and various types of application software installed on the computer device 2, such as program codes of the data alignment system 20 of the above embodiment. Further, the memory 21 may be used to temporarily store various types of data that have been output or are to be output.
The processor 22 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 22 is typically used to control the overall operation of the computer device 2. In this embodiment, the processor 22 is configured to execute the program code stored in the memory 21 or process data, for example, execute the data comparison system 20, so as to implement the data comparison method of the above embodiment.
The network interface 23 may comprise a wireless network interface or a wired network interface, which network interface 23 is typically used for establishing a communication connection between the computer apparatus 2 and other electronic devices. For example, the network interface 23 is used to connect the computer device 2 to an external terminal through a network, establish a data transmission channel and a communication connection between the computer device 2 and the external terminal, and the like. The network may be an Intranet (Intranet), the Internet (Internet), a global system for mobile communications (Global System of Mobile communication, GSM), wideband code division multiple access (Wideband Code Division Multiple Access, WCDMA), a 4G network, a 5G network, bluetooth (Bluetooth), wi-Fi, or other wireless or wired network.
It is noted that fig. 9 only shows a computer device 2 having components 20-23, but it is understood that not all of the illustrated components are required to be implemented, and that more or fewer components may alternatively be implemented.
In this embodiment, the data comparison system 20 stored in the memory 21 may be further divided into one or more program modules, which are stored in the memory 21 and executed by one or more processors (the processor 22 in this embodiment) to complete the present invention.
For example, fig. 8 shows a schematic diagram of a program module for implementing the second embodiment of the data alignment system 20, where the data alignment system 20 may be divided into a receiving module 800, a responding module 802, and a determining module 804. Program modules in the present invention are understood to mean a series of computer program instruction segments capable of performing a specified function, more appropriately than a program, describing the execution of the data alignment system 20 in the computer device 2. The specific functions of the program modules 800-804 are described in detail in the second embodiment, and are not described herein.
Example IV
The present embodiment also provides a computer-readable storage medium such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application store, etc., on which a computer program is stored, which when executed by a processor, performs the corresponding functions. The computer readable storage medium of the present embodiment is used to store the data comparison system 20, and when executed by a processor, implements the data comparison method of the above embodiment.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (7)

1. A data comparison method, comprising:
receiving a script processing request sent by a terminal device, wherein the script processing request carries a test script file and a to-be-processed script file, and the script processing request is used for requesting comparison of the test script file and the to-be-processed script file;
responding to the script processing request: acquiring a first starting identifier and a first ending identifier of the test script file, and acquiring test script content based on the first starting identifier and the first ending identifier; acquiring a second starting identifier and a second ending identifier of the script file to be processed, acquiring script content to be processed based on the second starting identifier and the second ending identifier, calculating the similarity of the test script content and the script content to be processed, and comparing the similarity with a preset threshold; a kind of electronic device with high-pressure air-conditioning system
Determining that the content of the script to be processed enters a test state or determining that the script to be processed enters a test revetment state according to the comparison result;
the method comprises the steps that a first starting identifier and a first ending identifier of a test script file are obtained, and test script content is obtained based on the first starting identifier and the first ending identifier; the step of obtaining the second starting identifier and the second ending identifier of the script file to be processed and obtaining the script content to be processed based on the second starting identifier and the second ending identifier comprises the following steps:
acquiring original test script content based on the first starting identifier and the first ending identifier;
acquiring original script content to be processed based on the second starting identifier and the second ending identifier;
according to a first preset data format, converting the original test script content into a first variable;
according to a first preset data format, converting the original script content to be processed into a second variable;
converting the first variable into the test script content according to a second preset data format; a kind of electronic device with high-pressure air-conditioning system
Converting the second variable into the script content to be processed according to a second preset data format;
the test script content comprises a plurality of first script contents, and the script content to be processed comprises a plurality of second script contents; the step of calculating the similarity between the test script content and the script content to be processed further comprises the following steps:
obtaining a plurality of preset similarity algorithms;
according to each preset similarity algorithm, calculating the first similarity of each piece of first script content and each piece of second script content;
performing first weighted average on a plurality of first similarities corresponding to each piece of first script content to obtain a second similarity corresponding to each piece of first script content; a kind of electronic device with high-pressure air-conditioning system
And weighting and summing a plurality of second similarities to obtain the similarity.
2. The data comparison method according to claim 1, wherein if the test script file is a test script image, the script file to be processed is a script image to be processed; the first starting identifier and the first ending identifier of the test script file are obtained, and the test script content is obtained based on the first starting identifier and the first ending identifier; the step of obtaining the second starting identifier and the second ending identifier of the script file to be processed, and obtaining the script content to be processed based on the second starting identifier and the second ending identifier, further comprises the following steps:
identifying the test script image to obtain first content, the first start identifier and the first termination identifier;
identifying the script image to be processed to obtain second content, the second starting identifier and the second ending identifier;
extracting the test script content from the first content based on the first start identifier and the first end identifier; a kind of electronic device with high-pressure air-conditioning system
And extracting the script content to be processed from the second content based on the second starting identifier and the second ending identifier.
3. The method according to claim 1, wherein after the step of determining that the script content to be processed enters a test state according to the comparison result, the method further comprises:
the script content to be processed is sent to a test server, and a test is executed on the script content to be processed to obtain a test result; a kind of electronic device with high-pressure air-conditioning system
And returning the comparison result and the test result to the terminal equipment.
4. A data comparison method according to claim 3, wherein the step of transmitting the script content to be processed to a test server, and performing a test on the script content to be processed to obtain a test result, comprises:
the script content to be processed is sent to a workflow task scheduling component;
generating a test scheduling task according to the script content to be processed through the workflow task scheduling component, wherein the test scheduling task carries the script content to be processed;
the test scheduling task is sent to the test server; a kind of electronic device with high-pressure air-conditioning system
Executing the test scheduling task through the test server: and executing the test on the script content to be processed to obtain a test result.
5. A data alignment system, comprising:
the receiving module is used for receiving a script processing request sent by the terminal equipment, wherein the script processing request carries a test script file and a to-be-processed script file, and the script processing request is used for requesting to compare the test script file and the to-be-processed script file;
a response module, configured to process a request in response to the script: acquiring a first starting identifier and a first ending identifier of the test script file, and acquiring test script content based on the first starting identifier and the first ending identifier; acquiring a second starting identifier and a second ending identifier of the script file to be processed, acquiring script content to be processed based on the second starting identifier and the second ending identifier, calculating the similarity of the test script content and the script content to be processed, and comparing the similarity with a preset threshold; a kind of electronic device with high-pressure air-conditioning system
The determining module is used for determining that the content of the script to be processed enters a test state or determining that the script to be processed enters a test revetment state according to the comparison result;
wherein, the response module is further configured to:
acquiring original test script content based on the first starting identifier and the first ending identifier;
acquiring original script content to be processed based on the second starting identifier and the second ending identifier;
according to a first preset data format, converting the original test script content into a first variable;
according to a first preset data format, converting the original script content to be processed into a second variable;
converting the first variable into the test script content according to a second preset data format; a kind of electronic device with high-pressure air-conditioning system
Converting the second variable into the script content to be processed according to a second preset data format;
the test script content comprises a plurality of first script contents, and the script content to be processed comprises a plurality of second script contents; the response module is further configured to:
obtaining a plurality of preset similarity algorithms;
according to each preset similarity algorithm, calculating the first similarity of each piece of first script content and each piece of second script content;
performing first weighted average on a plurality of first similarities corresponding to each piece of first script content to obtain a second similarity corresponding to each piece of first script content; a kind of electronic device with high-pressure air-conditioning system
And weighting and summing a plurality of second similarities to obtain the similarity.
6. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the data comparison method according to any of claims 1 to 4 when the computer program is executed by the processor.
7. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program executable by at least one processor to cause the at least one processor to perform the steps of the data alignment method according to any of claims 1 to 4.
CN202110733538.3A 2021-06-30 2021-06-30 Data comparison method, system, computer device and computer readable storage medium Active CN113590467B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110733538.3A CN113590467B (en) 2021-06-30 2021-06-30 Data comparison method, system, computer device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110733538.3A CN113590467B (en) 2021-06-30 2021-06-30 Data comparison method, system, computer device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN113590467A CN113590467A (en) 2021-11-02
CN113590467B true CN113590467B (en) 2023-07-21

Family

ID=78245175

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110733538.3A Active CN113590467B (en) 2021-06-30 2021-06-30 Data comparison method, system, computer device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113590467B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106844479A (en) * 2016-12-23 2017-06-13 光锐恒宇(北京)科技有限公司 The compression of file, decompressing method and device
CN109976999A (en) * 2017-12-28 2019-07-05 北京京东尚科信息技术有限公司 The measure and measurement apparatus of test case coverage rate
CN110162510A (en) * 2019-04-26 2019-08-23 平安普惠企业管理有限公司 Transcription comparison method, device, computer equipment and storage medium
CN110221968A (en) * 2019-05-20 2019-09-10 平安普惠企业管理有限公司 Method for testing software and Related product
CN111428079A (en) * 2020-03-23 2020-07-17 广州酷狗计算机科技有限公司 Text content processing method and device, computer equipment and storage medium
CN111597107A (en) * 2020-04-22 2020-08-28 北京字节跳动网络技术有限公司 Information output method and device and electronic equipment
CN112380833A (en) * 2020-11-20 2021-02-19 深圳得理科技有限公司 Similar text searching method and device for sentence-by-sentence comparison
CN112395851A (en) * 2020-11-18 2021-02-23 北京北大英华科技有限公司 Text comparison method and device, computer equipment and readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9069894B2 (en) * 2010-06-18 2015-06-30 Microsoft Technology Licensing, Llc Data collisions in concurrent programs

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106844479A (en) * 2016-12-23 2017-06-13 光锐恒宇(北京)科技有限公司 The compression of file, decompressing method and device
CN109976999A (en) * 2017-12-28 2019-07-05 北京京东尚科信息技术有限公司 The measure and measurement apparatus of test case coverage rate
CN110162510A (en) * 2019-04-26 2019-08-23 平安普惠企业管理有限公司 Transcription comparison method, device, computer equipment and storage medium
CN110221968A (en) * 2019-05-20 2019-09-10 平安普惠企业管理有限公司 Method for testing software and Related product
CN111428079A (en) * 2020-03-23 2020-07-17 广州酷狗计算机科技有限公司 Text content processing method and device, computer equipment and storage medium
CN111597107A (en) * 2020-04-22 2020-08-28 北京字节跳动网络技术有限公司 Information output method and device and electronic equipment
CN112395851A (en) * 2020-11-18 2021-02-23 北京北大英华科技有限公司 Text comparison method and device, computer equipment and readable storage medium
CN112380833A (en) * 2020-11-20 2021-02-19 深圳得理科技有限公司 Similar text searching method and device for sentence-by-sentence comparison

Also Published As

Publication number Publication date
CN113590467A (en) 2021-11-02

Similar Documents

Publication Publication Date Title
CN107870860B (en) Buried point verification system and method
CN108985057B (en) Webshell detection method and related equipment
CN110599354B (en) Online checking method, online checking system, computer device and computer readable storage medium
CN111782492A (en) Page first screen loading duration testing method and device, computer equipment and medium
CN111444775B (en) Face key point correction method and device and computer equipment
CN112039900B (en) Network security risk detection method, system, computer device and storage medium
CN112597020A (en) Interface testing method and device, computer equipment and storage medium
CN112631924A (en) Automatic testing method and device, computer equipment and storage medium
CN110458184B (en) Optical character recognition assistance method, device, computer equipment and storage medium
CN114218110A (en) Account checking test method and device for financial data, computer equipment and storage medium
CN108196975B (en) Data verification method and device based on multiple checksums and storage medium
CN113590467B (en) Data comparison method, system, computer device and computer readable storage medium
CN113434254A (en) Client deployment method, client deployment apparatus, computer device, and storage medium
CN112860662A (en) Data blood relationship establishing method and device, computer equipment and storage medium
CN112433935A (en) Test method, test device, electronic equipment and storage medium
CN114429408B (en) Method, device, equipment and system for checking configuration file of intelligent substation
CN114968822A (en) Interface testing method and device, computer equipment and storage medium
CN113986747A (en) Data generation method and device, electronic equipment and storage medium
CN114637672A (en) Automatic data testing method and device, computer equipment and storage medium
CN114143308A (en) File uploading information processing method and device, computer equipment and storage medium
CN114297735A (en) Data processing method and related device
CN110532186B (en) Method, device, electronic equipment and storage medium for testing by using verification code
CN108415814B (en) Method for automatically recording field change, application server and computer readable storage medium
CN108200060B (en) Single sign-on verification method based on web subsystem, server and storage medium
CN112992151A (en) Speech recognition method, system, device and readable storage medium

Legal Events

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