CN108491324B - Target vocabulary searching method and device in software - Google Patents

Target vocabulary searching method and device in software Download PDF

Info

Publication number
CN108491324B
CN108491324B CN201810201271.1A CN201810201271A CN108491324B CN 108491324 B CN108491324 B CN 108491324B CN 201810201271 A CN201810201271 A CN 201810201271A CN 108491324 B CN108491324 B CN 108491324B
Authority
CN
China
Prior art keywords
code
software
file
codes
target vocabulary
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
CN201810201271.1A
Other languages
Chinese (zh)
Other versions
CN108491324A (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.)
Vtron Group Co Ltd
Original Assignee
Vtron Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vtron Group Co Ltd filed Critical Vtron Group Co Ltd
Priority to CN201810201271.1A priority Critical patent/CN108491324B/en
Publication of CN108491324A publication Critical patent/CN108491324A/en
Application granted granted Critical
Publication of CN108491324B publication Critical patent/CN108491324B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a method and a device for searching target vocabularies in software, wherein the method comprises the following steps: acquiring target words and file information of each file of software to be searched; converting the character strings of the target vocabulary into a first code of a preset system, and converting the character strings of all file information into a second code of the preset system; and traversing the second code, and outputting the file information corresponding to the coincident sub-codes after judging that the sub-codes coincident with the first code exist in the second code. According to the invention, the target vocabulary and the file information of all files of the software to be searched are converted into the codes of the unified preset system, and then whether the codes of the target vocabulary exist in the codes corresponding to the files is judged, so that whether the target vocabulary exists in all the files of the software to be searched can be automatically traversed, the position of the target vocabulary in the software to be searched can be accurately and quickly determined, the test time can be greatly reduced in the software test process, the coverage rate of the test range is up to 100%, and the method is accurate and efficient.

Description

Target vocabulary searching method and device in software
Technical Field
The invention relates to the field of software testing, in particular to a method and a device for searching target vocabularies in software.
Background
During the development of software, programs, configuration files, file names containing words and characters (hereinafter, referred to as forbidden words or sensitive words) which are not suitable or can not exist may appear. If open source codes are used, forbidden words are contained; the software copyright ownership is changed, and the updating is incomplete to cause that forbidden words are contained; in the development process, the software contains forbidden words due to errors of developers.
In the prior art, file searching of an operating system is generally used for checking a folder and a file name containing forbidden words, and manual test checking is performed by opening software one by one to install related files. The existing method has the defects that the scale of the software product is small, and the forbidden words are only few, but once the scale of the software product is large, the forbidden words are more, and the design range is wide, the test range is too large, the test time is extremely consumed, and the test accuracy of the forbidden words and the quality of the software product are difficult to ensure.
Disclosure of Invention
The embodiment of the invention provides a method and a device for searching target words in software, which can realize the quick and accurate retrieval of the target words and paths thereof in the software and greatly improve the software testing efficiency.
According to one aspect of the invention, a method for searching a target vocabulary in software is provided, which comprises the following steps:
acquiring target words and file information of each file of software to be searched;
converting the character strings of the target vocabulary into a first code of a preset system, and converting the character strings of all the file information into a second code of the preset system;
traversing the second code, and outputting the file information corresponding to the coincident sub-codes after judging that the sub-codes coincident with the first code exist in the second code.
Preferably, the file information includes an installation path of the file and contents of the file.
Preferably, the coincident sub-codes are specifically located in a code corresponding to the installation path of the file and/or a code corresponding to the content of the file.
According to another aspect of the present invention, there is provided a target vocabulary searching apparatus in software, comprising:
the acquisition module is used for acquiring target vocabularies and file information of each file of the software to be searched;
the conversion module is used for converting the character strings of the target vocabulary into a first code of a preset system, and converting the character strings of all the file information into a second code of the preset system;
and the judging module is used for traversing the second code and outputting the file information corresponding to the superposed sub-codes after judging that the sub-codes superposed with the first code exist in the second code.
Preferably, the file information includes an installation path of the file and contents of the file.
Preferably, the coincident sub-codes are specifically located in a code corresponding to the installation path of the file and/or a code corresponding to the content of the file.
According to another aspect of the present invention, there is provided a target vocabulary searching apparatus in software, comprising: a memory, and a processor coupled to the memory;
the processor is configured to execute the target vocabulary searching method in software as described above based on instructions stored in the memory device.
According to another aspect of the present invention, there is provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements the target vocabulary searching method in software as described above.
According to the technical scheme, the embodiment of the invention has the following advantages:
the invention provides a method and a device for searching target vocabularies in software, wherein the method comprises the following steps: acquiring target words and file information of each file of software to be searched; converting the character strings of the target vocabulary into a first code of a preset system, and converting the character strings of all file information into a second code of the preset system; and traversing the second code, and outputting the file information corresponding to the coincident sub-codes after judging that the sub-codes coincident with the first code exist in the second code. According to the invention, the target vocabulary and the file information of all files of the software to be searched are converted into the codes of the unified preset system, and then whether the codes of the target vocabulary exist in the codes corresponding to the files is judged, so that whether the target vocabulary exists in all the files of the software to be searched can be automatically traversed, the position of the target vocabulary in the software to be searched can be accurately and quickly determined, the test time can be greatly reduced in the software test process, the coverage rate of the test range is up to 100%, and the method is accurate and efficient.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
FIG. 1 is a flowchart illustrating a method for searching a target vocabulary in software according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram illustrating an embodiment of an apparatus for searching a target vocabulary in software according to the present invention;
FIG. 3 is a schematic diagram of a stop word notepad;
FIG. 4 is a path list diagram of a software installation path;
fig. 5 is a schematic diagram of a partial screenshot of a retrieval result.
Detailed Description
The embodiment of the invention provides a method and a device for searching target words in software, which can realize the quick and accurate retrieval of the target words and paths thereof in the software and greatly improve the software testing efficiency.
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, an embodiment of a method for searching a target vocabulary in software according to the present invention includes:
101. acquiring target words and file information of each file of software to be searched;
in this embodiment, the target vocabulary may be a forbidden word or a sensitive word, or may be a word of other types, which may be specifically adjusted according to the requirement of a software tester, and is not limited herein.
Optionally, the file information in this embodiment may be an installation path of the file and content of the file. Before searching the target vocabulary of the software to be searched, generating a path list of the installation path of each file of the software and storing the path list so as to perform format conversion uniformly and subsequently.
102. Converting the character strings of the target vocabulary into a first code of a preset system, and converting the character strings of all file information into a second code of the preset system;
in order to perform fast search, the present invention converts the character string of the target vocabulary into a preset first code, it should be noted that the preset binary system may be a binary system or a hexadecimal system, and the preset binary system may be specifically set according to the need, which is not specifically limited herein.
And then, uniformly converting the file information of all files in the software into the second code of the preset system, wherein the conversion of the file information not only converts the installation path of the file, but also converts the content contained in the file. Due to the fact that the formats of the first code and the second code are consistent, the subsequent searching can be more accurate and faster.
103. And traversing the second code, and outputting the file information corresponding to the coincident sub-codes after judging that the sub-codes coincident with the first code exist in the second code.
And traversing the second code after the first code and the second code are obtained, namely traversing file information of all files of the software to be searched, and outputting the file information corresponding to the sub-code when the sub-code which is coincident with the first code exists in the second code.
It should be noted that, in this embodiment, when there are overlapping sub-codes, there may be three cases, the first is that the overlapping sub-code is only located in the code corresponding to the installation path of the file, the second is that the overlapping sub-code is only located in the code corresponding to the content of the file, and the third is that the overlapping sub-code is located not only in the code corresponding to the installation path of the file but also in the code corresponding to the content of the file. It should be noted that the output file information includes the installation path of the file and the portion where the file content overlaps the target vocabulary.
The target vocabulary searching method in software provided by the invention is explained in more detail in a specific application scene, wherein the target vocabulary in the scene is forbidden words, the software to be searched is an OneVision software platform, and the preset system is a 16 system.
The scene comprises the following steps:
the first step is as follows: test prohibited words (weichung, haikang, hikvision) were recorded in keyword. As shown in fig. 3.
The second step is that: and installing an OneVision software platform, finding an installation path, generating a path list of the software installation path and storing the path list, as shown in FIG. 4.
The third step: converting the forbidden words in the txt document into 16-system by algorithm (Weichu-cd fe b4 b 4; Haikang-ba a3 bf b 5; hikvision-68696 b 766973696 f 6e)
The fourth step: and converting the character string of the generated OneVision installation directory path list into a 16-system, traversing search forbidden words (Wignet), and recording information such as paths when the 16-system codes of the searched list are overlapped with the 16-system codes of the forbidden words. For example, a row in the path list is searched for C: \ Program Files (x86) \ VTRON \ OneVision Server \ FMServer \ ifm \ Wicko (… … 65725C 464 d 5365727665725C 69635 d 5C cd fe b4 b4) encoding coincidence. Recording related information of the path C: \ Program Files (x86) \ VTRON \ OneVision Server \ FMServer \ if \ Wigner and the like
The fifth step: and converting the character string contained in each corresponding file in the generated OneVision installation directory path list into a 16-system file, traversing and searching forbidden words, and recording information such as paths and the like when the 16-system code is searched to be overlapped with the 16-system code of the forbidden words. For example, the encoding superposition of the character strings (… … f 7200 d 0a 352 e C1 aa cf b5 cd fe b4 b4 ca db ba f 320 … …) in the apinfo file in the path of C: \ Program Files (x86) \ VTRON \ OneVision Tools \ FMClient \ ifm warnhan is searched, and the related information of the path C: \ Program Files (x86) \\ \ VTRON \ OneVision Tos \ FMClient \ ifm warnhandapinfo and the like is recorded.
And a sixth step: after the traversal search in the fourth and fifth steps is finished, other forbidden words (Haikang and hikvision) are searched one by one, namely, the fourth and fifth steps are repeatedly executed.
The seventh step: and recording the superposition related information in excel tables one by one, and automatically generating xls. The screenshot of the automatic traversal search result part is shown in fig. 5.
The above is a detailed description of the method for searching for a target vocabulary in software according to the present invention, and an embodiment of the apparatus for searching for a target vocabulary in software according to the present invention is described below with reference to fig. 2, where the embodiment includes:
an obtaining module 201, configured to obtain a target vocabulary and file information of each file of software to be searched;
the conversion module 202 is configured to convert a character string of a target vocabulary into a first code of a preset scale, and convert character strings of all file information into a second code of the preset scale;
and the judging module 203 is configured to traverse the second code, and output file information corresponding to the coincident sub-code after judging that the sub-code coincident with the first code exists in the second code.
Further, the file information includes an installation path of the file and contents of the file.
Furthermore, the coincident sub-codes are specifically located in the code corresponding to the installation path of the file and/or the code corresponding to the content of the file.
Another embodiment of the present invention provides a device for searching a target vocabulary in software, comprising: a memory, and a processor coupled to the memory;
the processor is configured to execute the target vocabulary searching method in software as above based on instructions stored in the memory device.
The present invention also relates to a computer-readable medium on which a computer program is stored, characterized in that the program, when executed by a processor, implements the above target vocabulary searching method in software.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (4)

1. A method for searching a target vocabulary in software, comprising:
acquiring target words and file information of each file of software to be searched;
converting the character strings of the target vocabulary into a first code of a preset system, and converting the character strings of all the file information into a second code of the preset system; the preset scale is hexadecimal;
traversing the second code, and outputting the file information corresponding to the coincident sub-codes after judging that the sub-codes coincident with the first code exist in the second code;
the file information comprises an installation path of the file and the content of the file;
the superposed sub-codes are specifically located in codes corresponding to the installation paths of the files and/or codes corresponding to the contents of the files;
the method for acquiring the target vocabulary and the file information of each file to be searched comprises the following steps:
and generating a path list of the installation path of each file of the software to be searched and storing the path list.
2. An apparatus for searching a target vocabulary in software, comprising:
the acquisition module is used for acquiring target vocabularies and file information of each file of the software to be searched;
the storage module is used for generating a path list from the installation path of each file of the software to be searched and storing the path list;
the conversion module is used for converting the character strings of the target vocabulary into a first code of a preset system, and converting the character strings of all the file information into a second code of the preset system; the preset scale is hexadecimal;
the judging module is used for traversing the second code and outputting the file information corresponding to the superposed sub-codes after judging that the sub-codes superposed with the first code exist in the second code;
the file information comprises an installation path of the file and the content of the file;
the coincident sub-codes are specifically located in a code corresponding to the installation path of the file and/or a code corresponding to the content of the file.
3. An apparatus for searching a target vocabulary in software, comprising: a memory, and a processor coupled to the memory;
the processor is configured to perform the target vocabulary searching method in software of claim 1 based on instructions stored in the memory device.
4. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out a target vocabulary searching method in software according to claim 1.
CN201810201271.1A 2018-03-12 2018-03-12 Target vocabulary searching method and device in software Active CN108491324B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810201271.1A CN108491324B (en) 2018-03-12 2018-03-12 Target vocabulary searching method and device in software

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810201271.1A CN108491324B (en) 2018-03-12 2018-03-12 Target vocabulary searching method and device in software

Publications (2)

Publication Number Publication Date
CN108491324A CN108491324A (en) 2018-09-04
CN108491324B true CN108491324B (en) 2022-03-22

Family

ID=63338907

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810201271.1A Active CN108491324B (en) 2018-03-12 2018-03-12 Target vocabulary searching method and device in software

Country Status (1)

Country Link
CN (1) CN108491324B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109657109A (en) * 2018-11-23 2019-04-19 山东中创软件商用中间件股份有限公司 Specified word lookup method, device, equipment and storage medium in a kind of document

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1363069A (en) * 1999-05-20 2002-08-07 伊夫色什有限公司 Information management, retrieval and display system and associated method
CN102081638A (en) * 2010-01-29 2011-06-01 蓝盾信息安全技术股份有限公司 Method and device for matching keywords
CN104699688A (en) * 2013-12-04 2015-06-10 杭州鹰湾科技有限公司 File searching method and electronic device
CN105404615A (en) * 2015-11-05 2016-03-16 腾讯科技(深圳)有限公司 Word retrieval method and apparatus
CN106407450A (en) * 2016-09-30 2017-02-15 网易(杭州)网络有限公司 File searching method and apparatus
CN106599041A (en) * 2016-11-07 2017-04-26 中国电子科技集团公司第三十二研究所 Text processing and retrieval system based on big data platform
CN107145538A (en) * 2017-04-21 2017-09-08 网易(杭州)网络有限公司 List data querying method, device and system
CN109002423A (en) * 2017-06-06 2018-12-14 北大方正集团有限公司 text search method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6721299B1 (en) * 1999-03-15 2004-04-13 Lg Information & Communications, Ltd. Pilot signals for synchronization and/or channel estimation
CN104216894B (en) * 2013-05-31 2017-07-14 国际商业机器公司 Method and system for data query
US10235400B2 (en) * 2015-05-15 2019-03-19 Xactly Corporation Database keying with encoded filter attributes
CN107633062B (en) * 2017-09-20 2020-05-15 广州四三九九信息科技有限公司 Sensitive word searching method and device and electronic equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1363069A (en) * 1999-05-20 2002-08-07 伊夫色什有限公司 Information management, retrieval and display system and associated method
CN102081638A (en) * 2010-01-29 2011-06-01 蓝盾信息安全技术股份有限公司 Method and device for matching keywords
CN104699688A (en) * 2013-12-04 2015-06-10 杭州鹰湾科技有限公司 File searching method and electronic device
CN105404615A (en) * 2015-11-05 2016-03-16 腾讯科技(深圳)有限公司 Word retrieval method and apparatus
CN106407450A (en) * 2016-09-30 2017-02-15 网易(杭州)网络有限公司 File searching method and apparatus
CN106599041A (en) * 2016-11-07 2017-04-26 中国电子科技集团公司第三十二研究所 Text processing and retrieval system based on big data platform
CN107145538A (en) * 2017-04-21 2017-09-08 网易(杭州)网络有限公司 List data querying method, device and system
CN109002423A (en) * 2017-06-06 2018-12-14 北大方正集团有限公司 text search method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
嵌入式环境下全文搜索系统的设计与实现;王鹏;《计算机工程与设计 嵌入式系统工程》;20110808;1288-1291 *

Also Published As

Publication number Publication date
CN108491324A (en) 2018-09-04

Similar Documents

Publication Publication Date Title
CN110109681B (en) Method and system for converting codes between different platforms
CN109471634B (en) Method and device for checking source code format
US7680668B2 (en) Method for generating a language-independent regression test script
CN106844476A (en) A kind of method and apparatus for recognizing file format and correspondence integrality
CN110019067A (en) A kind of log analysis method and system
CN108491324B (en) Target vocabulary searching method and device in software
CN113868698A (en) File desensitization method and equipment
JP2007206069A (en) Method and device for formatting data automatically based on best matched test result type
CN112181812A (en) Version testing method and device
CN111638991A (en) Method and system for analyzing crash file
CN108828427B (en) Criterion searching method, device, equipment and storage medium for signal integrity test
CN110147313A (en) A kind of log-output method and device
CN115687380A (en) Method and device for storing product information
CN114817047A (en) Compiler test method, case generation method and device and instruction storage structure
CN114840400A (en) Abnormal component identification method, device, equipment, storage medium and program product
CN114330278A (en) Method and equipment for judging consistency of returned data
CN110245333B (en) Font type detection method and device, electronic equipment and storage medium
CN114816816A (en) Collapse stack information processing method, device, equipment and storage medium
CN111078540B (en) QT-development-based universal aviation flight service software memory anomaly detection and positioning method
CN111338956A (en) Automatic pressure measurement method, device, equipment and storage medium
CN113408250B (en) Project file processing method and device
CN109446022B (en) Method and device for detecting abnormal overflow page of database and storage medium
CN116048615B (en) Distributed program slicing method, device and equipment based on natural language processing
CN112905169B (en) Method and device for automatically positioning naming space reference problem
CN110716746B (en) Method and device for converting RN style code into applet style code

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