CN108427580B - Configuration pair naming repetition detection method, storage medium and intelligent device - Google Patents

Configuration pair naming repetition detection method, storage medium and intelligent device Download PDF

Info

Publication number
CN108427580B
CN108427580B CN201810014461.2A CN201810014461A CN108427580B CN 108427580 B CN108427580 B CN 108427580B CN 201810014461 A CN201810014461 A CN 201810014461A CN 108427580 B CN108427580 B CN 108427580B
Authority
CN
China
Prior art keywords
configuration
file
name
xml file
environment
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
CN201810014461.2A
Other languages
Chinese (zh)
Other versions
CN108427580A (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 Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201810014461.2A priority Critical patent/CN108427580B/en
Priority to PCT/CN2018/082831 priority patent/WO2019134297A1/en
Publication of CN108427580A publication Critical patent/CN108427580A/en
Application granted granted Critical
Publication of CN108427580B publication Critical patent/CN108427580B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a detection method, a storage medium and intelligent equipment for configuration pair naming repetition, which comprises the following steps: acquiring an environment file package for repeated detection of a standby name; searching an XML file in the environment file package, wherein the XML file comprises a configuration pair; establishing a thread aiming at the searched XML file, and carrying out repeated naming detection on the configuration pair of the XML file; and displaying the result of the repeated detection of the configuration pair name according to a preset display rule. The invention can avoid more errors in subsequent development and operation caused by the covering operation of the configuration name repeatedly defined when the configuration time is loaded by detecting the problem that the configuration pair is duplicated in advance by the environment file package, thereby improving the development efficiency.

Description

Configuration pair naming repetition detection method, storage medium and intelligent device
Technical Field
The invention relates to the technical field of information processing, in particular to a configuration pair naming repetition detection method, a storage medium and intelligent equipment.
Background
In the Spring framework, XML is used as a markup language of a configuration file to realize mapping between configuration items and specific code implementation, and a configuration pair (configuration name-implementation code) forms a bean. And the configuration name corresponds to the attribute name or id, and the code corresponds to the attribute class. Due to the expansion of the system scale and the amount of code and the alternation of developers, it is difficult for developers and testers to completely grasp all the defined configuration names in the system, and there are cases where the configuration names are repeatedly defined in the subsequent development. In a Spring framework, when configuration time is loaded and loaded, the system automatically covers the bean name defined repeatedly without throwing errors when service is started, configuration pair naming repetition is difficult to find when the system is deployed and started and a daily system test is carried out, product development faults are caused by configuration pair naming repetition, and development efficiency is reduced.
Disclosure of Invention
The embodiment of the invention provides a detection method, a storage medium and intelligent equipment for configuration pair naming repetition, and aims to solve the problems that in the prior art, when configuration pair is started and loaded in a Spring framework, a system automatically covers a repeatedly defined configuration name without throwing errors when service is started, configuration pair naming repetition is difficult to find when the system is deployed and started and a daily system is tested, product development faults are caused by configuration pair naming repetition, and development efficiency is reduced.
A first aspect of an embodiment of the present invention provides a method for detecting duplicate configuration pairs, including:
acquiring an environment file package for repeated detection of a standby name;
searching an XML file in the environment file package, wherein the XML file comprises a configuration pair;
establishing a thread aiming at the searched XML file, and carrying out repeated naming detection on the configuration pair of the XML file;
and displaying the result of the repeated detection of the configuration pair name according to a preset display rule.
A second aspect of an embodiment of the present invention provides an intelligent device, including a memory and a processor, where the memory stores a computer program that is executable on the processor, and the processor implements the following steps when executing the computer program:
acquiring an environment file package for repeated detection of a standby name;
searching an XML file in the environment file package, wherein the XML file comprises a configuration pair;
establishing a thread aiming at the searched XML file, and carrying out repeated naming detection on the configuration pair of the XML file;
and displaying the result of the repeated detection of the configuration pair name according to a preset display rule.
A third aspect of embodiments of the present invention provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of:
acquiring an environment file package for repeated detection of a standby name;
searching an XML file in the environment file package, wherein the XML file comprises a configuration pair;
establishing a thread aiming at the searched XML file, and carrying out repeated naming detection on the configuration pair of the XML file;
and displaying the result of the repeated detection of the configuration pair name according to a preset display rule.
In the embodiment of the invention, the XML file in the environment file package is searched by acquiring the environment file package for standby name duplicate detection, the XML file comprises the configuration pair, a thread is established aiming at the searched XML file, the configuration pair of the XML file is repeatedly named and detected, the result of the configuration pair naming duplicate detection is displayed according to the preset display rule, the problem of the configuration pair duplicate name is found in advance by carrying out the duplicate name detection on the environment file package, and the situation that the configuration pair duplicate name is covered during loading the configuration pair so as to cause more errors in subsequent development and operation is avoided, so that the development efficiency can be improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions 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 it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a flowchart illustrating an implementation of a method for detecting duplicate configuration pairs according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an implementation of steps for obtaining an environment package for duplicate detection of a standby name according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a specific implementation of the step of searching for an XML file in the environment file package according to an embodiment of the present invention;
fig. 4 is a flowchart of a specific implementation of the step of establishing a thread for a found XML file and detecting a duplicate name of a configuration pair of the XML file according to the embodiment of the present invention;
fig. 5 is a flowchart of a specific implementation of the step of comparing configuration names of all configuration pairs in the XML file one by one, and determining whether there is a duplicate configuration name;
FIG. 6 is a flowchart illustrating an implementation of a method for detecting duplicate configuration pair naming that includes providing a new configuration name according to another embodiment of the present invention;
FIG. 7 is a block diagram of a detecting device according to an embodiment of the present invention;
fig. 8 is a schematic diagram of an intelligent device provided in an embodiment of the present invention.
Detailed Description
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.
Fig. 1 shows an implementation flow of a configuration pair naming repetition detection method provided by an embodiment of the present invention, where the method flow includes steps S101 to S104. The specific realization principle of each step is as follows:
s101: and acquiring the environment file package for repeated detection of the standby name.
The environment file package is a compressed package comprising an XML file, and the named repetition refers to the named repetition of a configuration pair in the XML file. The named duplicate detection refers to detecting the naming of the configuration pairs in the XML file of the environment file package.
Specifically, as shown in fig. 2, in the embodiment of the present invention, the step of acquiring the environment package for repeated detection of the standby name includes:
a1: and acquiring the name of the environment file package. In particular, the input may be made by the developer himself.
A2: and searching the storage path of the environment file package corresponding to the environment file package name according to the environment file package name. The storage path of the environment file package comprises a URL path and a local path. Specifically, when a search is performed according to an environment package command input by a developer, the retrieved environment packages are displayed as a list.
A3: and acquiring the environment file package of the repeated detection of the standby name based on the storage path.
Further, the step a3 includes:
a31: the storage path is detected.
A32: and if the storage path is detected to be the URL path, downloading the environment file package according to the URL path, and storing the environment file package to the local. And the developer can preset a downloading existing address so as to download the environment file package to a local specified position according to the URL path.
A33: and if the storage path is detected to be a local path, detecting a selection instruction input by a developer. The selection instruction comprises a drag instruction.
A34: and determining the environment file package for repeated detection of the standby name according to the selection instruction input by the developer.
Illustratively, when the environment file package is downloaded to a local designated position according to the URL path, a drag instruction input by a developer is detected, or when the storage path is detected to be a local path, a drag instruction input by the developer is detected. When the environment file package is detected to be dragged to the designated area, determining the detected environment file package as the environment file package to be named and repeatedly detected.
In the embodiment of the invention, the scheme of the embodiment of the invention is realized by developing a CheckBean toolkit. Specifically, the CheckBean toolkit is mainly developed through Java + node. js, and the front end is written by html + css. Js is a Javascript runtime environment that actually encapsulates the google chrome 8 engine, which is mainly used to create fast, extensible web applications. Js employs event-driven and non-blocking I/O models, making it light and efficient. The CheckBean toolkit is a compact package. After decompression and installation of the CheckBean tool package are completed, the CheckBean tool is operated, the environment file package can be searched on an operation interface according to search keywords such as environment file package names and the like input by developers, and then the environment file package for repeated detection of the standby names is determined according to selection of the developers.
S102: and searching an XML file in the environment file package, wherein the XML file comprises a configuration pair.
Specifically, XML is a syntactic format, and a file can be structured by XML to facilitate parsing by a program. In the Spring framework, XML is adopted as a markup language of a configuration file to realize the mapping of the configuration item and the specific code. In the XML file of the environment file package, at least one configuration pair (bean) is included, and a configuration name (namely the name of the configuration pair) and implementation code form a bean. And the configuration name corresponds to the attribute name or id, and the code corresponds to the attribute class.
As an embodiment of the present invention, as shown in fig. 3, the S102 specifically includes:
b1: and decompressing the environment file packet subjected to the repeated detection of the standby names to acquire a file set. The file set comprises XML files and possibly also comprises sub-file packages and other format files.
B2: and detecting whether the sub-file package exists in the file set. Wherein the sub-file package is a compressed file package.
B3: and if the sub-file package exists in the file set, decompressing the sub-file package to obtain the sub-file set. The sub-file set comprises XML files and/or files in other formats.
B4: and searching an XML file based on the file set and the subfile set.
In the embodiment of the invention, the environment file packet for the standby name repeated detection is decompressed, the XML file is scanned and searched, and whether the sub file packet exists after the decompression is detected again, so that the XML file is prevented from being missed to check, and the accuracy rate of the duplicate name detection is prevented from being influenced.
S103: and establishing a thread aiming at the searched XML file, and carrying out repeated naming detection on the configuration pair of the XML file.
In the embodiment of the invention, the establishing thread detects the XML file in parallel. A thread may be understood as an independently operating process detection unit. And after the environment file packet of the repeated detection of the standby names is decompressed, searching the decompressed XML file. When one XML file is found, a thread is newly established to detect the XML file, and when more than one XML file is found, one thread is established for each XML file to detect, so that a plurality of XML files can be detected simultaneously, and the detection efficiency is improved.
Optionally, the XML files in more than one environment file package are detected simultaneously. In the embodiment of the invention, developers can simultaneously check a plurality of environment file packages and simultaneously perform duplicate name detection. Furthermore, when XML files in more than one environment file package are configured and renamed, a folder is independently established for each environment file package, and detection results of configuration pair naming repeated detection of each environment file package are placed into files to which the environment file packages belong, so that developers can conveniently know bean repeated detection results of each environment file package.
As an embodiment of the present invention, as shown in fig. 4, the step S103 specifically includes:
c1: and analyzing the XML file to obtain the configuration names of all configuration pairs in the XML file.
C2: and comparing the configuration names of all the configuration pairs in the XML file one by one, and judging whether repeated configuration names exist.
C3: if the configuration names are duplicated, the number of the duplicated configuration names is counted, so that developers can clearly know the number of the configuration pairs with the same configuration names.
In the embodiment of the invention, the configuration names of all configuration pairs in the XML file are compared one by one, and whether a repeated configuration name exists is detected. If not, the thread of the XML file is ended. If yes, counting the repeated configuration names and the number of the repeated configuration names.
As an embodiment of the present invention, fig. 5 shows a specific implementation flow of step C2 in the foregoing embodiment, which is provided by the embodiment of the present invention, and is detailed as follows:
c21: and sequentially reading the configuration names of the configuration pairs in the XML file, and writing the configuration pairs with the read configuration names into a read record table. The reading record table is a table which is established in advance and used for storing read configuration pairs.
C22: and comparing the configuration name of the newly read configuration pair with the configuration name of the configuration pair in the read record table. Specifically, the read first configuration pair is stored in a read record table, the read configuration name in the second configuration pair is compared with the configuration name of the configuration pair in the read record table, whether the configuration names are duplicated is detected, and by analogy, the configuration names of the configuration pairs in the XML file are sequentially read, and the configuration names of the configuration pairs in the read record table are compared.
C23: and if the configuration name in the newly read configuration pair is the same as the configuration name in the configuration pair stored in the read record table, writing the configuration pair which is newly read and has the same configuration name in the read record table into a renaming result table. The renaming result table is used for storing configuration pairs with the same configuration name.
In the embodiment of the invention, in order to improve the detection speed and the detection accuracy of the repeated detection of the configuration pair naming, the configuration pairs with read configuration names are sequentially written into a read record table which is established in advance, and then the configuration names of the newly read configuration pairs are sequentially compared with the configuration names of the configuration pairs which are written in the read record table to judge whether renaming exists or not. If so, writing the renamed configuration pairs into a renaming result table for storing the same configuration names, thereby effectively recording the renamed configuration pairs and avoiding missing detection.
Optionally, as an embodiment of the present invention, before the step S103, the method further includes: and carrying out format detection on the searched XML file, judging whether the format of the XML file is legal or not, and discarding the illegal XML file.
In order to improve the efficiency of detecting the repeated naming of the configuration pair, the XML file is subjected to format detection before a thread is established for the searched XML file and the repeated naming detection is carried out on the configuration pair of the XML file. In embodiments of the present invention, an XML file that has the correct syntax is referred to as legal XML. Having the correct syntax is a syntax rule that complies with the Document Type Definition (DTD). Specifically, whether the XML file verified through the DTD is legal XML or not.
S104: and displaying the result of the repeated detection of the configuration pair name according to a preset display rule.
In the embodiment of the present invention, the preset display rule includes a displayed data category, where the data category includes the number of detected XML files, the number of detected configuration pairs, the number of renamed configuration pairs, and the number of XML files in which renamed configuration pairs occur. Further, the ratio of the renamed configuration pairs to the detected total configuration pairs is also displayed. The preset display rules may be customized by a developer,
optionally, as an embodiment of the present invention, when the configuration pair of the rename is written into the rename result table, the step S104 further includes: and converting the renaming result table into a JSON format. JSON (JavaScript Object Notification) is a lightweight data exchange format. It is based on a subset of JavaScript Programming Language, Standard ECMA-2623rd Edition-Decumber 1999. JSON takes a text format that is completely language independent, but also uses conventions similar to the C language family (including C, C + +, C #, Java, JavaScript, Perl, Python, etc.). The data in the JSON format is easy to read and write by people, is easy to analyze and generate by a machine, and effectively improves the network transmission efficiency.
In the embodiment of the invention, an environment file package for standby name duplicate detection is obtained, an XML file in the environment file package is searched, the XML file comprises a configuration pair, a thread is established for the searched XML file, the configuration pair of the XML file is repeatedly named and detected, the XML file is analyzed, the configuration names of all configuration pairs in the XML file are obtained, the configuration names of the configuration pairs in the XML file are sequentially read, the configuration pairs with the read configuration names are written into a read record table, the configuration names in the newly read configuration pairs are compared with the configuration names of the configuration pairs in the read record table, if the configuration names in the newly read configuration pairs are the same as the configuration names in the configuration pairs stored in the read record table, the newly read configuration pairs and the configuration pairs with the same configuration names in the read record table are written into a duplicate name result table, therefore, the configuration pairs in the XML file are accurately read, the number of the configuration pairs with the duplicate names is conveniently and quickly counted, and finally, the result of the repeated detection of the configuration pairs is displayed according to the preset display rule so as to be conveniently checked by developers. By detecting the duplicate name of the environment file package, the problem of duplicate name of the configuration pair is found in advance, and more errors in subsequent development and operation caused by the covering operation of the duplicate defined configuration name during the loading of the configuration pair are avoided, so that the development efficiency can be improved.
Fig. 6 shows, as an embodiment of the present invention, a method for detecting configuration pair naming duplication according to an embodiment of the present invention, where the method includes providing a new configuration name, and is described in detail as follows:
s201: and acquiring the environment file package for repeated detection of the standby name.
S202: and searching an XML file in the environment file package, wherein the XML file comprises a configuration pair.
S203: and establishing a thread aiming at the searched XML file, and carrying out repeated naming detection on the configuration pair of the XML file.
S204: and displaying the result of the repeated detection of the configuration pair name according to a preset display rule.
In this embodiment, the specific steps from step S201 to step S204 refer to step S101 to step S104 in the above embodiment, which is not described herein again.
S205: the implementation code in the configuration pair of named duplicates is obtained. In one configuration pair, the configuration names correspond to the implementation codes one by one, that is, one configuration name corresponds to one set of implementation codes.
S206: and extracting key words in the implementation codes.
In the embodiment of the invention, the characteristics are extracted from the implementation codes by taking words as units. Specifically, the implementation code is divided into character strings taking words as units, the character strings are traversed, and whether the words are in a pre-established word frequency lookup table or not is checked. And if the word is not in the pre-established word frequency lookup table, adding the word frequency of the word in the word frequency lookup table by 1, and if the word is not in the pre-established word frequency lookup table, adding the word to the word frequency lookup table, wherein the word frequency of the word is set to be 1. And after traversing the character string, counting the word frequency of the words in the word frequency lookup table, and selecting the word with the maximum word frequency as the keyword of the implementation code.
S207: and generating a new configuration name of the configuration pair according to the keyword and the configuration name of the configuration pair.
In the embodiment of the invention, the key words extracted from the implementation codes of the configuration pairs are combined with the configuration names of the configuration pairs to generate the new configuration names of the configuration pairs, so that the reference of developers is facilitated, and the configuration pairs with repeated naming are avoided.
Optionally, the generating a new configuration name of the configuration pair according to the keyword and the configuration name of the configuration pair further includes: and arranging and combining the keywords, the configuration names in the configuration pairs and preset special characters to generate new configuration names of the configuration pairs.
In the embodiment of the invention, an environment file package for standby name duplicate detection is taken, XML files in the environment file package are searched, the XML files comprise configuration pairs, threads are established aiming at the searched XML files, the configuration pairs of the XML files are repeatedly named and detected, the result of the configuration pair name duplicate detection is displayed according to a preset display rule, the problem of the configuration pair duplicate is found in advance by carrying out the duplicate name detection on the environment file package, the situation that more errors occur in subsequent development and operation caused by the covering operation of the repeatedly defined configuration names during the loading configuration pair is avoided, the development efficiency is improved, the implementation codes in the named and duplicate configuration pairs are obtained, keywords in the implementation codes are extracted, new configuration names of the configuration pairs are generated according to the keywords and the configuration names in the configuration pairs, the new configuration names are recommended to developers for reference, and the developers are prevented from naming duplicates again, further improving the development efficiency.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Fig. 7 shows a block diagram of a detection apparatus provided in an embodiment of the present application, and for convenience of explanation, only the parts related to the embodiment of the present application are shown.
Referring to fig. 7, the detecting device includes: a file package obtaining unit 71, a file searching unit 72, a configuration pair detecting unit 73, and a result displaying unit 74, wherein:
a package acquisition unit 71 configured to acquire an environment package for repeated detection of a standby name;
a file searching unit 72, configured to search an XML file in the environment file package, where the XML file includes a configuration pair;
a configuration pair detection unit 73, configured to establish a thread for the searched XML file, and perform repeated naming detection on the configuration pair of the XML file;
and a result display unit 74, configured to display a result of the configuration pair name duplicate detection according to a preset display rule.
Optionally, the file searching unit 72 includes:
a file set obtaining module, configured to decompress the environment file package subjected to the repeated detection of the standby names, and obtain a file set;
the sub-file package detection module is used for detecting whether a sub-file package exists in the file set or not;
a subfile combination obtaining module, configured to decompress the subfile package to obtain a subfile set if the subfile package exists in the file set;
and the file searching module is used for searching the XML file based on the file set and the sub-file set.
Optionally, the configuration pair detection unit 73 includes:
the configuration name acquisition module is used for analyzing the XML file and acquiring the configuration names of all configuration pairs in the XML file;
the configuration name comparison module is used for comparing the configuration names of all configuration pairs in the XML file one by one and judging whether repeated configuration names exist or not;
and the number counting module is used for counting the number of the repeated configuration names if the repeated configuration names exist.
Optionally, the configuration name comparing module includes:
the first writing-in submodule is used for sequentially reading the configuration names of the configuration pairs in the XML file and writing the configuration pairs of the read configuration names into a reading record table;
the configuration name comparison submodule is used for comparing the configuration name of the newly read configuration pair with the configuration name of the configuration pair in the read record table;
and the second writing submodule is used for writing the configuration pair which is newly read and has the same configuration name in the read record table into the renaming result table if the configuration name in the configuration pair which is newly read is the same as the configuration name in the configuration pair which is stored in the read record table.
Optionally, the detection apparatus further comprises:
the code acquisition unit is used for acquiring the implementation codes in the configuration pairs with repeated naming;
the keyword extraction unit is used for extracting keywords in the implementation codes;
and the configuration name generating unit is used for generating a new configuration name of the configuration pair according to the keyword and the configuration name in the configuration pair.
In the embodiment of the invention, the XML file in the environment file package is searched by acquiring the environment file package for standby name duplicate detection, the XML file comprises the configuration pair, a thread is established aiming at the searched XML file, the configuration pair of the XML file is repeatedly named and detected, the result of the configuration pair naming duplicate detection is displayed according to the preset display rule, the problem of the configuration pair duplicate name is found in advance by carrying out the duplicate name detection on the environment file package, and the situation that the configuration pair duplicate name is covered during loading the configuration pair so as to cause more errors in subsequent development and operation is avoided, so that the development efficiency can be improved.
Fig. 8 is a schematic diagram of an intelligent device according to an embodiment of the present invention. As shown in fig. 8, the smart device 8 of this embodiment includes: a processor 80, a memory 81 and a computer program 82, such as a traffic prediction program, stored in the memory 81 and operable on the processor 80. The processor 80, when executing the computer program 82, implements the steps in the above-described embodiments of the processing method for configuring a named pair iteration, such as the steps 101 to 104 shown in fig. 1. Alternatively, the processor 80, when executing the computer program 82, implements the functions of the modules/units in the above-described device embodiments, such as the functions of the modules 71 to 74 shown in fig. 7.
Illustratively, the computer program 82 may be partitioned into one or more modules/units that are stored in the memory 81 and executed by the processor 80 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 82 in the smart device 8.
The intelligent device 8 may be a desktop computer, a notebook, a palm computer, a cloud intelligent device, or other computing devices. The intelligent device may include, but is not limited to, a processor 80, a memory 81. Those skilled in the art will appreciate that fig. 8 is merely an example of a smart device 8 and does not constitute a limitation of the smart device 8 and may include more or fewer components than shown, or some components in combination, or different components, for example the smart device may also include input output devices, network access devices, buses, etc.
The Processor 80 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 81 may be an internal storage unit of the intelligent device 8, such as a hard disk or a memory of the intelligent device 8. The memory 81 may also be an external storage device of the Smart device 8, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the Smart device 8. Further, the memory 81 may also include both an internal storage unit and an external storage device of the smart device 8. The memory 81 is used for storing the computer programs and other programs and data required by the smart device. The memory 81 may also be used to temporarily store data that has been output or is to be output.
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 modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
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; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A method for detecting a configuration pair named duplicate, comprising:
acquiring an environment file package name, and searching a storage path of an environment file package corresponding to the environment file package name according to the environment file package name;
obtaining an environment file package for repeated detection of the standby name based on the storage path specifically comprises: detecting the storage path, if the storage path is detected to be a URL path, downloading an environment file package according to the URL path, and storing the environment file package to the local, if the storage path is detected to be a local path, detecting a selection instruction input by a developer, and determining an environment file package for repeated detection of a standby name according to the selection instruction input by the developer;
searching an XML file in the environment file package, wherein the XML file comprises a configuration pair;
establishing a thread aiming at the searched XML file, and carrying out repeated naming detection on the configuration pair of the XML file; specifically, when one XML file is found, a thread is newly established to carry out repeated naming detection on the found XML file, and when more than one XML file is found, a thread is respectively established for each XML file to carry out repeated naming detection; when more than one environment file package is obtained, carrying out repeated naming detection on XML files in the more than one environment file package;
and displaying the result of the repeated detection of the configuration pair name according to a preset display rule.
2. The method of claim 1, wherein the step of searching for the XML file in the environment file package comprises:
decompressing the environment file packet repeatedly detected by the standby name to obtain a file set;
detecting whether a sub-file package exists in the file set;
if the sub-file package exists in the file set, decompressing the sub-file package to obtain a sub-file set;
and searching an XML file based on the file set and the subfile set.
3. The method according to claim 1, wherein the step of establishing a thread for the searched XML file and detecting the duplicate naming of the configuration pair of the XML file comprises:
analyzing the XML file to obtain configuration names of all configuration pairs in the XML file;
comparing the configuration names of all configuration pairs in the XML file one by one, and judging whether repeated configuration names exist or not;
and if the repeated configuration names exist, counting the number of the repeated configuration names.
4. The method according to claim 3, wherein the step of comparing the configuration names of all configuration pairs in the XML file one by one to determine whether there is a duplicate configuration name comprises:
sequentially reading the configuration names of the configuration pairs in the XML file, and writing the configuration pairs with the read configuration names into a read record table;
comparing the configuration name of the newly read configuration pair with the configuration name of the configuration pair in the read record table;
and if the configuration name in the newly read configuration pair is the same as the configuration name in the configuration pair stored in the read record table, writing the configuration pair which is newly read and has the same configuration name in the read record table into a renaming result table.
5. The method according to any one of claims 1 to 4, characterized in that after the step of displaying the results of configuration pair naming repetition detection according to preset display rules, the method comprises:
acquiring implementation codes in a configuration pair with repeated naming;
extracting key words in the implementation codes;
and generating a new configuration name of the configuration pair according to the keyword and the configuration name of the configuration pair.
6. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of configuring a method of handling named repeats as claimed in any one of claims 1 to 5.
7. A smart device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor when executing the computer program implements the steps of:
acquiring an environment file package name, and searching a storage path of an environment file package corresponding to the environment file package name according to the environment file package name;
obtaining an environment file package for repeated detection of the standby name based on the storage path specifically comprises: detecting the storage path, if the storage path is detected to be a URL path, downloading an environment file package according to the URL path, and storing the environment file package to the local, if the storage path is detected to be a local path, detecting a selection instruction input by a developer, and determining an environment file package for repeated detection of a standby name according to the selection instruction input by the developer;
searching an XML file in the environment file package, wherein the XML file comprises a configuration pair;
establishing a thread aiming at the searched XML file, and carrying out repeated naming detection on the configuration pair of the XML file; specifically, when one XML file is found, a thread is newly established to carry out repeated naming detection on the found XML file, and when more than one XML file is found, a thread is respectively established for each XML file to carry out repeated naming detection; when more than one environment file package is obtained, carrying out repeated naming detection on XML files in the more than one environment file package;
and displaying the result of the repeated detection of the configuration pair name according to a preset display rule.
8. The intelligent device of claim 7, wherein when the step of locating the XML file in the environment file package comprises:
decompressing the environment file packet repeatedly detected by the standby name to obtain a file set;
detecting whether a sub-file package exists in the file set;
if the sub-file package exists in the file set, decompressing the sub-file package to obtain a sub-file set;
and searching an XML file based on the file set and the subfile set.
9. The intelligent device according to claim 7, wherein the step of establishing a thread for the searched XML file and detecting the duplicate naming of the configuration pair of the XML file comprises:
analyzing the XML file to obtain configuration names of all configuration pairs in the XML file;
comparing the configuration names of all configuration pairs in the XML file one by one, and judging whether repeated configuration names exist or not;
and if the repeated configuration names exist, counting the number of the repeated configuration names.
10. The smart device of any one of claims 7 to 9, wherein the processor when executing the computer program further performs the steps of:
acquiring implementation codes in a configuration pair with repeated naming;
extracting key words in the implementation codes;
and generating a new configuration name of the configuration pair according to the keyword and the configuration name of the configuration pair.
CN201810014461.2A 2018-01-08 2018-01-08 Configuration pair naming repetition detection method, storage medium and intelligent device Active CN108427580B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810014461.2A CN108427580B (en) 2018-01-08 2018-01-08 Configuration pair naming repetition detection method, storage medium and intelligent device
PCT/CN2018/082831 WO2019134297A1 (en) 2018-01-08 2018-04-12 Method and device for detecting configuration pair naming duplicate, storage medium, and smart device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810014461.2A CN108427580B (en) 2018-01-08 2018-01-08 Configuration pair naming repetition detection method, storage medium and intelligent device

Publications (2)

Publication Number Publication Date
CN108427580A CN108427580A (en) 2018-08-21
CN108427580B true CN108427580B (en) 2020-01-10

Family

ID=63155806

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810014461.2A Active CN108427580B (en) 2018-01-08 2018-01-08 Configuration pair naming repetition detection method, storage medium and intelligent device

Country Status (2)

Country Link
CN (1) CN108427580B (en)
WO (1) WO2019134297A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114237719B (en) * 2020-09-09 2023-11-28 中国联合网络通信集团有限公司 USB flash disk identification method, system, computer equipment and storage medium
WO2022061293A1 (en) 2020-09-21 2022-03-24 VIDAA USA, Inc. Display apparatus and signal transmission method for display apparatus
CN112272320B (en) * 2020-10-20 2022-04-15 Vidaa美国公司 Display device and duplicate name detection method thereof
CN112306508A (en) * 2020-10-13 2021-02-02 武汉木仓科技股份有限公司 Configuration information file updating method and device and processing equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461508A (en) * 2014-11-12 2015-03-25 国云科技股份有限公司 Method for solving problem of duplication of names of functions in JS files
CN106294164A (en) * 2016-08-15 2017-01-04 中国银行股份有限公司 A kind of code check method and device
CN106874442A (en) * 2017-02-08 2017-06-20 三和智控(北京)系统集成有限公司 Named by data name and realize data from the method and device for carrying characteristic information
CN107463683A (en) * 2017-08-09 2017-12-12 上海壹账通金融科技有限公司 The naming method and terminal device of code element

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7500223B2 (en) * 2004-01-02 2009-03-03 International Business Machines Corporation Automatically creating JavaScript objects to invoke methods on server-side Java beans
GB2459681B (en) * 2008-04-30 2012-04-25 Vmware Inc a computer system and a method of deploying an application in a computer system
CN105446874B (en) * 2014-09-25 2019-03-15 北京畅游天下网络技术有限公司 A kind of detection method and device of resource distribution file
CN105045598A (en) * 2015-08-07 2015-11-11 北京思特奇信息技术股份有限公司 Java-based web front-end performance optimization and online method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461508A (en) * 2014-11-12 2015-03-25 国云科技股份有限公司 Method for solving problem of duplication of names of functions in JS files
CN106294164A (en) * 2016-08-15 2017-01-04 中国银行股份有限公司 A kind of code check method and device
CN106874442A (en) * 2017-02-08 2017-06-20 三和智控(北京)系统集成有限公司 Named by data name and realize data from the method and device for carrying characteristic information
CN107463683A (en) * 2017-08-09 2017-12-12 上海壹账通金融科技有限公司 The naming method and terminal device of code element

Also Published As

Publication number Publication date
CN108427580A (en) 2018-08-21
WO2019134297A1 (en) 2019-07-11

Similar Documents

Publication Publication Date Title
CN108427580B (en) Configuration pair naming repetition detection method, storage medium and intelligent device
CN108628751B (en) Useless dependency item detection method and device
US9152731B2 (en) Detecting a broken point in a web application automatic test case
NL2029881B1 (en) Methods and apparatus for automatic detection of software bugs
CN110688307B (en) JavaScript code detection method, device, equipment and storage medium
CN111176717B (en) Method and device for generating installation package and electronic equipment
US20160321218A1 (en) System and method for transforming image information for a target system interface
KR20190031030A (en) Method and system for identifying an open source software package based on binary files
KR20230130089A (en) System and method for selection and discovery of vulnerable software packages
CN111078276B (en) Application redundant resource processing method, device, equipment and storage medium
CN112181924A (en) File conversion method, device, equipment and medium
US11422917B2 (en) Deriving software application dependency trees for white-box testing
US11681541B2 (en) Methods, apparatus, and articles of manufacture to generate usage dependent code embeddings
CN113901169A (en) Information processing method, information processing device, electronic equipment and storage medium
CN110674033B (en) Method, device, equipment and storage medium for processing code
US9679092B1 (en) Constraint handling for parameterizable hardware description language
CN109582347B (en) Method and device for acquiring front-end codes
CN111240987A (en) Migration program detection method and device, electronic equipment and computer readable storage medium
CN111736848B (en) Packet conflict positioning method, device, electronic equipment and readable storage medium
CN114816816A (en) Collapse stack information processing method, device, equipment and storage medium
Le Zou et al. On synchronizing with web service evolution
CN114611500A (en) Expression processing method and device, electronic equipment and computer readable storage medium
CN112464636A (en) Constraint file comparison method and device, electronic equipment and storage medium
CN113408250B (en) Project file processing method and device
CN115314413B (en) CAN signal testing method and device

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