CN109446100B - Method and device for managing script file of equipment - Google Patents

Method and device for managing script file of equipment Download PDF

Info

Publication number
CN109446100B
CN109446100B CN201811336967.1A CN201811336967A CN109446100B CN 109446100 B CN109446100 B CN 109446100B CN 201811336967 A CN201811336967 A CN 201811336967A CN 109446100 B CN109446100 B CN 109446100B
Authority
CN
China
Prior art keywords
script file
name
rule
symbol
data
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
CN201811336967.1A
Other languages
Chinese (zh)
Other versions
CN109446100A (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.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology 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 Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201811336967.1A priority Critical patent/CN109446100B/en
Publication of CN109446100A publication Critical patent/CN109446100A/en
Application granted granted Critical
Publication of CN109446100B publication Critical patent/CN109446100B/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/3604Software analysis for verifying properties of programs
    • G06F11/3608Software analysis for verifying properties of programs using formal methods, e.g. model checking, abstract interpretation

Landscapes

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

Abstract

The invention discloses a method and a device for managing a script file of equipment. The method comprises the following steps: acquiring a reference writing rule of an attribute value of a script file of equipment, wherein the reference writing rule is a writing rule set for symbols and/or fields according to a cache directory of the script file; after receiving the script file of the equipment, identifying the content of the received script file by using the reference writing rule to obtain the content which does not accord with the rule; and processing the content which does not accord with the rule.

Description

Method and device for managing script file of equipment
Technical Field
The present invention relates to the field of information processing, and in particular, to a method and an apparatus for managing a script file of a device.
Background
With the storage and application of mass data, more and more hardware devices are applied in data centers, and the operation conditions of the hardware devices are inevitably highly valued and necessarily supervised. In the supervision of the devices, the running states of the hardware in the setting, and the use conditions of the hardware need to be detected at regular time, wherein the hardware may be a CPU, a memory, a hard disk, a raid, a network card, and the like. The server management software can capture the information at regular time by running the script file, and further know the running condition of the equipment. However, in a real-world production environment, the types of devices required and manufacturers of the devices are various, the types of the devices can be servers, storage devices, switches, firewalls and the like, and the manufacturers can be Huawei, Zhongxing, Cisco and wave. Since the difference in manufacturer causes the heterogeneity of devices, the difference in function of devices causes the attention of each device to be different, and thus the required script files are different. Each device of each vendor requires a different script file and therefore a large number of script files.
Whether the script is correct or not is judged according to whether the field names in the script files accord with the definition of the field names of the devices of the type, whether the field attributes of the script files are correct or not in the prior art needs manual comparison, and time and energy are needed to debug each time one script file is written.
Disclosure of Invention
In order to solve the technical problem, the invention provides a method and a device for managing a script file of a device, which can reduce the auditing cost of the script file.
In order to achieve the object of the present invention, the present invention provides a method of managing a script file of a device, comprising:
acquiring a reference writing rule of an attribute value of a script file of equipment, wherein the reference writing rule is a writing rule set for symbols and/or fields according to a cache directory of the script file;
after receiving the script file of the equipment, identifying the content of the received script file by using the reference writing rule to obtain the content which does not accord with the rule;
and processing the content which does not accord with the rule.
In an exemplary embodiment, the reference writing rule includes an asset editing rule corresponding to an asset script file and/or a monitor editing rule corresponding to a monitor script file; wherein:
the asset editing rule comprises an asset symbol writing rule and/or an asset field writing rule; wherein:
the asset symbol writing rule comprises at least one of:
the symbol after the hardware name of a piece of data is a "-" symbol;
except that the symbol combination of the last group of data of one piece of data is colon and semicolon, and the symbol combinations of other groups of data of the data are colon and comma;
the asset field writing rule comprises the following steps: the field name, the fields after the "-" and the comma of one piece of data are consistent with the information recorded in the cache directory of the asset script file;
the monitor editing rule comprises a monitor symbol writing rule and/or a monitor field writing rule; wherein:
the monitor symbol writing rule includes at least one of:
the symbol after the hardware name of one piece of data is a symbol;
dividing the symbol combination of the last group of data of one piece of data into colon and semicolon; the symbol combinations of other groups of data after the symbol "@ are both colon and comma in the data;
wherein the monitor field writing rule comprises: the field name of a piece of data, the fields after "@ _ @ and comma are consistent with the information recorded in the cache directory of the monitor script file.
In an exemplary embodiment, before the identifying the content of the received script file by using the reference writing rule and obtaining the content which does not conform to the rule, the method includes:
acquiring name information of the received script file, wherein the name information comprises the type of the script file, and the type of the script file is asset or monitor;
and selecting a reference writing rule matched with the type of the script file according to the type of the script file.
In an exemplary embodiment, the identifying, by using the reference writing rule, the content of the received script file to obtain the content that does not meet the rule includes:
sequentially acquiring the device names of the script files according to the content compiling sequence of the received script files, and judging whether the ith device name is consistent with the ith field of the first-level cache directory in the cache directories of the script files with the types matched with the script files; wherein i is 1,2,3 … …;
acquiring a jth hardware name corresponding to an ith equipment name in the script file, and judging whether the jth hardware name is consistent with a jth field of a second-level cache directory in a cache directory of the script file matched with the type of the script file;
acquiring a parameter name corresponding to a jth hardware name in the script file, and judging that the parameter name corresponding to the jth hardware name is consistent with a field corresponding to a jth field of a second-level cache directory in a cache directory of the script file matched with the type of the script file; wherein j is 1,2,3 … ….
In an exemplary embodiment, the processing the content that does not comply with the rule includes:
acquiring target information corresponding to the reference writing rule of the content which does not accord with the rule;
and correcting the content which does not conform to the rules by utilizing the target information.
In order to achieve the object of the present invention, the present invention provides an apparatus for managing a script file of a device, comprising:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a reference writing rule of an attribute value of a script file of the device, and the reference writing rule is a writing rule set for symbols and/or fields according to a cache directory of the script file;
the identification module is used for identifying the content of the received script file by using the standard compiling rule after receiving the script file of the equipment to obtain the content which does not accord with the rule;
and the processing module is used for processing the content which does not accord with the rule.
In an exemplary embodiment, the reference writing rule obtained by the first obtaining module includes an asset editing rule corresponding to an asset script file and/or a monitor editing rule corresponding to a monitor script file; wherein:
the asset editing rule comprises an asset symbol writing rule and/or an asset field writing rule; wherein:
the asset symbol writing rule comprises at least one of:
the symbol after the hardware name of a piece of data is a "-" symbol;
except that the symbol combination of the last group of data of one piece of data is colon and semicolon, and the symbol combinations of other groups of data of the data are colon and comma;
the asset field writing rule comprises the following steps: the field name, the fields after the "-" and the comma of one piece of data are consistent with the information recorded in the cache directory of the asset script file;
the monitor editing rule comprises a monitor symbol writing rule and/or a monitor field writing rule; wherein:
the monitor symbol writing rule comprises at least one of the following:
the symbol after the hardware name of one piece of data is a symbol;
dividing the symbol combination of the last group of data of one piece of data into colon and semicolon; the symbol combinations of other groups of data after the symbol "@ are both colon and comma in the data;
wherein the monitor field writing rule comprises: the field name of a piece of data, the fields after "@ _ @ and comma are consistent with the information recorded in the cache directory of the monitor script file.
In one exemplary embodiment, the apparatus further comprises:
the second obtaining module is used for obtaining name information of the received script file before identifying the content of the received script file by using the reference writing rule, wherein the name information comprises the type of the script file, and the type of the script file is asset or monitor;
and the selection module is used for selecting a reference writing rule matched with the type of the script file according to the type of the script file.
In one exemplary embodiment, the identification module comprises:
the first matching unit is used for compiling the content of the received script file in sequence, sequentially acquiring the device names of the script file and judging whether the ith device name is consistent with the ith field of the first-level cache directory in the cache directory of the script file matched with the type of the script file; wherein i is 1,2,3 … …;
the second matching unit is used for acquiring a jth hardware name corresponding to the ith equipment name in the script file and judging whether the jth hardware name is consistent with a jth field of a second-level cache directory in a cache directory of the script file matched with the type of the script file;
the third matching unit is used for acquiring a parameter name corresponding to the jth hardware name in the script file and judging that the parameter name corresponding to the jth hardware name is consistent with a field corresponding to the jth field of a second-level cache directory in a cache directory of the script file matched with the type of the script file; wherein j is 1,2,3 … ….
In one exemplary embodiment, the processing module includes:
the acquiring unit is used for acquiring target information corresponding to the content which does not accord with the rules in the reference writing rule;
and the correcting unit is used for correcting the content which does not accord with the rule by utilizing the target information.
The embodiment of the invention obtains the reference writing rule of the attribute value of the script file of the equipment, wherein the reference writing rule is the writing rule set for the symbol and/or the field according to the cache directory of the script file, and after the script file of the equipment is received, the reference writing rule is used for identifying the content of the received script file to obtain the content which does not accord with the rule, and the content which does not accord with the rule is processed to realize the purpose of automatically identifying the content which does not accord with the rule without depending on manual check, thereby reducing the auditing cost of the script file.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the example serve to explain the principles of the invention and not to limit the invention.
FIG. 1 is a flow chart of a method of managing script files for a device provided by the present invention;
fig. 2 is a block diagram of an apparatus for managing a script file of a device according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
The steps illustrated in the flow charts of the figures may be performed in a computer system such as a set of computer-executable instructions. Also, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.
Fig. 1 is a flowchart of a method for managing a script file of a device provided by the present invention. The method shown in fig. 1 comprises:
step 101, obtaining a reference writing rule of an attribute value of a script file of equipment, wherein the reference writing rule is a writing rule set for symbols and/or fields according to a cache directory of the script file;
the cache directory contents of the two scripts are configured as follows: the first level directory is the device name, the second level directory is the hardware name, and the third level is the hardware parameter name.
The writing rule of the characters is set according to the symbol use specification appointed in the script file, and the writing rule of the fields is set according to the cache directory;
step 102, after receiving a script file of the equipment, identifying the content of the received script file by using the reference writing rule to obtain the content which does not accord with the rule;
analyzing characters of the received script file, and comparing contents which do not accord with the rules;
and 103, processing the content which does not accord with the rule.
In this step, the content that does not comply with the rule may be output, or the content may be subjected to correction processing.
The method embodiment of the invention obtains the reference writing rule of the attribute value of the script file of the equipment, wherein the reference writing rule is the writing rule set for the symbol and/or the field according to the cache directory of the script file, and after the script file of the equipment is received, the reference writing rule is utilized to identify the content of the received script file to obtain the content which does not accord with the rule, and the content which does not accord with the rule is processed to realize the purpose of automatically identifying the content which does not accord with the rule without depending on manual check, thereby reducing the auditing cost of the script file.
The method provided by the present invention is further illustrated below:
each device of each manufacturer has two types of script files, and the names of the script files are asset and monitor, wherein asset is mainly used for acquiring information such as the state, manufacturer, model, type and capacity of hardware, and monitor is mainly used for acquiring information such as the temperature, use condition and residual condition of the hardware. Because the attention points of each device are the same, the field names in the script files of the same device of different manufacturers are the same, all the attributes of each device are stored in a cache with a second-level directory, and the field names in the script files and the attribute names of corresponding positions in the cache are in one-to-one correspondence.
At this time, the field names of the script file need to be automatically verified, and illegal field names need to be automatically corrected.
Based on the technical requirements, the technical scheme designed by the inventor comprises a file content checking module, a name recognition module and an illegal field checking and repairing module, and is used for automatically checking the field attributes in the script file.
Firstly, two cache files are prepared, all attribute information of an asset script and a monitor script is stored respectively, and the stored directory structures of the two cache files are configured.
The cache directory contents of the two scripts are configured as follows: the first level directory is the device name, the second level directory is the hardware name, and the third level is the hardware parameter name.
Wherein, the asset cache directory table is shown in table 1:
Figure GDA0003513365550000071
Figure GDA0003513365550000081
table 1, the monitor cache directory table is shown in table 2:
Figure GDA0003513365550000082
Figure GDA0003513365550000091
TABLE 2
The hardware names and the field names stored in tables 1 and 2 are in English in parentheses, and Chinese is used for assisting understanding.
In an exemplary embodiment, the reference writing rule includes an asset editing rule corresponding to an asset script file and/or a monitor editing rule corresponding to a monitor script file; wherein:
the asset editing rule comprises an asset symbol writing rule and/or an asset field writing rule; wherein:
the asset symbol writing rule comprises at least one of:
the symbol after the hardware name of a piece of data is a "-" symbol;
except that the symbol combination of the last group of data of one piece of data is colon and semicolon, and the symbol combinations of other groups of data of the data are colon and comma;
the asset field writing rule comprises the following steps: the field name, the fields after the "-" and the comma of one piece of data are consistent with the information recorded in the cache directory of the asset script file;
the monitor editing rule comprises a monitor symbol writing rule and/or a monitor field writing rule; wherein:
the monitor symbol writing rule comprises at least one of the following:
the symbol after the hardware name of one piece of data is a symbol;
dividing the symbol combination of the last group of data of one piece of data into colon and semicolon; the symbol combinations of other groups of data after the symbol "@ are both colon and comma in the data;
wherein the monitor field writing rule comprises: the field name of a piece of data, the fields after "@ _ @ and comma are consistent with the information recorded in the cache directory of the monitor script file.
By setting the writing rule, the symbols and/or the fields in the script file can be verified, and the auditing cost of the script file is reduced.
In an exemplary embodiment, before the identifying the content of the received script file by using the reference writing rule and obtaining the content which does not conform to the rule, the method includes:
acquiring name information of the received script file, wherein the name information comprises the type of the script file, and the type of the script file is asset or monitor;
and selecting a reference writing rule matched with the type of the script file according to the type of the script file.
In the present exemplary embodiment, the content format of the script file is set, wherein the name of the script file is named as follows:
manufacturer name-device name-asset (or monitor);
for example: inspur-trackserver-asset.
Each type of hardware in the asset script content format can be recorded in the following way:
hardware name-parameter name 1: parameter value 1, parameter name 2: parameter values 2, … … parameter name m: a parameter value m; wherein m is an integer of 1 or more.
CPU-cpuslot:slot,cpufrequency:frequency,cpucore:core,cpustatus:status,cpuvendor:vendor,cputhread:thread;
The monitor script content format may be recorded as follows:
hardware name @ parameter name 1: parameter value 1, parameter name 2: parameter values 2, … … parameter name m: a parameter value n; wherein n is an integer of 1 or more.
CPU=@_@cpuusage:usage,cputemp:temp;
After writing of a script file is completed, whether the script type or the monitor type is identified according to the last word in the file name.
Then, the content checking module is started to judge whether the script conforms to the symbol writing specification of the script, and the following contents can be included:
if the script is the asset script, firstly checking whether the writing mode of the first column meets the preset asset symbol writing rule, wherein the asset symbol writing rule comprises the following steps:
1. whether the symbol after the hardware name is a "-" symbol;
2. dividing the symbol combination of the last group of data into colon and semicolon; the symbol combinations of other groups of data of the piece of data are colons and commas;
if the standard is not met, correcting;
if the script is a monitor script, firstly checking whether the writing mode of the first column meets a preset monitor symbol writing rule, wherein the writing rule comprises the following steps:
1. whether the symbol after the hardware name is a symbol is judged;
2. dividing the symbol combination of the last group of data into colon and semicolon; the symbol combination of other groups of data after the symbol "@ _ @ in the data is colon and comma;
if the standard is not met, the correction is carried out.
Wherein, the punctuation marks are all English punctuation marks.
After completing the recognition of the symbol writing, the name recognition process is started, which may include the following steps:
in an exemplary embodiment, the identifying the content of the received script file by using the reference writing rule to obtain the content which does not conform to the rule includes:
sequentially acquiring the device names of the script files according to the content compiling sequence of the received script files, and judging whether the ith device name is consistent with the ith field of the first-level cache directory in the cache directories of the script files with the types matched with the script files; wherein i is 1,2,3 … …;
acquiring a jth hardware name corresponding to an ith equipment name in the script file, and judging whether the jth hardware name is consistent with a jth field of a second-level cache directory in a cache directory of the script file matched with the type of the script file;
acquiring a parameter name corresponding to a jth hardware name in the script file, and judging that the parameter name corresponding to the jth hardware name is consistent with a field corresponding to a jth field of a second-level cache directory in a cache directory of the script file matched with the type of the script file; wherein j is 1,2,3 … ….
In an exemplary embodiment, the processing the content that does not comply with the rule includes:
acquiring target information corresponding to the content which does not accord with the rules in the reference writing rule;
and correcting the content which does not conform to the rules by utilizing the target information. Finding out the device name in the script file, taking out the device name to find out the corresponding position in the cache file, finding out the first hardware name in the cache file, and taking out all fields in the hardware name.
Entering the illegal field checking and repairing module, and looking up the corresponding line in the script file by the device name just taken out may include:
if the script file is an asset file, comparing the field names which are just taken out with the fields after the "-" and the commas one by one, if the script file is inconsistent with the fields in the cache file, correcting the field names in the script file, and if the field names in the script file are found to be insufficient, recording the hardware names and notifying the manual repair;
if the script file is a monitor file, comparing the field name which is just taken out with the fields after "@ and comma one by one, if the script file is inconsistent with the cache file, correcting the field name in the script file, and if the field name in the script file is found to be insufficient, recording the hardware name and notifying the manual repair.
After the information of one piece of hardware is checked, the name and the field of the hardware are taken down from the cache until all the hardware names in the first-level directory in the cache file are checked.
For example, the device name found in the script file is a trackserver, the device name is fetched to find a corresponding position in the cache file, that is, the first-level directory corresponding to the device name, the first hardware name is found in the cache file, that is, the second-level directory of the device name, the first hardware name may be a CPU, and all fields in the hardware name may be fetched, for example, cplslot, cpufequetc., CPU core, CPU status, CPU vendor, and CPU thread. Entering an illegal field checking and repairing module, searching a corresponding line in the script file by taking the just taken device name (CPU), and comparing the just taken field name with the fields after the "-" and the comma one by one. If the field name in the script file is inconsistent with that in the cache file, the field name in the script file is corrected, and if the field name in the script file is found to be insufficient, a hardware name (CPU) is recorded and the manual repair is notified. And after the information of one piece of hardware is checked, taking the name and the field of the hardware from the cache until all the hardware names in the first-level directory in the cache file are checked.
The invention relates to an automatic checking device for field attributes in a script file, which can automatically check the places which are not standard and correct in the script file and can properly carry out automatic repair, so that the writing of a script can be quickly and accurately finished by automatically checking and repairing the incorrect positions in the script without relying on manual checking.
Fig. 2 is a block diagram of an apparatus for managing a script file of a device according to the present invention. The apparatus shown in fig. 2 comprises:
a first obtaining module 201, configured to obtain a reference writing rule of an attribute value of a script file of a device, where the reference writing rule is a writing rule set for a symbol and/or a field according to a cache directory of the script file;
the identification module 202 is configured to identify, after receiving a script file of a device, contents of the received script file by using the standard writing rule to obtain contents that do not conform to the rule;
and the processing module 203 is used for processing the content which does not conform to the rule.
In an exemplary embodiment, the reference writing rule obtained by the first obtaining module 201 includes an asset editing rule corresponding to an asset script file and/or a monitor editing rule corresponding to a monitor script file; wherein:
the asset editing rule comprises an asset symbol writing rule and/or an asset field writing rule; wherein:
the asset symbol writing rule includes at least one of:
the symbol after the hardware name of a piece of data is a "-" symbol;
except that the symbol combination of the last group of data of one piece of data is colon and semicolon, and the symbol combinations of other groups of data of the data are colon and comma;
the asset field writing rule comprises the following steps: the field name, the fields after the "-" and the comma of one piece of data are consistent with the information recorded in the cache directory of the asset script file;
the monitor editing rule comprises a monitor symbol writing rule and/or a monitor field writing rule; wherein:
the monitor symbol writing rule comprises at least one of the following:
the symbol after the hardware name of one piece of data is a symbol;
dividing the symbol combination of the last group of data of one piece of data into colon and semicolon; the symbol combinations of other groups of data after the symbol "@ are both colon and comma in the data;
wherein the monitor field writing rule comprises: the field name of a piece of data, the fields after "@ _ @ and comma are consistent with the information recorded in the cache directory of the monitor script file.
In one exemplary embodiment, the apparatus further comprises:
the second obtaining module is used for obtaining name information of the received script file before identifying the content of the received script file by using the reference writing rule, wherein the name information comprises the type of the script file, and the type of the script file is asset or monitor;
and the selection module is used for selecting a reference writing rule matched with the type of the script file according to the type of the script file.
In an exemplary embodiment, the identification module 202 includes:
the first matching unit is used for compiling the content of the received script file in sequence, sequentially acquiring the device names of the script file and judging whether the ith device name is consistent with the ith field of the first-level cache directory in the cache directory of the script file matched with the type of the script file; wherein i is 1,2,3 … …;
the second matching unit is used for acquiring a jth hardware name corresponding to the ith equipment name in the script file and judging whether the jth hardware name is consistent with a jth field of a second-level cache directory in a cache directory of the script file matched with the type of the script file;
the third matching unit is used for acquiring a parameter name corresponding to the jth hardware name in the script file and judging that the parameter name corresponding to the jth hardware name is consistent with a field corresponding to the jth field of a second-level cache directory in a cache directory of the script file matched with the type of the script file; wherein j is 1,2,3 … ….
In an exemplary embodiment, the processing module 203 includes:
the acquiring unit is used for acquiring target information corresponding to the content which does not accord with the rules in the reference writing rule;
and the correcting unit is used for correcting the content which does not accord with the rule by utilizing the target information.
The method comprises the steps of obtaining a reference writing rule of an attribute value of a script file of equipment, wherein the reference writing rule is a writing rule set for symbols and/or fields according to a cache directory of the script file, identifying the content of the received script file by using the reference writing rule after receiving the script file of the equipment to obtain the content which does not accord with the rule, processing the content which does not accord with the rule, achieving the purpose of automatically identifying the content which does not accord with the rule, not relying on manual checking any more, and reducing the auditing cost of the script file.
It will be understood by those of ordinary skill in the art that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, or suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.

Claims (8)

1. A method of managing a script file for a device, comprising:
acquiring a reference writing rule of an attribute value of a script file of equipment, wherein the reference writing rule is a writing rule set for symbols and/or fields according to a cache directory of the script file;
after receiving the script file of the equipment, identifying the content of the received script file by using the reference writing rule to obtain the content which does not accord with the rule;
processing the content which does not accord with the rule;
each type of hardware in the asset script content format can be recorded in the following manner:
hardware name-parameter name 1: parameter value 1, parameter name 2: parameter values 2, … … parameter name m: a parameter value m; wherein m is an integer greater than or equal to 1;
the monitor script content format may be recorded as follows:
hardware name @ parameter name 1: parameter value 1, parameter name 2: parameter values 2, … … parameter name m: a parameter value n; wherein n is an integer greater than or equal to 1; the standard compiling rule comprises an asset editing rule corresponding to an asset script file and/or a monitor editing rule corresponding to a monitor script file; wherein:
the asset editing rule comprises an asset symbol writing rule and/or an asset field writing rule; wherein:
the asset symbol writing rule comprises at least one of:
the symbol after the hardware name of a piece of data is a "-" symbol;
except that the symbol combination of the last group of data of one piece of data is colon and semicolon, and the symbol combinations of other groups of data of the data are colon and comma;
the asset field writing rule comprises the following steps: the field name, the fields after the "-" and the comma of one piece of data are consistent with the information recorded in the cache directory of the asset script file;
the monitor editing rule comprises a monitor symbol writing rule and/or a monitor field writing rule; wherein:
the monitor symbol writing rule comprises at least one of the following:
the symbol after the hardware name of one piece of data is a symbol;
dividing the symbol combination of the last group of data of one piece of data into colon and semicolon; the symbol combinations of other groups of data after the symbol "@ are both colon and comma in the data;
wherein the monitor field writing rule comprises: the field name of a piece of data, the fields after "@ _ @ and comma are consistent with the information recorded in the cache directory of the monitor script file.
2. The method according to claim 1, wherein before identifying the content of the received script file using the reference composition rule and obtaining the content that does not conform to the rule, the method comprises:
acquiring name information of the received script file, wherein the name information comprises the type of the script file, and the type of the script file is asset or monitor;
and selecting a reference writing rule matched with the type of the script file according to the type of the script file.
3. The method of claim 1, wherein identifying the content of the received script file using the reference composition rule to obtain content that does not comply with the rule comprises:
sequentially acquiring the device names of the script files according to the content compiling sequence of the received script files, and judging whether the ith device name in the script file is consistent with the ith field of the first-level cache directory in the cache directory of the script file matched with the type of the script file; wherein i is 1,2,3 … …;
acquiring a jth hardware name corresponding to an ith equipment name in the script file, and judging whether the jth hardware name is consistent with a jth field of a second-level cache directory in a cache directory of the script file matched with the type of the script file;
acquiring a parameter name corresponding to a jth hardware name in the script file, and judging that the parameter name corresponding to the jth hardware name is consistent with a field corresponding to a jth field of a second-level cache directory in a cache directory of the script file matched with the type of the script file; wherein j is 1,2,3 … ….
4. The method of claim 1, wherein the processing the content that does not comply with the rules comprises:
acquiring target information corresponding to the reference writing rule of the content which does not accord with the rule;
and correcting the content which does not conform to the rules by utilizing the target information.
5. An apparatus for managing a script file for a device, comprising:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a reference writing rule of an attribute value of a script file of the device, and the reference writing rule is a writing rule set for symbols and/or fields according to a cache directory of the script file;
the identification module is used for identifying the content of the received script file by using the standard compiling rule after receiving the script file of the equipment to obtain the content which does not accord with the rule;
the processing module is used for processing the content which does not accord with the rule;
each type of hardware in the asset script content format can be recorded in the following manner:
hardware name-parameter name 1: parameter value 1, parameter name 2: parameter values 2, … … parameter name m: a parameter value m; wherein m is an integer greater than or equal to 1;
the monitor script content format may be recorded as follows:
hardware name @ parameter name 1: parameter value 1, parameter name 2: parameter values 2, … … parameter name m: a parameter value n; wherein n is an integer greater than or equal to 1;
the reference compiling rule acquired by the first acquiring module comprises an asset compiling rule corresponding to an asset script file and/or a monitor compiling rule corresponding to a monitor script file; wherein:
the asset editing rule comprises an asset symbol writing rule and/or an asset field writing rule; wherein:
the asset symbol writing rule comprises at least one of:
the symbol after the hardware name of a piece of data is a "-" symbol;
except that the symbol combination of the last group of data of one piece of data is colon and semicolon, and the symbol combinations of other groups of data of the data are colon and comma;
the asset field writing rule comprises the following steps: the field name, the fields after the "-" and the comma of one piece of data are consistent with the information recorded in the cache directory of the asset script file;
the monitor editing rule comprises a monitor symbol writing rule and/or a monitor field writing rule; wherein:
the monitor symbol writing rule comprises at least one of the following:
the symbol after the hardware name of one piece of data is a symbol;
dividing the symbol combination of the last group of data of one piece of data into colon and semicolon; the symbol combinations of other groups of data after the symbol "@ are both colon and comma in the data;
wherein the monitor field writing rule comprises: the field name of a piece of data, the fields after "@ _ @ and comma are consistent with the information recorded in the cache directory of the monitor script file.
6. The apparatus of claim 5, further comprising:
the second obtaining module is used for obtaining name information of the received script file before identifying the content of the received script file by using the reference writing rule, wherein the name information comprises the type of the script file, and the type of the script file is asset or monitor;
and the selection module is used for selecting a reference writing rule matched with the type of the script file according to the type of the script file.
7. The apparatus of claim 5, wherein the identification module comprises:
the first matching unit is used for compiling the content of the received script file in sequence, sequentially acquiring the device names of the script file, and judging whether the ith device name in the script file is consistent with the ith field of the first-level cache directory in the cache directory of the script file matched with the type of the script file; wherein i is 1,2,3 … …;
the second matching unit is used for acquiring a jth hardware name corresponding to the ith equipment name in the script file and judging whether the jth hardware name is consistent with a jth field of a second-level cache directory in a cache directory of the script file matched with the type of the script file;
the third matching unit is used for acquiring a parameter name corresponding to the jth hardware name in the script file and judging that the parameter name corresponding to the jth hardware name is consistent with a field corresponding to the jth field of a second-level cache directory in a cache directory of the script file matched with the type of the script file; wherein j is 1,2,3 … ….
8. The apparatus of claim 5, wherein the processing module comprises:
the acquiring unit is used for acquiring target information corresponding to the content which does not accord with the rules in the reference writing rule;
and the correcting unit is used for correcting the content which does not accord with the rule by utilizing the target information.
CN201811336967.1A 2018-11-12 2018-11-12 Method and device for managing script file of equipment Active CN109446100B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811336967.1A CN109446100B (en) 2018-11-12 2018-11-12 Method and device for managing script file of equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811336967.1A CN109446100B (en) 2018-11-12 2018-11-12 Method and device for managing script file of equipment

Publications (2)

Publication Number Publication Date
CN109446100A CN109446100A (en) 2019-03-08
CN109446100B true CN109446100B (en) 2022-06-07

Family

ID=65551161

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811336967.1A Active CN109446100B (en) 2018-11-12 2018-11-12 Method and device for managing script file of equipment

Country Status (1)

Country Link
CN (1) CN109446100B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103425497A (en) * 2013-08-15 2013-12-04 北京华胜天成科技股份有限公司 Network engineering script across-manufacturer conversion method and device
CN104778412A (en) * 2015-05-05 2015-07-15 中国农业银行股份有限公司 Method and system for checking script
CN107844425A (en) * 2017-11-16 2018-03-27 中国银行股份有限公司 A kind of database statement inspection method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2351990A1 (en) * 2001-06-26 2002-12-26 Ibm Canada Limited-Ibm Canada Limitee Rule based engine for validating financial transactions
WO2014115189A1 (en) * 2013-01-28 2014-07-31 Nec Corporation Method and system for transforming specification scripts to program code
CN103853589A (en) * 2014-02-26 2014-06-11 上海爱数软件有限公司 Cross-platform system compiling and building method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103425497A (en) * 2013-08-15 2013-12-04 北京华胜天成科技股份有限公司 Network engineering script across-manufacturer conversion method and device
CN104778412A (en) * 2015-05-05 2015-07-15 中国农业银行股份有限公司 Method and system for checking script
CN107844425A (en) * 2017-11-16 2018-03-27 中国银行股份有限公司 A kind of database statement inspection method and device

Also Published As

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

Similar Documents

Publication Publication Date Title
CN109800258B (en) Data file deployment method, device, computer equipment and storage medium
CN109814524B (en) Vehicle diagnosis method, device and system
CN106547658B (en) Automatic testing method and device
CN106897342B (en) Data verification method and equipment
CN109358898B (en) Information processing method and device, electronic equipment and storage medium
CN107368513B (en) Method and device for updating client database
CN111615688A (en) Assertion verification code binding method and device
CN114185571A (en) Firmware upgrading method and device of CPLD, terminal and readable storage medium
CN109446100B (en) Method and device for managing script file of equipment
US20140181599A1 (en) Task server and method for allocating tasks
CN111722998B (en) Code quality control method, system, equipment and storage medium
CN107678917B (en) Test machine automation management method, device, equipment and storage medium
CN116401229A (en) Database data verification method, device and equipment
CN114416442A (en) Hardware change detection method and device, electronic equipment and readable storage medium
CN111371818B (en) Data request verification method, device and equipment
CN110807148B (en) Equipment identifier filtering method and device, electronic equipment and storage medium
CN109560964B (en) Equipment compliance checking method and device
CN107479910B (en) Document repairing method, system, readable storage medium and computer equipment
CN110737550B (en) Color identification detection method and device for terminal equipment
CN110851323A (en) Data backup method and device and electronic equipment
CN111581933A (en) Method and device for managing forms in webpage
CN110580243A (en) file comparison method and device, electronic equipment and storage medium
CN114154944B (en) Business auditing method, equipment and computer readable storage medium
CN110795297B (en) Electronic equipment testing method and device
CN109885739B (en) Data processing method, system and 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