CN108008800B - Reset request processing method, device and equipment - Google Patents

Reset request processing method, device and equipment Download PDF

Info

Publication number
CN108008800B
CN108008800B CN201711227768.2A CN201711227768A CN108008800B CN 108008800 B CN108008800 B CN 108008800B CN 201711227768 A CN201711227768 A CN 201711227768A CN 108008800 B CN108008800 B CN 108008800B
Authority
CN
China
Prior art keywords
reset
request
identification information
reset request
preset time
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
CN201711227768.2A
Other languages
Chinese (zh)
Other versions
CN108008800A (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.)
Ruijie Networks Co Ltd
Original Assignee
Ruijie Networks 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 Ruijie Networks Co Ltd filed Critical Ruijie Networks Co Ltd
Priority to CN201711227768.2A priority Critical patent/CN108008800B/en
Publication of CN108008800A publication Critical patent/CN108008800A/en
Application granted granted Critical
Publication of CN108008800B publication Critical patent/CN108008800B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/24Resetting means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/008Reliability or availability analysis

Abstract

The invention discloses a method, a device and equipment for processing a reset request, wherein the method comprises the following steps: acquiring a reset request, wherein the reset request carries a request type and identification information, and the request type is used for indicating a reset process or a reset system; counting the number of times of the acquired reset requests carrying the identification information within a first preset time corresponding to the request types; and when the frequency is determined to be greater than the first threshold value corresponding to the request type, the reset operation is not executed on the current reset request. By adopting the method provided by the invention, the times of the reset requests carrying the same identification information are counted, and when the times are greater than a first threshold value, namely the frequent reset phenomenon is shown, the reset operation is not executed on the reset request. Therefore, frequent restarting of the process or the system can be avoided, the problem that continuous service cannot be provided for the service function caused by frequent restarting of the process or the system is further avoided, and the reliability of the system is improved.

Description

Reset request processing method, device and equipment
Technical Field
The present invention relates to the field of data communication technologies, and in particular, to a method, an apparatus, and a device for processing a reset request.
Background
At present, independent multitask system software is largely adopted in an embedded system, for example, Linux is a multitask and multiprocess operating system, and each service can be respectively operated by a plurality of different independent processes designed in a modularized mode according to functions. When one of the processes operates abnormally due to internal or external logic defects, the process can be used for initiatively restarting the process or restarting the system, or when other processes detect that the process has the abnormality, the process or the whole system is restarted, and the continuous service of the business function is provided through the modes, so that the reliability of the whole embedded system is improved. However, since the software defect is objectively present, once a certain process or some processes are continuously restarted in a short time or a system is continuously restarted in a short time, the continuous service cannot be provided for the business function under the condition, and the service output of other business functions and even the whole system can be influenced.
In summary, how to avoid the process or the system from being restarted continuously in a short time is one of the technical problems to be solved urgently.
Disclosure of Invention
The embodiment of the invention provides a reset request processing method, a reset request processing device and reset request processing equipment, which are used for solving the problems that continuous service cannot be provided for business functions, the reliability of a system is low and the like caused by frequent restart of a process or the system in the prior art.
In a first aspect, an embodiment of the present invention provides a method for processing a reset request, including:
acquiring a reset request, wherein the reset request carries a request type and identification information, and the request type is used for indicating a reset process or a reset system; and are
Counting the number of times of the acquired reset requests carrying the identification information within a first preset time corresponding to the request type; and
and when the frequency is determined to be greater than the first threshold value corresponding to the request type, the reset operation is not executed on the current reset request.
In a second aspect, an embodiment of the present invention provides a reset request processing apparatus, including:
the device comprises an acquisition unit, a reset unit and a processing unit, wherein the acquisition unit is used for acquiring a reset request, the reset request carries a request type and identification information, and the request type is used for indicating a reset process or a reset system;
the first counting unit is used for counting the times of the acquired reset requests carrying the identification information within a first preset time corresponding to the request types;
and the first processing unit is used for not executing the reset operation on the current reset request when the frequency is determined to be greater than the first threshold corresponding to the request type.
In a third aspect, an embodiment of the present invention provides a non-volatile computer storage medium, which stores computer-executable instructions for executing the method for processing a reset request provided in the present application.
In a fourth aspect, an embodiment of the present invention provides an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the reset request processing method provided herein.
The invention has the beneficial effects that:
the method, the device and the equipment for processing the reset request provided by the embodiment of the invention are used for acquiring the reset request, wherein the reset request carries a request type and identification information, and the request type is used for indicating a reset process or a reset system; counting the number of times of the acquired reset requests carrying the identification information within a first preset time corresponding to the request types; and when the frequency is determined to be larger than the first threshold value corresponding to the request type, the reset operation is not executed on the current reset request. By adopting the method provided by the invention, the times of the reset requests carrying the same identification information are counted, the reset operation is executed on the reset request only when the times are smaller than the first threshold, and when the times are larger than the first threshold, the frequent reset condition is indicated, and the reset operation is not executed on the reset request, so that the frequent restart of the process or the system can be avoided, the problem that the continuous service cannot be provided for the service function caused by the frequent restart of the process or the system is further avoided, and the reliability of the system is improved. In addition, because the program is operated according to a fixed logic, if multiple process restarts or system restarts occur in a short time, the result of the continuous repeated action can be expected to be the same and invalid, so that by adopting the method provided by the invention, when the number of times of the reset request carrying the identification information is determined to exceed the first threshold value, the reset operation is not executed on the reset request, namely, the restart action is inhibited, and the service or other service functions provided by the system to the outside can be continuously used.
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, which 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 description serve to explain the invention and not to limit the invention. In the drawings:
fig. 1a is a flowchart illustrating a method for processing a reset request according to an embodiment of the present invention;
fig. 1b is a schematic flowchart of a method for performing statistics on the number of times of the obtained reset requests carrying the identification information according to an embodiment of the present invention;
fig. 1c is a second schematic flowchart of a reset request processing method according to a first embodiment of the present invention;
fig. 1d is a third schematic flowchart of a reset request processing method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an application scenario of a reset request processing method according to a second embodiment of the present invention;
fig. 3 is a flowchart illustrating a reset request processing method for resetting a process according to a third embodiment of the present invention;
fig. 4 is a flowchart illustrating a reset request processing method for resetting a system according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of a reset request processing apparatus according to a fifth embodiment of the present invention;
fig. 6 is a schematic hardware structure diagram of an electronic device implementing a reset request processing method according to a seventh embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a reset request processing method, a reset request processing device and reset request processing equipment, which are used for solving the problems that continuous service cannot be provided for business functions, the reliability of a system is low and the like caused by frequent restart of a process or the system in the prior art.
The reset request processing method provided by the invention can be suitable for a multi-process operating system, and the frequent restart of each process in the multi-process operating system and the frequent restart of the operating system can be avoided by executing the reset request processing method provided by the invention.
The preferred embodiments of the present invention will be described below with reference to the accompanying drawings of the specification, it being understood that the preferred embodiments described herein are merely for illustrating and explaining the present invention, and are not intended to limit the present invention, and that the embodiments and features of the embodiments in the present invention may be combined with each other without conflict.
Example one
As shown in fig. 1a, a schematic flowchart of a reset request processing method according to an embodiment of the present invention includes the following steps:
and S11, acquiring a reset request.
The reset request carries a request type and identification information, and the request type is used for indicating a reset process or a reset system.
In specific implementation, the main body for executing the method provided by the embodiment of the present invention may be a reset protection module, and the reset protection module determines whether to suppress the reset operation of the current reset request after acquiring the reset request.
In specific implementation, in a multi-process operating system, if a request type in an acquired reset request is used to indicate a reset process, the reset request may be sent to the reset protection module by a function detection module of the process to be reset when detecting that the process is abnormal, or may be sent to the reset protection module corresponding to another process by a function detection module of another process when finding that the process has the abnormality of the process to be reset when using a function corresponding to the process; for example, there are two processes, process 1 and process 2, where the request type in the reset request is used to indicate that the process 2 needs to be reset, the reset request may be sent to the reset protection module of the process 2 by the process 2, or when the process 1 finds that there is an exception of the process 2 that needs to be reset when using the function corresponding to the process 2, the function detection module of the process 1 sends the reset request to the reset protection module corresponding to the process 1.
Preferably, if the request type in the reset request is used to indicate that the system needs to be reset, the reset request may be sent to the reset protection module corresponding to the process by the function detection module of the process when detecting that the process has an exception that the system needs to be reset.
Specifically, if the request type is a reset process, the identification information in the reset request is a process number of the process to be reset, i.e., a process ID; if the request type is a reset system, the identification information is 0 or other numerical value different from the process number.
In particular, the request type may be implemented in a macro-defined manner to indicate whether to reset the process or the system.
Preferably, the reset request further carries a reason that needs to be reset, and after the reset request is obtained and before the step S12 is executed, the method further includes:
and verifying the validity of the request type and the identification information carried in the reset request and the reason needing to be reset, wherein the verification result is successful. Preferably, the reason for the reset is random, and the reason for the reset may be unexpected by a worker, so that when the validity of the reset request is verified, the verification of the reset request may be considered successful after the verification of the request type and the identification information passes.
When the validity of the reset request is verified, the verification of the reset request can be considered to be successful only if the validity of the three parameters is verified.
Because the request type is realized in a macro definition mode, the macro definition is globally visible, it can be predetermined that the macro definition 1 is used for indicating a reset process, and the macro definition 2 is used for indicating a reset system, and the reset protection module can perform validity judgment on the request type through the macro definition known in advance after receiving the reset request.
Specifically, when validity of the identification information is determined, if the reset request is used to reset a process, the identification information carries a process number of the process to be reset, and if the identification information is a multiprocess operating system, the process numbers of all processes in the multiprocess operating system may be input in the reset protection module in advance, and the process numbers are generally continuous, so that the process numbers of all processes should be within a range, which may be [ a minimum process number, a maximum process number ], and after the reset request is received, if the identification information is a process number, and the process number is within the range, the process number is successfully verified; otherwise, the validity verification fails.
When verifying the validity of the reason requiring reset, the staff may pre-establish a list in the safeguard function module, where the list stores possible reasons of the reset process or the reset system, and if the reason in the received reset request is in the list, determine that the reason requiring reset passes verification.
Preferably, after the validity verification of the reset request is successful, and before the step S12 is executed, the method further includes:
and asynchronously recording the reset request and the processing process of the reset request.
In specific implementation, under a multi-process operating system, when a function detection module of at least one process detects that the corresponding process is abnormal, the function detection module corresponding to the at least one abnormal process in the operating system sends a reset request, and records the process processed by the reset protection module to the process receiving the reset request, and stores the process in a storage medium for follow-up system maintenance personnel to track and position.
Preferably, after the validity verification of the reset request is passed, the method further comprises:
and opening a mutual exclusion lock for the reset request.
In specific implementation, in order to ensure that the reset protection module finishes the processing flow of the received reset request, and realizes synchronization, after the reset request is verified, a mutual exclusion lock is opened for the reset request, so that the processing of the received reset request is not affected after the reset request is subsequently received.
And S12, counting the times of the acquired reset requests carrying the identification information within a first preset time corresponding to the request types.
In a specific implementation, since the reset request type is used to indicate a reset process or a reset system, the first preset time corresponding to the reset process and the first preset time of the reset system in the present invention may be the same or different, which is specifically determined according to an actual situation. For example, the first preset time corresponding to the reset process may be, but is not limited to, 5 minutes, and the like; the first preset time corresponding to the resetting system may be, but is not limited to, 7 days, etc.
If the request type is used for indicating a reset process, and the identification information is a process number of a certain process, the number of times of the received reset request carrying the process number can be counted within 5 minutes. If the request type is used for indicating a reset system, and the identification information is 0, the number of times of reset requests which are received within 7 days and carry the identification information of 0 can be counted.
In specific implementation, step S12 may be executed according to the flow shown in fig. 1b, including the following steps:
and S121, acquiring the restart times corresponding to the identification information within a first preset time from the stored shared memory table.
In specific implementation, a shared memory table is maintained, and reset information of each process which sends a reset request and reset information of a reset system are stored in the shared memory table; the reset information of the reset process may include, but is not limited to, a process number, a number of times of restart corresponding to the process, a time of receiving the reset request corresponding to the number of times of restart corresponding to the process number being 1, and a time of receiving the previous reset request; the reset information of the reset system may be, but is not limited to, the number of restarts and the time when the last reset request is received. Referring to table 1:
TABLE 1
Figure BDA0001487611490000071
Figure BDA0001487611490000081
In specific implementation, the time in table 1 is based on the time of starting the device, and takes 24 hours as an example, for example, when the device is turned on at 8:00, a first reset request carrying a process number 1 is received at 8 point 5, the number of times of restart corresponding to the process number 1 in table 1 is 1, the number of times of restart is 5 minutes corresponding to the time of the received reset request corresponding to 1, and since the current request is the first time, the time of the last reset request is empty or is filled with 0.
In specific implementation, the reset information in the shared memory table is updated in real time, in order to prevent the problem of incomplete updating caused by sudden process crash when the reset information is updated, the embodiment of the invention maintains two shared memory tables with a data verification function, the two shared memory tables respectively correspond to one serial number, and when the information in any one shared memory table is updated, the serial number of the table is added with 1. In addition, the two tables are not updated simultaneously, if the two tables are updated simultaneously, the problem of incomplete updating exists, but reserved time exists, one shared memory table is updated firstly, when the reserved time is up, the other shared memory table is updated, and then because the sequence number of the shared memory table is updated simultaneously, the shared memory table with the larger sequence number is easy to obtain the latest shared memory table, the reset information is obtained from the shared memory table with the larger sequence number, and the restart times of the reset request carrying the identification information in the first preset time can be obtained.
And S122, counting the acquired times of the reset request carrying the identification information according to the restart times.
Then, according to the restart times and the number of times 1 of the current reset request, the number of times of the obtained reset request carrying the identification information can be counted.
S13, judging whether the times are larger than a first threshold value corresponding to the request type, if so, executing a step S14; otherwise, step S15 is executed.
In specific implementation, if it is determined that the counted number of times of obtaining the reset request carrying the identification information is greater than the first threshold corresponding to the request type, it indicates that a frequent restart phenomenon occurs in the current process or system, and the reset operation is not performed on the current reset request, that is, the reset operation is not performed on the current reset request. Otherwise, the request belongs to the normal reset request, namely, the reset request is restarted.
Preferably, the first threshold corresponding to the request type for indicating the reset process and the first threshold corresponding to the request type for indicating the reset system may be the same or different, for example, the first threshold corresponding to the reset process may be, but is not limited to, 5 times; the first threshold corresponding to the reset system may be, but is not limited to, 5 times, 10 times, etc.
And S14, resetting the current resetting request is not executed.
Preferably, the result of not performing the reset operation is fed back to the process.
And S15, executing reset operation to the current reset request.
Preferably, before executing step S12, the method further includes the process shown in fig. 1c, which includes the following steps:
and S21, determining the time difference between the time of receiving the current reset request and the time of receiving the last reset request.
Wherein, the last reset request carries the identification information.
In specific implementation, after receiving the reset request of this time, if the time for receiving the reset request carrying the same identification information is longer than the time for receiving the reset request carrying the same identification information last time, it indicates that the process can normally operate in this period, so the restart times corresponding to several reset requests before recording in the shared memory table before recording the reset request of this time can be cleared, and the restart times are counted again. Therefore, the invention provides that after the current reset request is received, the time of the last reset request corresponding to the identification information is read from the shared memory table corresponding to the maximum correct serial number, and the time difference between the time of receiving the current reset request and the time of the last reset request recorded in the shared memory table is determined.
S22, judging whether the time difference is larger than a second preset time, if not, executing a step S12; otherwise, step S23 is executed.
If the time difference is larger than the second preset time, executing the reset operation on the reset request; otherwise, step S12 is executed, that is, the number of times of the reset request carrying the identification information is counted.
Specifically, the second preset time for indicating the reset process by the request type and the second preset time for indicating the reset system by the request type may be the same or different, which is determined according to the actual situation.
And S23, executing reset operation to the current reset request.
And S24, clearing the restart times corresponding to the identification information in the shared memory table and counting again.
And after the reset operation is executed on the reset request, clearing the restart times corresponding to the identification information in the shared memory table and recounting. Namely, the number of restart times corresponding to the identification information in the shared memory table is recorded as 1 time. And meanwhile, recording the time of receiving the current reset request in the time of the received reset request corresponding to the restart time of 1 and the time of the last reset request, and executing the reset request processing method provided by the invention after receiving the reset request carrying the identification information next time.
Preferably, if the request type is used to indicate a reset process, the identification information carried in the reset request is a process number of a process that needs to be reset; and the method also comprises a process shown in figure 1d, comprising the following steps:
and S31, counting the number of the reset requests carrying the process numbers in the third preset time.
In specific implementation, the method provided by the present invention further needs to count the total of the restart times corresponding to each process number within the third preset time from the shared memory table, and determine the total as the number of the reset requests carrying the process number within the third preset time.
And S32, if the number exceeds a second threshold value, directly restarting the system.
If the number is determined to exceed the second threshold, it indicates that multiple processes exist within the third preset time to send reset requests, that is, the number of processes with abnormal operation system is large, and the system needs to be reset to repair, that is, when the number is determined to exceed the second threshold, the operation system is directly restarted. For example, the reset information of each process number is read from the shared memory table, and if there have been reset requests of 16 different processes at this time and the received reset requests are all within 15 minutes, it is presumed that a large number of process exceptions have occurred in the entire system, and there is a more uncontrollable danger in continuing the operation, so that it is necessary to reset the operating system once.
Specifically, the second threshold and the third preset time may be set to any other values, which may be determined according to actual situations.
The reset request processing method provided by the invention obtains a reset request, wherein the reset request carries a request type and identification information, and the request type is used for indicating a reset process or a reset system; counting the number of times of the acquired reset requests carrying the identification information within a first preset time corresponding to the request types; and when the frequency is determined to be larger than the first threshold value corresponding to the request type, the reset operation is not executed on the current reset request. By adopting the method provided by the invention, the times of the reset requests carrying the same identification information are counted, and when the times are greater than a first threshold value, namely the frequent reset phenomenon is shown, the reset operation is not executed on the reset request. Therefore, frequent restarting of the process or the system can be avoided, the problem that continuous service cannot be provided for the service function caused by frequent restarting of the process or the system is further avoided, and the reliability of the system is improved.
Example two
The reset request processing method provided by the present invention can be applied to a multi-process operating system, and is shown in fig. 2, which is a schematic structural diagram of an application scenario of the reset request processing method provided by the second embodiment of the present invention.
In fig. 2, the operating system includes at least one service process 1-n, each service process 1 corresponds to a function detection module and a reset protection module, and a shared memory table maintained by the multi-process operating system records reset information of each process. The reset protection module comprises an event management module, a data processing module, a log recording module and a result execution module.
In specific implementation, taking the service process 1 as an example for explanation, when detecting that an exception occurs in the service process 1 or the service process 2 during operation, the function detection module 1 in the service process 1 sends the reset request to the event management module in the reset protection module of the process 1. And after receiving the reset request, the event management module firstly performs validity judgment on the parameters carried in the reset request and opens a mutual exclusion lock. And then sending the reset request to a logging module in a reset protection module of the process 1, and recording the reset request into a storage medium by the logging module so as to maintain the system for location tracking. On the other hand, the event management module sends the reset request to the data processing module in the reset protection module of the process 1, so that the data processing module reads all data from the shared memory table, performs data validity check first, and copies the data in the shared memory table to the shared memory table with a check failure or a small serial number based on the shared memory table with the correct serial number. And if the data in the two shared memory tables fail to be checked, resetting the shared memory tables and beginning to record the reset information of the reset process or the reset system again. After successfully verifying the shared memory table, the data processing module reads the restart times corresponding to the identification information from the correct shared memory table with a large serial number according to the identification information carried in the received reset request, and then counts the obtained times of the reset request carrying the identification information. When determining that the times are greater than a first threshold value corresponding to the request type, the data processing module returns a result of not executing the reset operation to the event management module, and the event management module forwards the result of not executing the reset operation to the function detection module 1 after receiving the result; if the number of times is determined to be not greater than the first threshold value, a result of executable reset operation is returned to the event management module, after the event management module receives the result of executable reset operation, a result execution module in a reset protection module of the process 1 is called to process the reset request, so that the result execution module executes a kill function to restart the service process 1 or the service process 2, and then the event management module releases a mutual exclusion lock.
Specifically, the function detection module is configured to initiate a reset request for resetting the process or another process when detecting that the process or another process corresponding to the function detection module is abnormal, or initiate a reset request for resetting the system.
And the event management module is used for receiving an event request which is sent by the function detection module and used for executing the reset of a certain process or resetting the system. In a multi-process operating system, the function detection module needs to call the event management module to trigger the operation of resetting a process or resetting a system.
And the data processing module is used for analyzing the reset information of a certain process or the reset information of the system in the shared memory table to judge whether to respond to the reset request of the certain process or the system required to be reset by the function detection module.
And the result execution module is used for executing the operation of resetting a certain process or the system. Therefore, when it is determined that the number of times of receiving the reset request of the same identification information exceeds the first threshold value within the first preset time, that is, the frequent reset phenomenon is indicated, the reset operation can not be executed on the reset request, so that frequent restart of the process or the system can be avoided, the problem that continuous service cannot be provided for the service function due to frequent restart of the process or the system can be further avoided, and the reliability of the system is improved.
EXAMPLE III
A third embodiment of the present invention is to describe a method for processing a reset request for a reset process on the basis of the second embodiment, and referring to fig. 3, a flow diagram of the method for processing a reset request for a reset process provided in the third embodiment of the present invention may include the following steps:
the first preset time for indicating the reset process is 5 minutes, the first threshold is 5 times, the second preset time is 5 minutes, the third preset time is 15 minutes, and the second threshold is 16 times.
1. The function detecting module 1 initiates a reset process request to the event management module.
In specific implementation, when detecting that the service process 1 provides service for the service 1, the function detection module 1 needs to start the process 2 of the service 2, and when finding that the function is not started successfully after starting the process 2 of the service 2, it is determined that the process 2 is abnormal, and the function detection module 1 sends a reset process request to the event management module corresponding to the reset process request, where the reset process request carries a process number of the process 2 to be reset, and a carried request type used for indicating the reset process and a reason for resetting the process 2.
Specifically, the event management module receives the reset process request sent by the function detection module 1 within 5 minutes.
2. And after the event management module passes the verification of the reset process request, opening a mutual exclusion lock.
In specific implementation, the reset process request is verified, and a specific verification method may refer to the related description in step S11 in the first embodiment, and repeated details are not described again.
3. And the event management module asynchronously sends a notice for recording the reset process request to the log recording module.
And 3.1, the log recording module records the reset progress request at regular time.
Specifically, after receiving the notification, the log recording module records the reset process request, and stores the reset process request in a storage medium for subsequent system maintenance personnel to track and position.
4. And the event management module sends a notice for processing the reset process request to the data processing module.
And 4.1, reading the shared memory table by the data processing module, and determining the times of acquiring the reset progress request within 5 minutes.
In specific implementation, the execution process of the data processing module may refer to the execution process of step S12 in the first embodiment, and repeated details are not repeated.
And 4.2, when the data processing module determines that the times exceed 5, returning a result of not executing the reset operation to the event management module.
4.3, the event management module returns the result of not executing the reset operation to the function detection module 1.
And 4.4, when the data processing module determines that the times are not more than 5, returning a result of executing the reset operation to the event management module.
5. The event management module sends an instruction for executing the reset operation to the result execution module.
And 5.1, executing a kill function by the result execution module to restart the process.
And 5.2, the result execution module returns the result of restarting the process to the event management module.
6. The event management module releases the mutex lock.
Specifically, the steps 4.2 and 4.4 are conditional execution steps, and only if the step 4.2 is executed, the step 4.3 is executed, and meanwhile, the steps 4.4 to 5.2 are not executed; similarly, only 4.4 steps 4.5-5.2 are executed, and simultaneously, the steps 4.2 and 4.3 are not executed.
Preferably, when the function detecting module sends the reset procedure request after 5 minutes, the processes shown in 7-12 are executed:
7. the function detecting module 1 initiates a reset process request to the event management module.
8. And after the event management module passes the verification of the reset process request, opening a mutual exclusion lock.
9. And the event management module asynchronously sends a notice for recording the reset process request to the log recording module.
9.1, the log recording module records the reset progress request at regular time.
10. And the event management module sends a notice for processing the reset process request to the data processing module.
10.1, the data processing module reads the shared memory table and determines the time of receiving the last reset progress request.
In specific implementation, the time of the last reset process request corresponding to the process number of the process 2 may be read from the shared memory table shown in table 1.
10.2, the data processing module determines the time difference between the time of receiving the reset process request and the time of the last reset process request.
In specific implementation, refer to the execution process shown in step S21 in the first embodiment, and repeated details are not repeated.
And 10.3, when the data processing module determines that the time difference exceeds 5 minutes, returning a result of executing the reset operation to the event management module.
11. The event management module sends an instruction for executing the reset operation to the result execution module.
11.1, the result execution module executes a kill function to restart the process.
11.2, the result execution module returns the result of restarting the process to the event management module.
12. The event management module releases the mutex lock.
Preferably, the processes shown in steps 13-18 can be further executed:
13. the function detecting module 1 initiates a reset process request to the event management module.
14. And after the event management module passes the verification of the reset process request, opening a mutual exclusion lock.
15. And the event management module asynchronously sends a notice for recording the reset process request to the log recording module.
15.1, the log recording module records the reset progress request at regular time.
16. And the event management module sends a notice for processing the reset process request to the data processing module.
And 16.1, reading the shared memory table by the data processing module, and counting the number of the reset requests of each process number within 15 minutes.
And 16.2, when the data processing module determines that the number exceeds 16 times, returning a result of directly resetting the system to the event management module.
In specific implementation, refer to the execution processes of steps S31-S32, and the repeated descriptions are omitted.
17. The event management module sends an indication to reset the system to the result execution module.
17.1, calling a rebot reset system by the result execution module.
17.2, the result execution module returns the result of restarting the system to the event management module.
18. The event management module releases the mutex lock.
Example four
As shown in fig. 4, a flowchart of a reset request processing method for a reset system according to a fourth embodiment of the present invention may include the following steps:
the first preset time for indicating the reset system is 7 days, the first threshold is 5 times, and the second preset time is 7 days.
1. The function detecting module 1 initiates a system resetting request to the event management module.
In specific implementation, when detecting that the service process 1 provides service for the service 1 and when discovering that an exception requiring a reset system exists in the running process, the function detection module 1 sends a reset system request to the corresponding event management module.
Specifically, the event management module receives the reset process request sent by the function detection module 1 within 7 days.
2. And after the request of the reset system is verified, the event management module opens a mutual exclusion lock.
3. And the event management module asynchronously sends a notice for recording the reset system request to the log recording module.
And 3.1, the log recording module records the reset system request at regular time.
Specifically, after receiving the notification, the log recording module records the reset system request, and stores the reset system request in a storage medium for subsequent system maintenance personnel to track and position.
4. And the event management module sends a notice for processing the reset system request to the data processing module.
In specific implementation, the request of the reset system is verified, and the specific verification method may refer to the related description in step S11 in the first embodiment, and repeated details are not described again.
And 4.1, reading the shared memory table by the data processing module, and determining the times of acquiring the reset system request within 7 days.
In specific implementation, the execution process of the data processing module may refer to the execution process of step S12 in the first embodiment, and repeated details are not repeated.
And 4.2, when the data processing module determines that the times exceed 5, returning a result of not executing the reset operation to the event management module.
4.3, the event management module returns the result of not executing the reset operation to the function detection module 1.
And 4.4, when the data processing module determines that the times are not more than 5, returning a result of executing the reset operation to the event management module.
5. The event management module sends an instruction for executing the reset operation to the result execution module.
And 5.1, calling a rebot to reset the system by the result execution module.
And 5.2, the result execution module returns the result of restarting the system to the event management module.
6. The event management module releases the mutex lock.
Specifically, the steps 4.2 and 4.4 are conditional execution steps, and only if the step 4.2 is executed, the step 4.3 is executed, and meanwhile, the steps 4.4 to 5.2 are not executed; similarly, only 4.4 steps 4.5-5.2 are executed, and simultaneously, the steps 4.2 and 4.3 are not executed.
Preferably, when the function detection module sends the reset procedure request 7 days later, the process shown in 7-12 is executed:
7. the function detecting module 1 initiates a system resetting request to the event management module.
8. And after the request of the reset system is verified, the event management module opens a mutual exclusion lock.
9. And the event management module asynchronously sends a notice for recording the reset system request to the log recording module.
9.1, the log recording module records the reset system request at regular time.
10. And the event management module sends a notice for processing the reset system request to the data processing module.
10.1, the data processing module reads the shared memory table and determines the time of receiving the last system resetting request.
In specific implementation, the time of the last system reset request corresponding to the identifier information of 0 may be read from the shared memory table shown in table 1.
10.2, the data processing module determines the time difference between the time of receiving the system resetting request and the time of last system resetting request.
In specific implementation, refer to the execution process shown in step S21 in the first embodiment, and repeated details are not repeated.
And 10.3, when the data processing module determines that the time difference exceeds 7 days, returning a result of executing the reset operation to the event management module.
11. The event management module sends an instruction for executing the reset operation to the result execution module.
11.1, calling rebot by the result execution module to reset the system.
11.2, the result execution module returns the result of restarting the system to the event management module.
12. The event management module releases the mutex lock.
EXAMPLE five
Based on the same inventive concept, the embodiment of the present invention further provides a device for processing a reset request, and because the principle of the device for solving the problem is similar to that of the method for processing the reset request, the implementation of the device may refer to the implementation of the method, and repeated details are not repeated.
As shown in fig. 5, a schematic structural diagram of a reset request processing apparatus according to a fifth embodiment of the present invention includes an obtaining unit 61, a first statistical unit 62, and a first processing unit 63, where:
an obtaining unit 61, configured to obtain a reset request, where the reset request carries a request type and identification information, and the request type is used to indicate a reset process or a reset system;
a first counting unit 62, configured to count the number of times of the obtained reset request carrying the identification information within a first preset time corresponding to the request type;
and the first processing unit 63 is configured to, when it is determined that the number of times is greater than the first threshold corresponding to the request type, not perform a reset operation on the current reset request.
Preferably, the apparatus further comprises:
a first determining unit, configured to determine a time difference between a time when the current reset request is received and a time when a previous reset request is received before the counting unit counts the number of times of the obtained reset requests carrying the identification information within a first preset time corresponding to the request type, where the previous reset request carries the identification information;
and the second determining unit is used for determining that the time difference is not greater than a second preset time.
Preferably, the first statistical unit 62 is specifically configured to obtain, from a stored shared memory table, the restart times corresponding to the identification information within a first preset time; and counting the times of the acquired reset requests carrying the identification information according to the restart times.
Preferably, the apparatus further comprises:
the second processing unit is used for executing the reset operation on the current reset request if the second determining unit determines that the time difference is greater than the second preset time;
and the clearing unit is used for clearing the restart times corresponding to the identification information in the shared memory table and recounting.
Preferably, if the request type is used to indicate a reset process, the identification information carried in the reset request is a process number of the process to be reset; and the apparatus, further comprising:
the second counting unit is used for counting the number of the reset requests carrying the process numbers in the third preset time;
and the restarting unit is used for directly restarting the system if the number exceeds a second threshold value.
For convenience of description, the respective parts of the above reset request processing apparatus are described separately in terms of functional division into respective modules (or units). Of course, the functionality of the various modules (or units) may be implemented in the same or in multiple pieces of software or hardware in practicing the invention.
EXAMPLE six
An embodiment of the present application provides a nonvolatile computer storage medium, where the computer storage medium stores computer-executable instructions, and the computer-executable instructions may execute the reset request processing method in any method embodiment.
EXAMPLE seven
Fig. 6 is a schematic diagram of a hardware structure of an electronic device implementing a reset request processing method according to a seventh embodiment of the present invention, and as shown in fig. 6, the electronic device includes:
one or more processors 710 and a memory 720, one processor 710 being illustrated in fig. 6.
The electronic device performing the reset request processing method may further include: an input device 730 and an output device 740.
The processor 710, the memory 720, the input device 730, and the output device 740 may be connected by a bus or other means, such as the bus connection in fig. 6.
The memory 720, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules/units (for example, the obtaining unit 61, the first statistical unit 62, and the first processing unit 63 shown in fig. 5) corresponding to the reset request processing method in the embodiment of the present application. The processor 710 executes various functional applications and data processing of the server or the smart terminal by running the nonvolatile software programs, instructions and modules/units stored in the memory 720, that is, implements the reset request processing method of the above-described method embodiment.
The memory 720 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the reset request processing apparatus, and the like. Further, the memory 720 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 720 may optionally include memory located remotely from processor 710, which may be connected to the reset request processing device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 730 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the reset request processing device. The output device 740 may include a display device such as a display screen.
The one or more modules are stored in the memory 720 and, when executed by the one or more processors 710, perform a reset request processing method in any of the method embodiments described above.
The product can execute the method provided by the embodiment of the application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in this embodiment, reference may be made to the methods provided in the embodiments of the present application.
The electronic device of the embodiments of the present application exists in various forms, including but not limited to:
(1) a mobile communication device: such devices are characterized by mobile communications capabilities and are primarily targeted at providing voice, data communications. Such terminals include smart phones (e.g., iphones), multimedia phones, functional phones, and low-end phones, among others.
(2) Ultra mobile personal computer device: the equipment belongs to the category of personal computers, has calculation and processing functions and generally has the characteristic of mobile internet access. Such terminals include: PDA, MID, and UMPC devices, etc., such as ipads.
(3) A portable entertainment device: such devices can display and play multimedia content. Such devices include audio and video players (e.g., ipods), handheld game consoles, electronic books, as well as smart toys and portable car navigation devices.
(4) A server: the device for providing the computing service comprises a processor, a hard disk, a memory, a system bus and the like, and the server is similar to a general computer architecture, but has higher requirements on processing capacity, stability, reliability, safety, expandability, manageability and the like because of the need of providing high-reliability service.
(5) And other electronic devices with data interaction functions.
Example eight
A computer program product is provided in this application embodiment five, wherein the computer program product comprises a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, wherein the program instructions, when executed by a computer, cause the computer to perform any one of the above method embodiments of the present application as a reset request processing method.
The reset request processing apparatus provided by the embodiment of the present application can be realized by a computer program. It should be understood by those skilled in the art that the above-mentioned module division is only one of many module division, and if the division into other modules or no division into modules is performed, it is within the scope of the present application as long as the reset request processing apparatus has the above-mentioned functions.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (8)

1. A reset request processing method, comprising:
acquiring a reset request, wherein the reset request carries a request type and identification information, and the request type is used for indicating a reset process or a reset system;
determining the time difference between the time of receiving the current reset request and the time of receiving the last reset request, wherein the last reset request carries the identification information;
determining that the time difference is not greater than second preset time, and counting the number of times of the acquired reset requests carrying the identification information within first preset time corresponding to the request types; and
when the number of times is determined to be larger than a first threshold value corresponding to the request type, the reset operation is not executed on the current reset request;
counting the number of reset requests carrying the process numbers in the third preset time;
and if the number exceeds a second threshold value, directly restarting the system.
2. The method according to claim 1, wherein counting the number of times of the acquired reset requests carrying the identification information within a first preset time corresponding to the request type specifically includes:
acquiring the restart times corresponding to the identification information within a first preset time from a stored shared memory table;
and counting the times of the acquired reset requests carrying the identification information according to the restart times.
3. The method of claim 2, wherein if the time difference is greater than the second predetermined time, the method further comprises:
executing reset operation on the current reset request; and are
And clearing the restart times corresponding to the identification information in the shared memory table and recounting.
4. A reset request processing apparatus, comprising:
the device comprises an acquisition unit, a reset unit and a processing unit, wherein the acquisition unit is used for acquiring a reset request, the reset request carries a request type and identification information, and the request type is used for indicating a reset process or a reset system;
the first counting unit is used for counting the times of the acquired reset requests carrying the identification information within a first preset time corresponding to the request types;
the first processing unit is used for not executing the reset operation on the current reset request when the frequency is determined to be greater than a first threshold value corresponding to the request type;
further comprising:
a first determining unit, configured to determine a time difference between a time when the current reset request is received and a time when a previous reset request is received before the counting unit counts the number of times of the obtained reset requests carrying the identification information within a first preset time corresponding to the request type, where the previous reset request carries the identification information;
a second determining unit, configured to determine that the time difference is not greater than a second preset time;
the device, still include:
the second counting unit is used for counting the number of the reset requests carrying the process numbers in the third preset time;
and the restarting unit is used for directly restarting the system if the number exceeds a second threshold value.
5. The apparatus of claim 4,
the first statistical unit is specifically configured to obtain, from a stored shared memory table, restart times within a first preset time and corresponding to the identification information; and counting the times of the acquired reset requests carrying the identification information according to the restart times.
6. The apparatus of claim 5, further comprising:
the second processing unit is used for executing the reset operation on the current reset request if the second determining unit determines that the time difference is greater than the second preset time;
and the clearing unit is used for clearing the restart times corresponding to the identification information in the shared memory table and recounting.
7. A non-transitory computer storage medium storing computer-executable instructions for performing the method of any one of claims 1 to 3.
8. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 3.
CN201711227768.2A 2017-11-29 2017-11-29 Reset request processing method, device and equipment Active CN108008800B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711227768.2A CN108008800B (en) 2017-11-29 2017-11-29 Reset request processing method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711227768.2A CN108008800B (en) 2017-11-29 2017-11-29 Reset request processing method, device and equipment

Publications (2)

Publication Number Publication Date
CN108008800A CN108008800A (en) 2018-05-08
CN108008800B true CN108008800B (en) 2022-02-15

Family

ID=62054928

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711227768.2A Active CN108008800B (en) 2017-11-29 2017-11-29 Reset request processing method, device and equipment

Country Status (1)

Country Link
CN (1) CN108008800B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112702183A (en) * 2019-10-22 2021-04-23 中兴通讯股份有限公司 Method and device for controlling software version rollback of base station, base station and readable storage medium
CN113238678A (en) * 2021-05-18 2021-08-10 北京集创北方科技股份有限公司 Control device, time sequence control circuit, control method, chip and electronic equipment

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104331357A (en) * 2014-10-10 2015-02-04 北京金山安全软件有限公司 Application program abnormity detection method and device and mobile terminal

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100416458C (en) * 2005-12-09 2008-09-03 中兴通讯股份有限公司 Resetting method for preventing system from dead to stop operation by associating software and hardware
US20100004949A1 (en) * 2008-07-03 2010-01-07 Impulse Monitoring, Inc. Method, system, and computer program product for receiving, extracting, and translating intraoperative neurophysiologic monitoring (ionm) data from multiple device types
CN101751330A (en) * 2008-12-22 2010-06-23 华为技术有限公司 Method and device for controlling frequent resetting of embedded software
CN102932387A (en) * 2011-08-10 2013-02-13 北大方正集团有限公司 Equipment operation maintenance method and device
CN102984500B (en) * 2012-10-26 2016-09-14 杭州天视智能系统有限公司 A kind of methods, devices and systems realizing various video monitoring device compatibility
CN104636221B (en) * 2013-11-12 2020-03-17 研祥智能科技股份有限公司 Computer system fault processing method and device
CN105376775B (en) * 2015-11-24 2018-05-29 广东欧珀移动通信有限公司 Processing method, application processor and the mobile terminal of network communicating function exception

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104331357A (en) * 2014-10-10 2015-02-04 北京金山安全软件有限公司 Application program abnormity detection method and device and mobile terminal

Also Published As

Publication number Publication date
CN108008800A (en) 2018-05-08

Similar Documents

Publication Publication Date Title
KR102469267B1 (en) Blockchain consensus method, accounting node and node
CN107015991B (en) Self-checking method, device and system for data consistency and service device
CN102929696B (en) A kind of distributed system Centroid structure, submission, method for supervising and device
CN111177165B (en) Method, device and equipment for detecting data consistency
CN109388556B (en) Method and device for analyzing test process
CN108008800B (en) Reset request processing method, device and equipment
CN109218407B (en) Code management and control method based on log monitoring technology and terminal equipment
CN109815697B (en) Method and device for processing false alarm behavior
CN109324959B (en) Method for automatically transferring data, server and computer readable storage medium
CN110851294B (en) Method and device for remedying program running crash
CN108415768B (en) Data batch processing method and system
CN113037774B (en) Security management method, device, equipment and machine readable storage medium
US20220401825A1 (en) Alarm method and apparatus for tabletop game, electronic device and storage medium
CN112256593B (en) Program processing method and device, computer equipment and readable storage medium
CN111342986A (en) Distributed node management method and device, distributed system and storage medium
CN111880947A (en) Data transmission method and device
CN115391059A (en) Data playback method and device, computer equipment and computer readable storage medium
CN107291575B (en) Processing method and equipment for data center fault
CN113850664A (en) Data anomaly detection method and data reporting service
CN115599310B (en) Method and device for controlling storage resources in storage node and storage node
CN105511848A (en) Method and device for detecting DLL
US10257269B2 (en) Selectively disabling operation of hardware components based on network changes
CN112596935B (en) OSD (on-screen display) fault processing method and device
CN114168947B (en) Attack detection method and device, electronic equipment and storage medium
JP6896035B2 (en) Monitoring system, monitoring SaaS provider, management device, and program

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