Summary of the invention
The technical problem to be solved by the present invention is to:In view of the problems of the existing technology, a kind of cache server is provided
Database resource method for detecting availability and device.The device IP inputted according to user, database IP and remotely connects mysql
The user name of database, password, Telnet QCache database.By cache resources data, resource place is extracted
Issuing path, recycle issuing path access accesses to it.According to access return value, the availability of the resource is confirmed.
Path where the resource for returning to wrong HTTP code is then included in specific file.
The technical solution adopted by the present invention is as follows:
A kind of cache server database resource method for detecting availability includes:
Step 1:User completes subscriber authentication by user log-in block, if authentication passes through, user is logged in
Product database is cached, step 2 is executed;Otherwise, return step 1;
Step 2:The storage device IP of resource, magnetic disc ID resource in caching product database are extracted by data extraction module
HASH value and resource name;And be combined the storage device IP of resource, magnetic disc ID, resource HASH value and resource name, it obtains
To the issuing path of resource;And resource issuing path is written in file, execute step 3;
Step 3:Data access module accesses resource issuing path, according to its HTTP return value, confirms the available of the resource
Property;Meanwhile there will be issuing path where the resource for returning to wrong HTTP code to carry out local be saved in
Further, the user is by the detailed process that user log-in block carries out authentication:
Step 11:User inputs IP, CDC data center of DCM the equipment management subsystem by user log-in block
In system IP, long-range connecting pin slogan, user name, user password, DCM the equipment management subsystem database name and CDC data
Center system data library name;
Step 12:User log-in block is by above-mentioned parameter and DCM the equipment management subsystem and CDC data center management subsystem
System related setting parameter compares, and parameter completely corresponding, then authentication passes through;Otherwise, authentication fails;If identity
It is verified, then user logs in caching product database, executes step 2;Otherwise, return step 1;
Further, storage device IP, the magnetic that resource in caching product database is extracted by data extraction module
Disk ID, resource HASH value and resource name detailed process are:
Step 21:By the storing data library table in CDC data center subsystem database, one of resource is extracted
HASH value and inquire obtain the resource name of the resource;
Step 22:The resource HASH value according to obtained in step 21 inquires storing data library table, obtains its corresponding magnetic
Disk ID;
Step 23:According to magnetic disc ID obtained in step 22, the disk list number in DCM the equipment management subsystem is inquired
According to library table, its corresponding storage device id is obtained;
Step 24:According to storage device id obtained in step 23, the equipment column in DCM the equipment management subsystem are inquired
Table database table obtains its corresponding storage device IP;
Step 25:Above step is repeated, until all resource HASH values in database table are all extracted completion, is obtained
Store device IP, magnetic disc ID, resource HASH value and resource name;
Wherein the establishment process of tables of data is:CDC data center subsystem establishes CDC number by mysql database software
According to the database of center subsystem, then corresponding storing data library table is successively established, there is one to deposit in CDC data center subsystem
Store up database table;Similarly DCM the equipment management subsystem establishes the number of DCM the equipment management subsystem by mysql database software
According to library, then corresponding list of devices database table and disk list database table are successively established, had in DCM the equipment management subsystem
One list of devices database table and disk list database table.
Further, one storage device IP corresponds to multiple magnetic disc IDs;One magnetic disc ID corresponds to multiple HASH values, and one
The corresponding resource name of a resource HASH value.
Further, the data extraction module is by the storage device IP of resource, magnetic disc ID, resource HASH value and resource
Name is combined, and the combination for obtaining the issuing path of resource is as follows:
http://<Store device IP>/<Magnetic disc ID>/<Resource HASH value>/<Resource name>。
A kind of cache server database resource availability detection device includes:
User log-in block, for carrying out subscriber authentication;If subscriber authentication passes through, user logs in caching and produces
Product database carries out data processing by data extraction module;
Data extraction module, for extracting storage device IP, the magnetic disc ID resource HASH of resource in caching product database
Value and resource name;And be combined the storage device IP of resource, magnetic disc ID resource HASH value and resource name, obtain resource
Issuing path;And resource issuing path is written in file;
Data access module, according to its HTTP return value, confirms the available of the resource for accessing resource issuing path
Property;Meanwhile there will be issuing path where the resource for returning to wrong HTTP code to carry out local preservation.
Further, the user log-in block, which carries out subscriber authentication detailed process, is:
Step 11:User inputs IP, CDC data center of DCM the equipment management subsystem by user log-in block
In system IP, long-range connecting pin slogan, user name, user password, DCM the equipment management subsystem database name and CDC data
Center system data library name;
Step 12:User log-in block is by above-mentioned parameter and DCM the equipment management subsystem and CDC data center management subsystem
System related setting parameter compares, and parameter completely corresponding, then authentication passes through;Otherwise, authentication fails.
Further, storage device IP, the magnetic that resource in caching product database is extracted by data extraction module
Disk ID, resource HASH value and resource name detailed process are:
Step 21:By the storing data library table in CDC data center subsystem database, one of resource is extracted
HASH value and inquire obtain the resource name of the resource;
Step 22:The resource HASH value according to obtained in step 21 inquires storing data library table, obtains its corresponding magnetic
Disk ID;
Step 23:According to magnetic disc ID obtained in step 22, the disk list number in DCM the equipment management subsystem is inquired
According to library table, its corresponding storage device id is obtained;
Step 24:According to storage device id obtained in step 23, the equipment column in DCM the equipment management subsystem are inquired
Table database table obtains its corresponding storage device IP;
Step 25:Above step is repeated, until all resource HASH values in database table are all extracted completion, is obtained
Store device IP, magnetic disc ID, resource HASH value and resource name;
Wherein the establishment process of tables of data is:CDC data center subsystem establishes CDC number by mysql database software
According to the database of center subsystem, then corresponding storing data library table is successively established, there is one to deposit in CDC data center subsystem
Store up database table;Similarly DCM the equipment management subsystem establishes the number of DCM the equipment management subsystem by mysql database software
According to library, then corresponding list of devices database table and disk list database table are successively established, had in DCM the equipment management subsystem
One list of devices database table and disk list database table.
Further, one storage device IP corresponds to multiple magnetic disc IDs;One magnetic disc ID corresponds to multiple HASH values, and one
The corresponding resource name of a resource HASH value.
Further, the data extraction module is by the storage device IP of resource, magnetic disc ID, resource HASH value and resource
Name is combined, and the combination for obtaining the issuing path of resource is as follows:
http://<Store device IP>/<Magnetic disc ID>/<Resource HASH value>/<Resource name>.
In conclusion by adopting the above-described technical solution, the beneficial effects of the invention are as follows:
Compared to existing test method, this programme has very big promotion on test accuracy and efficiency.Utilize automation journey
Sequence is tested, and reduces erroneous judgement caused by manual operation fault, while on testing efficiency, automated procedures testing efficiency
50 times are higher by than manual testing efficiency to have a surplus.
Specific embodiment:The database of DCM the equipment management subsystem and CDC data center subsystem is to operation program institute
It is authorized in IP, and authorized user's name and password are consistent.Implementation steps:
Step 11:User inputs IP, CDC data center of DCM the equipment management subsystem by user log-in block
System IP, long-range connecting pin slogan(Refer to the long-range connecting pin slogan of mysql database software), user name, user password,
DCM the equipment management subsystem database name and CDC data center subsystem database name;
Step 12:User log-in block is by above-mentioned parameter and DCM the equipment management subsystem and CDC data center management subsystem
System related setting parameter compares, and parameter completely corresponding, then authentication passes through;Otherwise, authentication fails;If identity
It is verified, then user logs in caching product database, executes step 13;Otherwise, return step 11;
Step 13:Storage device IP, the magnetic disc ID, money of resource in caching product database are extracted by data extraction module
Source HASH value and resource name, detailed process are:
Step 21:By the storing data library table in CDC data center subsystem database, one of resource is extracted
HASH value and inquire obtain the resource name of the resource;
Step 22:The resource HASH value according to obtained in step 21 inquires storing data library table, obtains its corresponding magnetic
Disk ID;
Step 23:According to magnetic disc ID obtained in step 22, the disk list number in DCM the equipment management subsystem is inquired
According to library table, its corresponding storage device id is obtained;
Step 24:According to storage device id obtained in step 23, the equipment column in DCM the equipment management subsystem are inquired
Table database table obtains its corresponding storage device IP;
Step 25:Above step is repeated, until all resource HASH values in database table are all extracted completion, is obtained
Store device IP, magnetic disc ID, resource HASH value and resource name.
Step 14:Data extraction module according to the storage device IP of resource, magnetic disc ID resource HASH value and resource name into
Row combination, obtains the issuing path of resource;And resource issuing path is written in file.
Step 15:Data access module accesses resource issuing path, according to its HTTP return value, confirms the available of the resource
Property;Meanwhile there will be issuing path where the resource for returning to wrong HTTP code to carry out local preservation
The invention is not limited to specific embodiments above-mentioned.The present invention, which expands to, any in the present specification to be disclosed
New feature or any new combination, and disclose any new method or process the step of or any new combination.