Disclosure of Invention
In order to overcome the technical problem, the invention provides a method and a system for preventing illegal operation of a log platform, which solve the problem that an internet user abuses illegal operation of log authority.
In order to achieve the purpose, the technical scheme of the invention is as follows:
according to an aspect of the present invention, there is provided a method for preventing an illegal operation of a log platform, the method including:
creating a log task and filling task parameters;
the front end of the log platform carries out first-stage verification;
the log platform interface carries the task parameter request to a server;
the server side checks the task parameters of the second stage;
examining and approving the log task;
and executing a bailing log task, wherein the bailing log task refers to that the server sends a log reporting signaling to a specific user based on the unique user mark to trigger log reporting.
Preferably, the task parameters include, but are not limited to: task type, user unique mark, mark type, approver, task description, log starting time, log ending time and task expiration time;
the log platform front end performs a first stage verification step, including verification for, but not limited to: whether the task parameter is empty, whether the log starting time is less than the log ending time, and whether the approver of the log platform has authority;
and the server side performs a task parameter checking step for checking whether the log task is repeatedly created or not.
Preferably, when checking whether the log task is created repeatedly, the method includes the following steps:
the server side inquires database data after receiving a platform task creation request;
comparing the parameters of the log to be created with the parameters of the created log in the database;
judging the log task to be repeatedly created, wherein the judging formula is as follows:
(taskType1==taskType2)&&(userSymbol1==userSymbol2)&&(symbolType1==symbolType2)
&&((startTime2>startTime1&&startTime2<endTime1)||(endTime2>start Time1&&endTime2<endTime1))
in the formula:
the taskType1 and the taskType2 are task types of logs to be created and logs already created respectively;
the userSymbol1 and the userSymbol2 are respectively unique marks of the user who wants to create the log and the user who has created the log;
the symbol types of the symbolType1 and the symbolType2 are respectively a mark type of a log to be created and a mark type of a created log;
startTime1 and startTime2 are the start times of logs to be created and created respectively;
endTime1, endTime2 are the log end times for the log to be created and the log already created, respectively.
Preferably, the approving the log task specifically includes:
sending a task approval notice;
the task approval notice is received by an approver;
when the log task is rejected through approval, a task approval failure notice is sent, and the task approval failure notice is received by a task submitter;
and when the log task passes the approval, sending a task approval passing notice, wherein the task approval passing notice is received by the task submitter.
Preferably, the step of executing the bailing log task further includes:
when the execution of the bailing log task fails, a task execution failure notification is sent out, and the task execution failure notification is received by the task submitter;
and when the salvaging log task is successfully executed, sending a task execution success notification, wherein the task execution success notification is received by the task submitter.
Preferably, the notification is issued by an IM notification, including but not limited to a flybook notification, a business WeChat notification, a nail notification, an email notification.
Preferably, the executing the bailing log task comprises the following steps:
the server side issues signaling to a corresponding client side according to the unique user identification orientation;
the client triggers a log to report to the server according to the signaling parameters;
after the log file is successfully reported to the server, the log file is stored in the server;
the client requests the server interface to inform the server of successful task execution;
and the log platform requests the server to refresh the task list and update the task state to be successful in execution, and displays the log file downloading inlet.
According to another aspect of the present invention, there is provided a system for preventing an illegal operation of a log platform, the system comprising: the system comprises a log platform, a server and a client;
the log platform also comprises a task creation information filling module and a task creation submission first-stage verification module;
the server also comprises a task creation interface information receiving module, a second-stage checking module for checking whether the task is repeated or not, a task data storage database module and a bailing log task executing module;
the task creation information filling module is used for creating a log task according to the task parameter information;
the task creation submission first-stage checking module is used for checking whether the task parameter information is empty and whether the log starting time is less than the log ending time, and sending task creation interface information to the server after the checking is passed;
the task creation interface information receiving module is used for receiving the task creation interface information sent by the log platform;
the second-stage checking module for checking whether the task is repeated is used for acquiring task parameters through the task creation interface information receiving module and checking whether the log task is repeatedly created;
the task data storage database module is used for storing the log task which is checked to pass by the second-stage checking module if the task is repeated;
the bailing log task execution module is used for acquiring task parameter information from the task data storage database module, controlling the server to issue a signaling to the corresponding client according to the unique user identification orientation in the task parameter information, triggering the log to be reported to the server by the client according to the signaling parameter, and storing the log file in the server for downloading after the log file is successfully reported to the server.
Preferably, the system further comprises: the system comprises a permission management module and a task approval module;
the authority management module is used for distributing different operation authorities to the operators;
and the task approval module is used for an operator with approval authority to approve the task created by the task creation information filling module.
The invention has the beneficial effects that:
the invention provides a method and a system for preventing a log platform from illegal operation, which aim at the problems that the existing log platform is lack of auditing for creating log tasks, the ability of salvaging logs is abused, whether the created log tasks are reasonable or not cannot be evaluated and the like in the management aspect.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The method and system for preventing illegal operation of the log platform claimed by the present invention will be further described in detail with reference to the following embodiments.
According to an aspect of the present invention, referring to fig. 1, there is provided a method for preventing an illegal operation of a log platform, the method including:
and creating a log task and filling task parameters. Specifically, a log platform is opened, a created task is selected, task parameter information including a task type taskType, a user mark userSymbol, a mark type symbolType, an approver apvalid, a task description tassdescr, a log start time startTime, a log end time and a task expiration time are filled in a task creating form, the task types include but are not limited to log salvage and file salvage, the user only marks including but not limited to userld and deviceId are used for distinguishing the types of the user marks, the approver is a person with platform owner or super manager authority, and the person has authority to approve or reject the task; the task description is a detailed description of the task creation purpose, and facilitates an approver to understand the task purpose and determine the auditing condition. As can be understood by those skilled in the art, as long as the task parameter information capable of describing the log task is the task parameter information claimed by the present invention, the specific naming of the task parameter information is not limited to the task parameter names listed in the embodiments of the present invention.
After filling in the task parameter information, a first stage of verification is carried out at the front end of the logging platform, including verification for the following contents: whether the task parameter is empty, whether the log starting time is less than the log ending time, and whether the approver of the log platform has the authority.
And the log platform interface carries the task parameter request to a server. Specifically, the log platform sends a network interface request for creating a task to the server, and the interface carries a log task parameter request to the server.
And the server side carries out second-stage task parameter verification and is used for verifying whether the log task is repeatedly created. Specifically, the server reads the existing task data of the database, performs second-stage task parameter verification according to the task parameters carried by the network interface for creating the task and the database data, and judges whether the task is repeatedly created with the existing task data in the database according to a task repeated judgment algorithm. And if the task is repeatedly created, returning an error to prompt that the task cannot be repeatedly created. According to the embodiment of the invention, repeated creation of tasks is prevented through parameter verification, the pressure of the system is greatly reduced, the cost of a server and a database machine is further reduced, and the working efficiency of common development or testing personnel is improved.
Submitting the log task, adding a piece of task data by the server according to the task parameters carried by the interface, storing the task data in a database, and sending a task approval IM notification to an approver;
examining and approving the log task;
and executing a bailing log task, wherein the bailing log task refers to that the server sends a log reporting signaling to a specific user based on the unique user mark to trigger log reporting.
Preferably, the task parameters include, but are not limited to: task type, user unique mark, mark type, approver, task description, log starting time, log ending time and task expiration time;
as shown in fig. 2, the log platform front end performs a first stage verification step, including verification steps for verifying the following contents, including but not limited to: whether the task parameter is empty, whether the log starting time is less than the log ending time, and whether the approver of the log platform has authority;
and the server side performs a task parameter checking step for checking whether the log task is repeatedly created or not.
Preferably, referring to fig. 2, when checking whether the log task is created repeatedly, the method includes the following steps:
the server side inquires database data after receiving a platform task creation request;
comparing the task parameters of the tasks to be created with the task parameters of the created tasks in the database; specifically, a task creation interface can be used to carry parameters to perform cyclic traversal comparison to determine whether a data record meeting the task repeated definition condition exists in the database; as can be understood by those skilled in the art, any method capable of matching data in the database in sequence is a claimed method for comparing task parameters of a task to be created with task parameters of tasks already created in the database, including but not limited to a loop traversal mode.
And simultaneously, the following conditions are met, namely the log task is considered to be repeatedly created:
the task type, the user unique mark and the mark type of the log task (task 1) to be created and the created log task (task 2) are the same;
the log task (task 1) to be created intersects with the time period formed by the start time and the end time of the created log of the log task (task 2); namely, the task 2 starting time is greater than the task 1 starting time and less than the task 1 ending time, or the task 2 ending time is greater than the task 1 starting time and less than the task 1 ending time;
the judgment formula is as follows:
(taskType1==taskType2)&&(userSymbol1==userSymbol2)&&(symbolType1==symbolType2)
&&((startTime2>startTime1&&startTime2<endTime1)||(endTime2>start Time1&&endTime2<endTime1))
in the formula: taskType1 and taskType2 are the task types of task 1 and task 2 respectively;
userSymbol1 and userSymbol2 are respectively unique marks of users of task 1 and task 2;
the symbol types of the symbol type1 and the symbol type2 are respectively the mark types of the task 1 and the task 2;
startTime1 and startTime2 are log start times of task 1 and task 2, respectively;
endTime1 and endTime2 are log end times for task 1 and task 2, respectively.
When the repeated creation of the task is judged, the server interface returns the prompt information of the repeated creation of the task to the log platform, and the log platform prompts that the task cannot be repeatedly created. According to the embodiment of the invention, repeated creation of tasks is prevented through parameter verification, the pressure of the system is greatly reduced, the cost of a server and a database machine is further reduced, and the working efficiency of common development or testing personnel is improved.
Preferably, the approving the log task specifically includes:
the server side adds a piece of task data and stores the task data in the database successfully, and then sends a task approval IM notice to an approver;
the task approval notice is received by an approver;
and when the log task is rejected through approval, sending a task approval failure notice, wherein the task approval failure notice is received by a task submitter. Specifically, the approver operates the task approval on the log platform, if the approval is rejected, the approver sends an approval rejection IM notification to the task submitter, and meanwhile, the server updates the task state in the database to be the task end.
And when the log task passes the approval, sending a task approval passing notice, wherein the task approval passing notice is received by the task submitter. Specifically, the approver operates the task approval on the log platform, if the approval is passed, the approver sends an approval passing IM notification to the task submitter, and meanwhile, the server updates the task state in the database to be in the task salvage process.
It should be noted that the task approval is handled by a task approver, and the task approver is a person who has the authority of a platform owner or a super administrator.
Preferably, referring to fig. 3, the performing a bailing log task specifically includes the steps that the server directionally issues a log bailing signaling to the user client corresponding to the user identifier, the client triggers log reporting after receiving the log bailing signaling, the log is reported to the server, the server stores in the database, and the task is successfully performed; otherwise the task execution fails.
The method specifically comprises the following steps:
when the execution of the bailing log task fails, a task execution failure notification is sent out, and the task execution failure notification is received by the task submitter; specifically, the task execution fails, the server updates the task state in the database to be the task execution failure, sends a task execution failure IM to notify a task submitter, and the task is finished.
And when the salvaging log task is successfully executed, sending a task execution success notification, wherein the task execution success notification is received by the task submitter. Specifically, the task is successfully executed, the server updates the task state in the database to be the task execution success, sends the task execution success IM notification to the task submitter, and the task is finished. If the task is successfully executed, ordinary development/test personnel can download the log file in the log platform for use.
Preferably, the notification is issued through an IM notification, which includes but is not limited to an instant messaging system such as a flybook notification, a business wechat notification, a nail notification, an email notification, and the like.
Preferably, the executing the bailing log task comprises the following steps: the server side issues signaling to a corresponding client side according to the unique user identification orientation; the client triggers a log to report to the server according to the signaling parameters; after the log file is successfully reported to the server, the log file is stored in the server; the client requests the server interface to inform the server of successful task execution; and the log platform requests the server to refresh the task list and update the task state to be successful in execution, and displays the log file downloading inlet. The task state comprises successful execution and task execution failure.
Specifically, the server sends signaling to the corresponding client according to the user identification orientation; the client triggers a log to report to the server side according to the fact that the signaling parameter switchFlag is true, and the client does not process the log according to the fact that the signaling parameter switchFlag is false; after the log file is successfully reported to the server, the log file is stored in the server; the client requests the server interface to inform the server of the successful execution of the task; the log platform requests the server to refresh the task list and update the task state to be successful in execution, and displays a log file downloading button; the task state comprises successful execution and task execution failure.
When the task is successfully executed, a task submitter, a person with a platform owner or super administrator authority can download the log file on a task list page.
It should be noted that, referring to fig. 4, the roles having platform permissions and their corresponding platform operation permissions in the present invention are as follows:
1. a common developer (RD) capable of creating a task and viewing a task list;
2. a general tester (QA) capable of creating a task and viewing a task list;
3. the administrator (Owner) of a single project can add platform authorities including RD, QA and OWNER authorities to other personnel, can examine and approve tasks, can create tasks, view task lists and view task examination and approval lists;
4. the super administrator and the administrator of the platform can add platform permissions including RD, QA and OWNER for other personnel, and the super administrator permissions can approve tasks, create tasks, view task lists and view task approval lists;
according to another aspect of the present invention, referring to fig. 5, according to another aspect of the present invention, there is provided a system for preventing an illegal operation of a logging platform, the system comprising: the system comprises a log platform, a server and a client;
the log platform also comprises a task creation information filling module and a task creation submission first-stage verification module;
the server also comprises a task creation interface information receiving module, a second-stage checking module for checking whether the task is repeated or not, a task data storage database module and a bailing log task executing module;
the task creation information filling module is used for creating a log task according to the task parameter information;
the task creation submission first-stage checking module is used for checking whether the task parameter information is empty and whether the log starting time is less than the log ending time, and sending task creation interface information to the server after the checking is passed;
the task creation interface information receiving module is used for receiving the task creation interface information sent by the log platform;
the second-stage checking module for checking whether the task is repeated is used for acquiring task parameters through the task creation interface information receiving module and checking whether the log task is repeatedly created;
the task data storage database module is used for storing the log task which is checked to pass by the second-stage checking module if the task is repeated;
the bailing log task execution module is used for acquiring task parameter information from the task data storage database module, controlling the server to issue a signaling to the corresponding client according to the unique user identification orientation in the task parameter information, triggering the log to be reported to the server by the client according to the signaling parameter, and storing the log file in the server for downloading after the log file is successfully reported to the server.
Preferably, the system further comprises: the system comprises a permission management module and a task approval module;
the authority management module is used for distributing different operation authorities to the operators;
and the task approval module is used for an operator with approval authority to approve the task created by the task creation information filling module.
Preferably, the system further includes an IM notification module, where the IM notification module is configured to issue notifications to operators with different roles according to different scenarios, and the types of the notifications include, but are not limited to: a task approval failure notification, a task approval success notification, a task execution failure notification, and a task execution success notification.
In summary, compared with the prior art, the invention provides the method and the system for preventing the illegal operation of the log platform, solves the problems that the existing log platform is lack of auditing for creating the log task, the log salvaging capability is abused, whether the created log task is reasonable or not cannot be evaluated and the like in the management aspect, further enhances the usability and controllability of the log platform, improves the working efficiency of common development or testing personnel, and reduces the system pressure and the machine cost of a server side and a database.
The foregoing shows and describes the general principles, essential features, and advantages of the invention. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, which are given by way of illustration of the principles of the present invention, and that various changes and modifications may be made without departing from the spirit and scope of the invention as defined by the appended claims. The scope of the invention is defined by the appended claims and equivalents thereof.