CN114816813A - Driver control method and device - Google Patents

Driver control method and device Download PDF

Info

Publication number
CN114816813A
CN114816813A CN202210292462.XA CN202210292462A CN114816813A CN 114816813 A CN114816813 A CN 114816813A CN 202210292462 A CN202210292462 A CN 202210292462A CN 114816813 A CN114816813 A CN 114816813A
Authority
CN
China
Prior art keywords
driver
abnormal
driving
equipment
drive
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.)
Granted
Application number
CN202210292462.XA
Other languages
Chinese (zh)
Other versions
CN114816813B (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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202210292462.XA priority Critical patent/CN114816813B/en
Publication of CN114816813A publication Critical patent/CN114816813A/en
Application granted granted Critical
Publication of CN114816813B publication Critical patent/CN114816813B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Debugging And Monitoring (AREA)
  • Hardware Redundancy (AREA)

Abstract

The invention provides a method and a device for controlling a driving program, and relates to the technical field of servers. The method comprises the following steps: monitoring the first driving program and judging whether the first driving program is abnormal or not; when the first driving program is abnormal, stopping the operation of the first driving program and the second driving program; converting the driving object of the second driving program from the second equipment into the first equipment, and converting the driving object of the first driving program from the first equipment into the second equipment; and updating the first driver and the first equipment, and synchronously sending an operation instruction to the updated first driver and the updated second driver, wherein the operation instruction is respectively used for driving the second equipment and the updated first equipment. By implementing the drive program control method disclosed by the invention, transient faults of hardware equipment can be corrected in time, the fault tolerance rate and reliability of the system are improved, and the method is particularly suitable for systems with high stability requirements.

Description

Driver control method and device
Technical Field
The present invention relates to the field of server technologies, and in particular, to a method and an apparatus for controlling a driver.
Background
The device driver is the door to the world of Linux kernel and plays a special role in Linux kernel. The device driver is a specific hardware internal programming interface in the operating system, and completely hides the working details of the device. In modern operating systems, the proportion of device driver code is higher than 70%.
Hardware faults can cause system operation abnormity, most hardware faults are transient, and transient errors can occur to hardware devices for various reasons. For example: electromagnetic interference or radiation, etc. Reports from hardware device manufacturers indicate that: most returned devices are detected as normal. If a hardware device fails to execute a command, re-execution of the same command will return to normal in most cases.
When the device driver executes a command and the hardware device fails to cause the device driver to be abnormal, if the device driver can be timely restored to the state before the command is executed, the device driver can request the hardware device to execute the command again, and the normal operation of the system can be maintained under most conditions. Therefore, the fault of the hardware equipment cannot be detected by the application program and the operating system, so that the fault tolerance of the hardware fault is realized, and the reliability of the system is improved.
Therefore, there is a need for a driver control method, when a device driver executes a command and a hardware device failure occurs to cause an abnormality of the device driver, controlling the device driver to recover to a state before the command is executed in time, and then controlling the device driver to request the hardware device to execute the command again to obtain a correct result, thereby solving the problem of system operation abnormality caused by a transient failure of the hardware device.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for controlling a driver, so as to overcome the problem in the prior art that a system is abnormally operated due to a transient failure of a hardware device.
In order to solve one or more of the above technical problems, the technical solution adopted by the present invention is as follows:
in a first aspect, a driver control method is provided, including:
monitoring a first driver and judging whether the first driver is abnormal or not, wherein the first driver is used for driving first equipment;
when the first driver is abnormal, stopping the running of the first driver and a second driver, wherein the second driver is used for driving a second device;
converting the driving object of the second driving program from the second equipment into the first equipment, and converting the driving object of the first driving program from the first equipment into the second equipment;
and updating the first driver and the first equipment, and synchronously sending an operation instruction to the updated first driver and the updated second driver, wherein the operation instruction is respectively used for driving the second equipment and the updated first equipment.
Further, converting the driver object of the second driver from the second device to the first device, and converting the driver object of the first driver from the first device to the second device comprises:
and changing the preset data item in the management device driving data structure, so that the driving object of the second driving program is converted into the first device from the second device, and simultaneously, the driving object of the first driving program is converted into the second device from the first device.
Further, updating the first driver and the first device includes:
copying an instruction state value and a data value in a register of the second device, and overwriting the instruction state value and the data value corresponding to the first driver;
and copying the instruction state value and the data value carried by the second driver to corresponding positions in a register of the first device.
Further, before monitoring the first driver and determining whether the first driver is abnormal, the method further includes:
counting the abnormal conditions of the first driving program to obtain historical abnormal counting results;
judging whether to start a driver control method or not according to a historical abnormal statistical result and an abnormal monitoring strategy;
if yes, starting a drive program control method;
if not, the driver control method is not enabled.
Further, the statistics of the abnormal conditions of the first driver includes:
the abnormal condition of the driver is at least divided into: a first abnormal condition, a second abnormal condition;
in the abnormal condition of the driver, counting the number of the first abnormal condition to obtain a first abnormal number;
in the abnormal condition of the driver, counting the number of the second abnormal conditions to obtain a second abnormal number;
the historical anomaly statistics include: the number of the first abnormal conditions and the corresponding first abnormal conditions, and the number of the second abnormal conditions and the corresponding second abnormal conditions.
Further, the method for judging whether to start the driver control according to the historical abnormal statistical result and the abnormal monitoring strategy comprises the following steps:
if the first abnormal quantity exceeds a first threshold value or the second abnormal quantity exceeds a second threshold value, judging whether the result of starting the drive program control method is 'yes';
if the first abnormal quantity does not exceed the first threshold value and the second abnormal quantity does not exceed the second threshold value, judging whether the result of starting the drive program control method is negative;
wherein, the abnormal monitoring strategy at least comprises: a first threshold corresponding to a first abnormal condition, and a second threshold corresponding to a second abnormal condition.
Further, the method for counting the abnormal situations of the first driver further comprises the following steps before obtaining the historical abnormal counting result:
and synchronously sending an operation instruction to the first driver and the second driver.
Further, the synchronous sending of the operation instruction to the first driver and the second driver includes:
after the operation instruction is obtained, copying the operation instruction, sending one part of the operation instruction to a first driver, and sending the other part of the operation instruction to a second driver;
saving an instruction state value and a data value generated after the second device executes the operation instruction into a register of the second device;
and receiving the return data generated after the first device and the second device execute the operation instruction, and using only the return data of the first device for external data exchange.
Further, a driver control method further includes: recording a system operation log for optimizing an abnormal monitoring strategy;
wherein the system operation log at least comprises: the number of times the method is executed, and the time at which the method is executed.
In a second aspect, a driver control apparatus includes: the system comprises an anomaly monitoring module, a drive stopping module, a drive converting module and a drive updating module;
the abnormality monitoring module is used for monitoring the first driving program and judging whether the first driving program is abnormal or not;
the drive stopping module is used for stopping the running of the first drive program and the second drive program;
the drive conversion module is used for converting the drive object of the second drive program from the second equipment into the first equipment and converting the drive object of the first drive program from the first equipment into the second equipment;
and the drive updating module is used for updating the first drive program and the first equipment and synchronously sending an operation instruction to the updated first drive program and the updated second drive program.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
1. by implementing the drive program control method disclosed by the invention, transient faults of hardware equipment can be corrected in time, the fault tolerance rate and reliability of the system are improved, and the method is particularly suitable for systems with high stability requirements;
2. the register of the second device stores the same instruction and execution data as the first device, and when the first driver program is abnormal, the program abnormality can be recovered in time;
3. transient faults of the hardware equipment are solved in time, and hardware maintenance cost caused by return of the hardware equipment to a factory for maintenance due to the fact that the transient faults of the hardware equipment cannot be solved in time is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram of a driver control method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a driver control apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are only a part of examples of the present invention, and not all examples. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Unless otherwise defined, technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this disclosure belongs. The use of "first," "second," and the like in this disclosure is not intended to indicate any order, quantity, or importance, but rather is used to distinguish one element from another. Also, the use of the terms "a," "an," or "the" and similar referents do not denote a limitation of quantity, but rather denote the presence of at least one. The reference numerals in the drawings in the specification merely indicate the distinction between the respective functional components or modules, and do not indicate the logical relationship between the components or modules. The word "comprising" or "comprises", and the like, means that the element or item listed before the word covers the element or item listed after the word and its equivalents, but does not exclude other elements or items. The terms "connected" or "coupled" and the like are not restricted to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "upper", "lower", "left", "right", and the like are used merely to indicate relative positional relationships, and when the absolute position of the object being described is changed, the relative positional relationships may also be changed accordingly.
Hereinafter, various embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. It is to be noted that, in the drawings, the same reference numerals are given to constituent parts having substantially the same or similar structures and functions, and repeated description thereof will be omitted.
The embodiment of the invention discloses a method and a device for controlling a driver, aiming at the problem that the system operation is abnormal due to temporary faults of hardware equipment in a server system, and the method and the device can timely eliminate the temporary faults of the hardware equipment and repair the driver of corresponding equipment so as to ensure the normal operation of the system, and the specific technical scheme is as follows:
in one embodiment, as shown in fig. 1, a driver control method includes:
step S100: monitoring a first driver and judging whether the first driver is abnormal or not, wherein the first driver is used for driving first equipment;
step S200: when the first driver is abnormal, stopping the running of the first driver and a second driver, wherein the second driver is used for driving a second device;
step S300: converting the driving object of the second driving program from the second equipment into the first equipment, and converting the driving object of the first driving program from the first equipment into the second equipment;
step S400: and updating the first driver and the first device, and synchronously sending an operation instruction to the updated first driver and the updated second driver, wherein the operation instruction is respectively used for driving the second device and the updated first device.
Step S100: and monitoring the first driving program and judging whether the first driving program is abnormal or not.
Specifically, the controller detects whether a driver exception caused by a hardware device failure occurs in the first driver. Common driver exceptions caused by hardware device failures mainly include: function parameter errors, function return value errors, pointer reference errors, except zero errors, accessing illegal memory pages, releasing released memory, unlocking unlocked spin locks and the like.
The first device refers to a real hardware device, such as a real network card, a real display card, a real sound card, and the like;
the first driver is a device driver operating on the viewing hardware device.
Step S200: and when the first driver is abnormal, stopping the running of the first driver and a second driver, wherein the second driver is used for driving a second device.
Specifically, when the controller monitors that the first driver is abnormal, the controller detects that the first driver is abnormal. The controller immediately suspends the operation of the first driver and the second driver.
The second device refers to a simulation device written according to the hardware device specification;
the second driver is a backup of the device driver operating on the real hardware device, and the backup driver operates on the simulation device.
And stopping the first driver and the second driver, optionally, by sending a stop identifier to the drivers by the controller. And the first driver and the second driver suspend operation immediately after receiving the stop identifier contained in the operation instruction. Furthermore, the first driver program is suspended to cause the first equipment to suspend executing the action contained in the current operation instruction; the second driver is suspended from running, which causes the second device to suspend performing the action contained in the current operation instruction. Meanwhile, the instruction state value, the abort identifier, and the data value (including but not limited to the current state data of the corresponding device) will be saved in the register of the corresponding device. Namely, the register of the first device stores the instruction state value, the suspension identifier and the data value of the first driver; the register of the second device stores the instruction state value, the pause identifier and the data value of the second driver.
Step S300: and converting the driving object of the second driver from the second device into the first device, and converting the driving object of the first driver from the first device into the second device.
Specifically, the method comprises the following steps: the controller changes the preset data item in the management device driving data structure, so that the driving object of the second driving program is converted into the first device from the second device, and simultaneously, the driving object of the first driving program is converted into the second device from the first device.
Preferably, a data item is added to the main data structure body of the Linux operating system kernel managing the device driver, and the controller can control the driver to work on the first device or the second device by modifying the data item. Correspondingly, the first driver can be controlled to work on the first device or the second device by changing the data item in the data structure body for managing the first driver; the second driver may be controlled to operate on the second device or the first device by modifying the data item in the data structure that manages the second driver.
By the method, the modified code amount of the device driver can be reduced, and the influence of the device driver and the hardware device performance can be reduced. The data item may also be used to identify whether the driver is a first driver or a second driver.
Step S400: and updating the first driver and the first equipment, and synchronously sending an operation instruction to the updated first driver and the updated second driver, wherein the operation instruction is respectively used for driving the second equipment and the updated first equipment.
Specifically, updating the first driver and the first device includes:
copying an instruction state value and a data value in a register of the second device, and overwriting the instruction state value and the data value corresponding to the first driver;
and copying the instruction state value and the data value carried by the second driver to corresponding positions in a register of the first device.
At the moment, the controller refreshes the first driving program to enable the first driving program and the second driving program to be synchronous; and the controller restores the running state of the first device to a normal state according to the instruction state value and the data value in the second device register.
Since the registers of the second device hold the correct instruction state values and data values. The controller copies the command state values and data values in the registers of the second device and overwrites the command state values and data values corresponding to the first driver.
And the running state of the first device is restored to a normal state, and the controller copies the instruction state value and the data value carried by the second driver program to corresponding positions in the register of the first device.
This process can be understood as: the controller initializes the first driver and the first device using the second device and the second driver, respectively. And the initialized parameters are instruction state values and data values which are correctly recorded by the second equipment and the second driver when the first driver is abnormal due to the failure of the first equipment.
After the updating is finished, the controller receives an operation instruction request sent by the driving program; and after receiving the operation instruction request, the controller synchronously sends operation instructions to the first driver and the second driver, wherein the operation instructions are respectively used for driving the second equipment and the updated first equipment.
Step S100: before monitoring the first driver and judging whether the first driver is abnormal, the method further comprises the following steps:
step S010: and counting the abnormal conditions of the first driving program to obtain historical abnormal counting results.
Specifically, the statistics of the abnormal condition of the first driver includes:
the abnormal conditions of the driver are at least divided into: a first abnormal condition, a second abnormal condition;
in the abnormal condition of the driver, counting the number of the first abnormal condition to obtain a first abnormal number;
in the abnormal condition of the driver, counting the number of the second abnormal conditions to obtain a second abnormal number;
the historical anomaly statistics include: the number of the first abnormal conditions and the corresponding first abnormal conditions, and the number of the second abnormal conditions and the corresponding second abnormal conditions.
Step S011: and judging whether to start a drive program control method according to the historical abnormal statistical result and the abnormal monitoring strategy.
Specifically, the method for judging whether to start the driver control according to the historical abnormal statistical result and the abnormal monitoring strategy comprises the following steps:
if the first abnormal quantity exceeds a first threshold value or the second abnormal quantity exceeds a second threshold value, judging whether the result of starting the drive program control method is 'yes';
if the first abnormal quantity does not exceed the first threshold value and the second abnormal quantity does not exceed the second threshold value, judging whether the result of starting the drive program control method is negative;
wherein, the abnormal monitoring strategy at least comprises: a first threshold corresponding to a first abnormal condition, and a second threshold corresponding to a second abnormal condition.
Step S012: if yes, starting the drive program control method;
step S012': if not, the driver control method is not started.
Through the execution of the steps, the controller can automatically select the gas cylinder according to the abnormal monitoring strategy when the error is accumulated to the critical condition in the running process of the system.
Step S010: the method for counting the abnormal conditions of the first driver program further comprises the following steps before obtaining historical abnormal counting results:
step S001: and synchronously sending an operation instruction to the first driver and the second driver.
Specifically, the step of synchronously sending the operation instruction to the first driver and the second driver includes:
after the operation instruction is obtained, copying the operation instruction, sending one part of the operation instruction to a first driver, and sending the other part of the operation instruction to a second driver;
saving an instruction state value and a data value generated after the second device executes the operation instruction into a register of the second device;
and receiving the return data generated after the first device and the second device execute the operation instruction, and using only the return data of the first device for external data exchange.
Therefore, the two devices can obtain the same instruction state value and data value under the same operation instruction and can be stored in respective registers in normal operation.
Only the return data (such as return value) of the first device is used for external data exchange, so that the system can not identify the second device, and the code quantity required to be modified by carrying two sets of drivers and devices simultaneously by the system is reduced.
The driver control method further includes:
step S5: and recording a system operation log.
Specifically, a system operation log is recorded for optimizing an anomaly monitoring strategy.
The system operation log at least comprises: the number of times the method is performed, the time at which the method is performed.
Alternatively, the system operation log may further include: globally unique parameters such as serial number, timestamp and exception type; it can also be used to collect the number of times a certain type of error occurs each day, in a certain time period, etc.
And recording in a log mode, recording the number/time of the generated errors and the switching times, and analyzing different dimensions such as the number of errors, the error proportion, the switching times and the like to obtain the distribution condition of the hardware equipment and the equipment driving errors so as to further optimize an abnormality monitoring strategy.
In another embodiment, as shown in fig. 2, a driver control apparatus includes: an anomaly monitoring module 10, a drive stopping module 20, a drive converting module 30 and a drive updating module 40;
the abnormality monitoring module 10 is configured to monitor the first driver and determine whether the first driver is abnormal;
a drive suspending module 20, configured to suspend operations of the first driver and the second driver;
the driver conversion module 30 is configured to convert the driving object of the second driver from the second device to the first device, and convert the driving object of the first driver from the first device to the second device;
and the drive updating module 40 is configured to update the first driver and the first device, and send an operation instruction to the updated first driver and the updated second driver synchronously.
All the above-mentioned optional technical solutions can be combined arbitrarily to form the optional embodiments of the present invention, and are not described herein again.
Example one
The embodiment discloses a method for controlling a driver, which comprises the following steps:
step S001: and synchronously sending an operation instruction to the first driver and the second driver.
After the operation instruction is obtained, copying the operation instruction, sending one part of the operation instruction to a first driver, and sending the other part of the operation instruction to a second driver;
saving an instruction state value and a data value generated after the second device executes the operation instruction into a register of the second device;
and receiving the return data generated after the first device and the second device execute the operation instruction, and using only the return data of the first device for external data exchange.
Step S010: and counting the abnormal conditions of the first driving program to obtain historical abnormal counting results.
The abnormal condition of the driver is at least divided into: a first abnormal condition, a second abnormal condition;
in the abnormal condition of the driver, counting the number of the first abnormal condition to obtain a first abnormal number;
in the abnormal condition of the driver, counting the number of the second abnormal conditions to obtain a second abnormal number;
the historical anomaly statistics include: the number of the first abnormal conditions and the corresponding first abnormal conditions, and the number of the second abnormal conditions and the corresponding second abnormal conditions.
Step S011: and judging whether to start a drive program control method according to the historical abnormal statistical result and the abnormal monitoring strategy.
If the first abnormal quantity exceeds a first threshold value or the second abnormal quantity exceeds a second threshold value, judging whether the result of starting the drive program control method is 'yes';
if the first abnormal quantity does not exceed the first threshold value and the second abnormal quantity does not exceed the second threshold value, the result of judging whether to start the drive program control method is 'no'.
Step S012: if yes, starting the drive program control method;
step S012': if not, the driver control method is not started.
Step S100: and monitoring the first driving program and judging whether the first driving program is abnormal or not.
Whether the first driver program has the driver program abnormity caused by the hardware equipment failure is detected. The method comprises the following steps: function parameter errors, function return value errors, pointer reference errors, except zero errors, accessing illegal memory pages, releasing released memory, unlocking unlocked spin locks and the like.
Step S200: and when the first driver is abnormal, stopping the operation of the first driver and the second driver.
And stopping the first driver and the second driver in a mode that the controller sends a stopping identifier to the drivers. And the first driver and the second driver suspend operation immediately after receiving the stop identifier contained in the operation instruction. Furthermore, the first driver program is suspended to cause the first equipment to suspend executing the action contained in the current operation instruction; the second driver is suspended from running, which causes the second device to suspend performing the action contained in the current operation instruction. Meanwhile, the instruction state value, the abort identifier, and the data value (including but not limited to the current state data of the corresponding device) will be saved in the register of the corresponding device. Namely, the register of the first device stores the instruction state value, the suspension identifier and the data value of the first driver; the register of the second device stores the instruction state value, the suspension identifier and the data value of the second driver.
Step S300: and converting the driving object of the second driver from the second device into the first device, and converting the driving object of the first driver from the first device into the second device.
And changing the preset data item in the management device driving data structure, so that the driving object of the second driving program is converted into the first device from the second device, and simultaneously, the driving object of the first driving program is converted into the second device from the first device.
Step S400: and updating the first driver and the first device, and synchronously sending an operation instruction to the updated first driver and the updated second driver, wherein the operation instruction is respectively used for driving the second device and the updated first device.
Copying an instruction state value and a data value in a register of the second device, and overwriting the instruction state value and the data value corresponding to the first driver;
and copying the instruction state value and the data value carried by the second driver to corresponding positions in a register of the first device.
At the moment, the controller refreshes the first driving program to enable the first driving program and the second driving program to be synchronous; and the controller restores the running state of the first device to a normal state according to the instruction state value and the data value in the second device register.
Since the registers of the second device hold the correct instruction state values and data values. The controller copies the command state values and data values in the registers of the second device and overwrites the command state values and data values corresponding to the first driver.
And the running state of the first device is restored to a normal state, and the controller copies the instruction state value and the data value carried by the second driver program to corresponding positions in the register of the first device.
After the updating is finished, the controller receives an operation instruction request sent by the driving program; and after receiving the operation instruction request, the controller synchronously sends operation instructions to the first driver and the second driver, wherein the operation instructions are respectively used for driving the second equipment and the updated first equipment.
Step S5: and recording a system operation log for optimizing an abnormal monitoring strategy.
Example two
As shown in fig. 2, the present embodiment discloses a driver control apparatus, including: an anomaly monitoring module 10, a drive stopping module 20, a drive converting module 30 and a drive updating module 40;
the abnormality monitoring module 10 is configured to monitor the first driver and determine whether the first driver is abnormal;
a drive suspending module 20, configured to suspend operations of the first driver and the second driver;
the driver conversion module 30 is configured to convert the driving object of the second driver from the second device to the first device, and convert the driving object of the first driver from the first device to the second device;
and the drive updating module 40 is configured to update the first driver and the first device, and send an operation instruction to the updated first driver and the updated second driver synchronously.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program loaded on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means, or installed from the memory, or installed from the ROM. The computer program, when executed by an external processor, performs the above-described functions defined in the methods of embodiments of the present application.
It should be noted that the computer readable medium of the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In embodiments of the present application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the server; or may exist separately and not be assembled into the server. The computer readable medium carries one or more programs which, when executed by the server, cause the server to: when the peripheral mode of the terminal is detected to be not activated, acquiring a frame rate of an application on the terminal; when the frame rate meets the screen information condition, judging whether a user is acquiring the screen information of the terminal; and controlling the screen to enter an immediate dimming mode in response to the judgment result that the user does not acquire the screen information of the terminal.
Computer program code for carrying out operations for embodiments of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the system or system embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described system and system embodiments are only illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The technical solutions provided by the present application are introduced in detail, and specific examples are applied in the description to explain the principles and embodiments of the present application, and the descriptions of the above examples are only used to help understanding the method and the core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, the specific embodiments and the application range may be changed. In view of the above, the description should not be taken as limiting the application.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (10)

1. A driver control method, the method comprising:
monitoring a first driver and judging whether the first driver is abnormal or not, wherein the first driver is used for driving first equipment;
when the first driver is abnormal, stopping running of the first driver and a second driver, wherein the second driver is used for driving a second device;
converting the driving object of the second driver from the second device to the first device, and converting the driving object of the first driver from the first device to the second device;
and updating the first driver and the first equipment, and synchronously sending an operation instruction to the updated first driver and the updated second driver, wherein the operation instruction is respectively used for driving the second equipment and the updated first equipment.
2. The method according to claim 1, wherein converting the driver object of the second driver from the second device to the first device, and converting the driver object of the first driver from the first device to the second device comprises:
and changing preset data items in a management device driving data structure body, converting the driving object of the second driving program from the second device to the first device, and simultaneously converting the driving object of the first driving program from the first device to the second device.
3. The driver control method according to claim 1, wherein the updating the first driver and the first device includes:
copying an instruction state value and a data value in a register of the second device, and overwriting the instruction state value and the data value corresponding to the first driver;
and copying the instruction state value and the data value carried by the second driver to corresponding positions in a register of the first device.
4. The driver control method according to claim 1, wherein before monitoring the first driver and determining whether the first driver is abnormal, the method further comprises:
counting the abnormal conditions of the first driving program to obtain historical abnormal counting results;
judging whether to start the drive program control method or not according to the historical abnormal statistical result and an abnormal monitoring strategy;
if yes, starting the drive program control method;
if not, the driver control method is not enabled.
5. The driver control method according to claim 4, wherein the counting the abnormal situations of the first driver and obtaining the historical abnormal statistical results comprises:
the abnormal condition of the driver is at least divided into: a first abnormal condition, a second abnormal condition;
in the abnormal condition of the driver, counting the number of the first abnormal conditions to obtain a first abnormal number;
in the abnormal condition of the driver, counting the number of the second abnormal conditions to obtain a second abnormal number;
the historical anomaly statistics include: the first abnormal condition and the corresponding first abnormal condition number, and the second abnormal condition and the corresponding second abnormal condition number.
6. The method of claim 4, wherein determining whether to enable the driver control method according to the historical exception statistics and an exception monitoring policy comprises:
if the first abnormal quantity exceeds a first threshold value or the second abnormal quantity exceeds a second threshold value, the result of judging whether to start the drive program control method is yes;
if the first abnormal quantity does not exceed the first threshold value and the second abnormal quantity does not exceed the second threshold value, the result of judging whether to start the drive program control method is negative;
wherein the anomaly monitoring policy at least comprises: a first threshold corresponding to a first abnormal condition, and a second threshold corresponding to a second abnormal condition.
7. The method according to claim 4, wherein the counting the abnormal situations of the first driver and obtaining the historical abnormal statistical result further comprises:
and synchronously sending an operation instruction to the first driver and the second driver.
8. The driver control method according to claim 7, wherein said sending the operation instruction to the first driver and the second driver synchronously comprises:
after the operation instruction is obtained, copying the operation instruction, sending one part of the operation instruction to a first driver, and sending the other part of the operation instruction to a second driver;
saving an instruction state value and a data value generated after the second device executes the operation instruction into a register of the second device;
and receiving the return data generated after the first device and the second device execute the operation instruction, and using only the return data of the first device for external data exchange.
9. The driver control method according to claim 1, further comprising: recording a system operation log for optimizing an abnormal monitoring strategy;
wherein the system operation log at least comprises: the number of times the method is performed, the time at which the method is performed.
10. A driver control apparatus, comprising: the system comprises an anomaly monitoring module, a drive stopping module, a drive converting module and a drive updating module;
the abnormality monitoring module is used for monitoring a first driver and judging whether the first driver is abnormal or not;
the drive stopping module is used for stopping the running of the first drive program and the second drive program;
the drive conversion module is used for converting the drive object of the second driver from second equipment to first equipment and converting the drive object of the first driver from the first equipment to the second equipment;
the drive updating module is used for updating the first drive program and the first equipment and synchronously sending an operation instruction to the updated first drive program and the updated second drive program.
CN202210292462.XA 2022-03-23 2022-03-23 Driver control method and device Active CN114816813B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210292462.XA CN114816813B (en) 2022-03-23 2022-03-23 Driver control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210292462.XA CN114816813B (en) 2022-03-23 2022-03-23 Driver control method and device

Publications (2)

Publication Number Publication Date
CN114816813A true CN114816813A (en) 2022-07-29
CN114816813B CN114816813B (en) 2024-06-25

Family

ID=82531340

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210292462.XA Active CN114816813B (en) 2022-03-23 2022-03-23 Driver control method and device

Country Status (1)

Country Link
CN (1) CN114816813B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710444A (en) * 2018-12-26 2019-05-03 九逸(北京)信息技术有限公司 The method and relevant device of the abnormality processing of intelligent hospital information system
CN112395121A (en) * 2019-08-15 2021-02-23 奇安信安全技术(珠海)有限公司 Drive loading processing method and device, storage medium and computer equipment
CN112631661A (en) * 2020-12-16 2021-04-09 中国电子信息产业集团有限公司 Program safety control method, device, equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710444A (en) * 2018-12-26 2019-05-03 九逸(北京)信息技术有限公司 The method and relevant device of the abnormality processing of intelligent hospital information system
CN112395121A (en) * 2019-08-15 2021-02-23 奇安信安全技术(珠海)有限公司 Drive loading processing method and device, storage medium and computer equipment
CN112631661A (en) * 2020-12-16 2021-04-09 中国电子信息产业集团有限公司 Program safety control method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN114816813B (en) 2024-06-25

Similar Documents

Publication Publication Date Title
CN103201724B (en) Providing application high availability in highly-available virtual machine environments
US20150052402A1 (en) Cloud Deployment Infrastructure Validation Engine
CN107634860B (en) Method for automatically upgrading weblogic cluster patches in batches
US20120042198A1 (en) Lpar creation and repair for automated error recovery
CN109144701A (en) A kind of task flow management method, device, equipment and system
US8959505B2 (en) Updating elements in data storage facility using predefined state machine over extended time period
CN114816813B (en) Driver control method and device
US9953293B2 (en) Method for controlling changes of replication directions in a multi-site disaster recovery environment for high available application
CN105988885B (en) Operating system failure self-recovery method based on compensation rollback
CN109116818B (en) Real-time data dump method and device during SCADA system upgrade
CN116149954A (en) Intelligent operation and maintenance system and method for server
CN115543377A (en) ERP system upgrading method based on artificial intelligence and ERP system
CN111682987B (en) Real vehicle environment simulation and rapid test system based on OSEK NM
CN110287066B (en) Server partition migration method and related device
US20040064784A1 (en) Document management system, method and computer program
CN111951489B (en) Intelligent cabinet batch flashing method, device, equipment and storage medium
JP3596744B2 (en) Resource use status monitoring control method and recording medium recording the program
CN116389226A (en) Cloud server diagnosis method, computer cluster system, electronic equipment and medium
KR19990000937A (en) How to replace operating program and database in private exchange
CN114528156A (en) Database switching method of heterogeneous disaster tolerance scheme, electronic device and medium
CN115223343A (en) Control method, device, system, equipment and storage medium
CN117762740A (en) Method, system, equipment and medium for data security monitoring
CN116302143A (en) Process hot upgrading method and device, storage medium and electronic equipment
CN113515400A (en) Abnormity monitoring method and device for key information infrastructure
CN115755837A (en) Equipment defect prediction method and system

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