Summary of the invention
In order to solve the above technical problems, it is an object of the invention to: it provides a kind of without the use of across computer room calling service tune
With screenshot method, system and the storage medium of the screenshot result in extension set room.
The first technical solution of the present invention is:
A kind of screenshot method comprising following steps:
The screenshot request uploaded according to client generates screenshot key;
User's screenshot address, file system service address and screenshot result, which are obtained, according to screenshot key saves address of service;
Obtain screenshot order;
According to screenshot command calls screenshot script;
Screenshot script execution shot operation is used according to user's screenshot address, obtains screenshot picture;
Screenshot picture is saved in file system according to file system service address, and obtains screenshot figure from file system
Piece path;
Address of service is saved according to screenshot result, and screenshot key and screenshot picture path are saved in screenshot result preservation clothes
Business;
Service is saved by screenshot result to be saved in screenshot key and screenshot picture path and equipment management control node pair
In the redis in the extension set room answered.
Further, further comprising the steps of:
Picture acquisition request is generated according to user's screenshot address and screenshot key;
Client is sent by picture acquisition request.
It further, further include following when screenshot key and screenshot picture path are saved in the preservation service of screenshot result
Step:
Screenshot picture path is saved in the redis of central machine room.
Further, further comprising the steps of:
Receive the picture acquisition request that client uploads;
Obtain the screenshot key in picture acquisition request;
User's screenshot address, file system service address and screenshot knot are obtained according to the screenshot key in picture acquisition request
Fruit saves address of service;
Screenshot picture is obtained out of file system according to screenshot picture path.
Further, user's screenshot address, file system service address and the preservation of screenshot result are being obtained according to screenshot key
It is further comprising the steps of between the step for the step for address of service and acquisition screenshot order:
Screenshot key, user's screenshot address, file system service address and screenshot result preservation address of service are saved in
In the redis in scheming room.
Further, the acquisition screenshot order, specifically includes:
After determining that the management service of central machine room receives jms message informing, believed according to the cache key in jms message informing
Breath obtains screenshot parameter out of central machine room redis, and the screenshot parameter includes screenshot key, user's screenshot address, file
System service address and screenshot result save address of service;
When the management service of central machine room receives mq message, screenshot order is generated according to screenshot parameter.
Further, the step for obtaining screenshot order and according to the step for screenshot command calls screenshot script it
Between, it is further comprising the steps of:
The equipment that screenshot order is sent to extension set room is transported by the administration agent service and equipment operation service in extension set room
Traveling journey service.
Second of technical solution of the present invention is:
A kind of screenshot system comprising:
Generation module, the screenshot request for being uploaded according to client generate screenshot key;
Module is obtained, is protected for obtaining user's screenshot address, file system service address and screenshot result according to screenshot key
Deposit address of service;Obtain screenshot order;
Calling module, for according to screenshot command calls screenshot script;
Execution module obtains screenshot picture for using screenshot script execution shot operation according to user's screenshot address;
First preserving module, for screenshot picture to be saved in file system according to file system service address, and from text
Screenshot picture path is obtained in part system;
Second preserving module saves screenshot key and screenshot picture path for saving address of service according to screenshot result
It saves and services to screenshot result;
Third preserving module, for by screenshot result save service by screenshot key and screenshot picture path be saved in
In the redis in the corresponding extension set room of equipment management control node.
The third technical solution of the present invention is:
A kind of screenshot system, comprising:
At least one processor, for storing program;
At least one processor executes a kind of screenshot method for loading described program.
4th kind of technical solution of the present invention be
A kind of storage medium, wherein be stored with the executable instruction of processor, the executable instruction of the processor by
For realizing a kind of screenshot method when processor executes.
The beneficial effects of the present invention are: the present invention saves service by increasing screenshot result in extension set room, and by cutting
Figure result saves service and screenshot key and screenshot picture path is saved in extension set corresponding with equipment management control node room
In redis, so that the service call that can be used in extension set room replaces the service call across computer room when inquiry screenshot result, subtract
Few influence of the network stabilization to query process.
Specific embodiment
The present invention is described in further detail in the following with reference to the drawings and specific embodiments.In for the examples below
Number of steps is arranged only for the purposes of illustrating explanation, does not do any restriction to the sequence between step, each in embodiment
The execution sequence of step can be adaptively adjusted according to the understanding of those skilled in the art.
Referring to Fig.1, a kind of screenshot method comprising following steps:
S101, the screenshot request uploaded according to client generate screenshot key;The screenshot key is cutting in central machine room
Figure receives generation in service, and the screenshot key is obtained and set to the database of central machine room for guiding screenshot to receive service
The user's screenshot address, file system service address and screenshot result that standby corresponding device management control node corresponds to computer room save clothes
Business address.
S102, user's screenshot address, file system service address and screenshot result are obtained according to screenshot key with saving service
Location;Specifically in the database of central machine room, the user for obtaining computer room corresponding with equipment corresponding device management control node is cut
Figure address, file system service address and screenshot result save address of service.
S103, screenshot order is obtained;The screenshot order is generated in the management service of central machine room.Central machine room
Management service manages each administration agent service.
S104, according to screenshot command calls screenshot script;When equipment operation process service receives screenshot order, call
Screenshot script.
S105, screenshot script execution shot operation is used according to user's screenshot address, obtains screenshot picture;It is run in equipment
In being serviced, screenshot equipment is determined according to user's screenshot address, then carries out screenshot in screenshot equipment using screenshot script
Operation, obtains screenshot picture.
S106, screenshot picture is saved in by file system according to file system service address, and is obtained from file system
Screenshot picture path;The file system is Fastdfs, and Fastdfs is a kind of lightweight Distribute file system of open source.According to
File system service address determines file system, screenshot picture is then saved in file system, file system is according to screenshot figure
Piece generates screenshot picture path.
S107, screenshot key and screenshot picture path are saved in by screenshot result guarantor according to screenshot result preservation address of service
The service of depositing;
Specifically, by screenshot result save address of service determine screenshot result save service, then by screenshot key and cut
Figure picture path is saved in screenshot result and saves service.
S108, by screenshot result save service by screenshot key and screenshot picture path be saved in and equipment management control
In the redis in the corresponding extension set room of node.The nginx service inside service is saved particular by screenshot result, by screenshot key
It is saved in the redis in extension set corresponding with equipment management control node room with screenshot picture path, to realize screenshot result
Save the multinode deployment of service, wherein nginx is a high performance HTTP and reverse proxy WEB server.
The present invention saves service by increasing screenshot result in extension set room, and saves service for screenshot by screenshot result
Key and screenshot picture path are saved in the redis in extension set corresponding with equipment management control node room, so that inquiry screenshot knot
When fruit, the service call that can be used in extension set room replaces the service call across computer room, reduces network stabilization to query process
Influence.
It is further comprising the steps of as preferred embodiment:
Picture acquisition request is generated according to user's screenshot address and screenshot key;Use is contained in the picture acquisition request
Family screenshot address and screenshot key, the picture acquisition request are to obtain the instruction of screenshot picture to extension set room for client.
Client is sent by picture acquisition request.
By generating picture acquisition request, and send client for picture acquisition request, allow client according to
Picture acquisition request gets satisfactory screenshot picture.
As preferred embodiment, when screenshot key and screenshot picture path are saved in the preservation service of screenshot result,
It is further comprising the steps of:
Screenshot picture path is saved in the redis of central machine room.Screenshot picture path is saved in central machine room
It,, can also be out of central machine room when can not obtain screenshot picture path when being influenced in extension set room by other factors in redis
It obtains.
It is further comprising the steps of as preferred embodiment:
Receive the picture acquisition request that client uploads;Screenshot picture specifically in extension set room obtains service and receives client
Hold the picture acquisition request uploaded.
Obtain the screenshot key in picture acquisition request;
User's screenshot address, file system service address and screenshot knot are obtained according to the screenshot key in picture acquisition request
Fruit saves address of service;It is to obtain screenshot picture path by matching the screenshot key in the redis in extension set room.Specifically set
It repeatedly attempts to obtain screenshot picture path in the fixed time, if obtaining less than screenshot picture path, directly believe miscue
Breath sends all clients, and terminates process, if getting screenshot picture path at the appointed time, can carry out next step.
Screenshot picture is obtained out of file system according to screenshot picture path.When at the appointed time obtain screenshot picture road
Diameter, then screenshot picture obtains service can obtain screenshot picture out of file system.
As preferred embodiment, user's screenshot address, file system service address are being obtained according to screenshot key and cut
It is further comprising the steps of between the step for figure result saves the step for address of service and obtains screenshot order:
Screenshot key, user's screenshot address, file system service address and screenshot result preservation address of service are saved in
In the redis in scheming room.The screenshot key, user's screenshot address, file system service address and screenshot result save service ground
All there is incidence relation in location, when getting one of information, can get other information, still, if first information
With less than then other information is also searched less than reducing the access number of redis.And by screenshot key, user's screenshot address, file
System service address and screenshot result save address of service and are saved in the redis of central machine room, when in extension set room by other
Factor influences, and can not obtain when needing information, then can obtain out of central machine room.
As preferred embodiment, the acquisition screenshot order is specifically included:
After determining that the management service of central machine room receives jms message informing, believed according to the cache key in jms message informing
Breath obtains screenshot parameter out of central machine room redis, and the screenshot parameter includes screenshot key, user's screenshot address, file
System service address and screenshot result save address of service;
When the management service of central machine room receives mq message, screenshot order is generated according to screenshot parameter.
This step is to reduce the access pressure of central machine room in order to avoid server frequently handles unnecessary process.
As preferred embodiment, the step for obtaining screenshot order and according to screenshot command calls screenshot script this
It is further comprising the steps of between one step:
The equipment that screenshot order is sent to extension set room is transported by the administration agent service and equipment operation service in extension set room
Traveling journey service.This step is to solve the problems in collection by dividing Computer mode.
Application process of the present invention in system as shown in Figure 2 is as follows:
A1, client send screenshot request and receive service to screenshot;
A2, screenshot receive service and are requested to generate screenshot key according to screenshot;
A3, screenshot receive service and obtain user's screenshot address from step B1, then generate picture according to screenshot key and obtain
Request, and picture acquisition request is returned into client;
Wherein, it before step A3 return, begins to execute step B1, after sending jms message in step B3 process, A
Process and B process execute backward independently of each other.
B1, user's screenshot address that corresponding with corresponding device management node computer room is obtained out of central machine room database,
File system service address and screenshot result save address of service;
B2, screenshot parameter is saved in the redis of central machine room, the screenshot parameter includes screenshot key, user's screenshot
Address, file system service address and screenshot result save address of service;
The screenshot reception service of B3, central machine room send the management service of jms message informing central machine room to activemq,
Wherein, activemq is open source messaging bus;
B4, central machine room management service monitor the screenshot command messages in activemq, and receive jms message;
B5, central machine room management service according to the caching key information in jms message, obtained from the redis of central machine room
Take screenshot parameter;
After the management service determination of B6, central machine room receive screenshot command messages, the administration agent service to extension set room
Send screenshot order;
The administration agent service of B7, extension set room send screenshot order in the equipment operation service in extension set room;
The equipment that screenshot order is sent to extension set room is run process service again by the equipment operation service of B8, extension set room
It is interior;
After the equipment operation process service of B9, extension set room receive screenshot order, screenshot script is called, and hold in equipment
Row shot operation obtains screenshot picture;
Wherein, what step B6-B9 played the role of is an agency service, specifically uses and Computer mode is divided to solve concentration
Problem.
Screenshot picture is uploaded to file according to file system service address by the equipment operation process service of B10, extension set room
System, and screenshot picture path is obtained from file system;
B11, (include step B11.1) extension set room equipment operation process service will be on screenshot key and screenshot picture path
It offers screenshot result to save in service, screenshot result saves service and screenshot key and screenshot picture path are saved in extension set room
In redis, the nginx service in service is saved especially by screenshot result and realizes that screenshot result saves the multinode portion of service
Administration;
The equipment operation process service of B12, extension set room can also send screenshot picture path to the equipment operation in extension set room
In service;
The equipment operation service of B13, extension set room again send screenshot picture path to the administration agent service in extension set room;
The administration agent service of B14, extension set room send in screenshot picture path in the management service of central machine room;
B15, central machine room management service finally screenshot picture path is saved in the redis of central machine room;
The screenshot of central machine room is received the picture acquisition request that service returns and is sent in nginx by C1, client;
C2, extension set room nginx send the specified screenshot picture in extension set room for picture acquisition request and obtain service;
The screenshot picture acquisition service of C3, extension set room obtain screenshot picture path out of extension set room redis, if providing
Screenshot picture path has not been obtained in time, then error message is directly returned into client, and terminate process, if in regulation
It is interior to get screenshot picture path, then carry out step C4-C6;
The screenshot picture acquisition service of C4, extension set room obtain screenshot picture according to screenshot picture path out of file system;
The screenshot picture acquisition service of C5, extension set room send screenshot picture in the nginx in extension set room;
C6, extension set room nginx screenshot picture is forwarded to client.
The embodiment of the invention also provides a kind of screenshot systems corresponding with Fig. 1 method comprising:
Generation module, the screenshot request for being uploaded according to client generate screenshot key;
Module is obtained, is protected for obtaining user's screenshot address, file system service address and screenshot result according to screenshot key
Deposit address of service;Obtain screenshot order;
Calling module, for according to screenshot command calls screenshot script;
Execution module obtains screenshot picture for using screenshot script execution shot operation according to user's screenshot address;
First preserving module, for screenshot picture to be saved in file system according to file system service address, and from text
Screenshot picture path is obtained in part system;
Second preserving module saves screenshot key and screenshot picture path for saving address of service according to screenshot result
It saves and services to screenshot result;
Third preserving module, for by screenshot result save service by screenshot key and screenshot picture path be saved in
In the redis in the corresponding extension set room of equipment management control node.
Content in above method embodiment is suitable for this system embodiment, the function that this system embodiment is implemented
Can be identical as above method embodiment, and the beneficial effect reached and above method beneficial effect achieved are also identical.
The embodiment of the invention also provides a kind of screenshot systems corresponding with Fig. 1 method, comprising:
At least one processor, for storing program;
At least one processor executes a kind of screenshot method for loading described program.
Content in above method embodiment is suitable for this system embodiment, the function that this system embodiment is implemented
Can be identical as above method embodiment, and the beneficial effect reached and above method beneficial effect achieved are also identical.
In addition, the embodiment of the invention also provides a kind of storage mediums, wherein being stored with the executable instruction of processor, institute
The executable instruction of processor is stated when executed by the processor for realizing a kind of screenshot method.
In conclusion the present invention saves service by increasing screenshot result in extension set room, and saved by screenshot result
Screenshot key and screenshot picture path are saved in the redis in extension set corresponding with equipment management control node room by service, so that
When inquiring screenshot result, the service call that can be used in extension set room replaces the service call across computer room, reduces network stabilization
Influence to query process;Further, the present invention is by being saved in central machine room for screenshot parameter and screenshot picture path
In redis, when being influenced in extension set room by other factors, when can not obtain information needed, it can be obtained out of central machine room.
It is to be illustrated to preferable implementation of the invention, but the present invention is not limited to the embodiment above, it is ripe
Various equivalent deformation or replacement can also be made on the premise of without prejudice to spirit of the invention by knowing those skilled in the art, this
Equivalent deformation or replacement are all included in the scope defined by the claims of the present application a bit.