A fault processing method, apparatus, device, and medium
By acquiring device information and using the source code of the target model to automatically detect fault types and generate repair strategies, the problem of relying on manual analysis for BIOS adaptation device fault handling is solved, and efficient fault repair is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INSPUR SUZHOU INTELLIGENT TECH CO LTD
- Filing Date
- 2023-04-11
- Publication Date
- 2026-07-24
AI Technical Summary
In existing technologies, troubleshooting BIOS adapter devices relies on manual analysis, which results in high consumption of manpower and resources and low efficiency.
By acquiring equipment information and using the target model, the system automatically detects equipment fault types and generates source code for repair strategies, thereby enabling the automatic writing of fault repair operations.
This reduces the reliance on manual analysis in the fault handling process and improves fault handling efficiency.
Smart Images

Figure CN116361054B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of server technology, and in particular to a fault handling method, apparatus, device, and medium. Background Technology
[0002] With the increasing demand for Basic Input Output System (BIOS) adapters, efficiently and quickly handling BIOS adapter failures has become crucial for improving the availability of BIOS adapters.
[0003] In related technologies, the main approach relies on manual analysis and handling of BIOS adapter device faults (such as manually writing the source code required for fault repair operations), which consumes a lot of manpower and resources and has low fault handling efficiency. Summary of the Invention
[0004] The purpose of this application is to provide a fault handling method, apparatus, device, and medium that can reduce the reliance on manual analysis in the fault handling process, thereby improving fault handling efficiency.
[0005] To address the aforementioned technical problems, in a first aspect, embodiments of this application provide a fault handling method, the method comprising:
[0006] Obtain device information, which includes at least the device identification information, bandwidth information, and transmission rate information of the device to be adapted.
[0007] Based on the obtained device information, detect whether there is a device malfunction, and if there is a device malfunction, determine the type of device malfunction and the target repair strategy;
[0008] Using the target model, the first source code and target code elements corresponding to the target repair strategy are determined, and code completion is performed on the first source code according to the target code elements to obtain the second source code;
[0009] Based on the second source code, execute the fault repair operation corresponding to the target repair strategy.
[0010] Optionally, the target model is trained based on source code samples and candidate code elements corresponding to different repair strategies in the edit sequence dataset;
[0011] The source code sample is a source code containing at least one variable code element position for performing a repair operation corresponding to the repair strategy, and the candidate code element is a code element used for code completion at the variable code element position in the source code sample.
[0012] Optionally, based on the acquired device information, the system detects whether a device malfunction exists, and if a device malfunction exists, determines the type of the device malfunction and the target repair strategy, including:
[0013] Using the target model, based on the acquired device information, it detects whether there is a device fault, and if there is a device fault, determines the type of the device fault and the target repair strategy.
[0014] The target model is also trained based on device information samples corresponding to different types of device faults and historical repair strategy samples corresponding to each device information sample. The device information samples include at least device identification information samples, bandwidth information samples, and transmission rate information samples.
[0015] Optionally, the method further includes:
[0016] Check whether the device identification information, bandwidth information, and transmission rate information of the required compatible device have been obtained;
[0017] If any of the device identification information, bandwidth information, and transmission rate information of the required adapter device is not obtained, the device information of the required adapter device shall be obtained again.
[0018] Having obtained the device identification information, bandwidth information, and transmission rate information of the required compatible device, the type of the required compatible device and the resources to be allocated are determined based on the obtained device identification information, bandwidth information, and transmission rate information.
[0019] Optionally, based on the obtained device identification information, bandwidth information, and transmission rate information, the type of the required compatible device and the required allocated resources are determined, including:
[0020] Based on the target model and the obtained device identification information, bandwidth information, and transmission rate information, the type of the required compatible device and the required resource allocation are determined.
[0021] The target model is trained based on device identification information samples, bandwidth information samples, and transmission rate information samples corresponding to different device types, reserved resource samples corresponding to different device types, and source code samples and candidate code elements corresponding to different repair strategies in the edit sequence dataset. The source code sample is a source code containing at least one variable code element position for performing the repair operation corresponding to the repair strategy. The candidate code element is a code element used for code completion at the variable code element position in the source code sample.
[0022] Optionally, the device identification information includes at least supplier identification information and device identification information.
[0023] Optionally, the types of equipment failures include at least abnormal connection of the required adapter equipment and abnormal equipment degradation.
[0024] Secondly, embodiments of this application also provide a fault handling apparatus, the apparatus comprising:
[0025] The first acquisition module is used to acquire device information, which includes at least the device identification information, bandwidth information and transmission rate information of the device to be adapted.
[0026] The first processing module is used to detect whether there is a device fault based on the acquired device information, and if there is a device fault, determine the type of the device fault and the target repair strategy.
[0027] The second processing module is used to determine the first source code and target code element corresponding to the target repair strategy through the target model, and to perform code completion operation on the first source code according to the target code element to obtain the second source code;
[0028] The first execution module is used to execute the fault repair operation corresponding to the target repair strategy based on the second source code.
[0029] Thirdly, embodiments of this application also provide an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the fault handling method as described in the first aspect.
[0030] Fourthly, embodiments of this application also provide a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implements the fault handling method as described in the first aspect.
[0031] Fifthly, embodiments of this application also provide a computer program product, including a computer program / instructions that, when executed by a processor, implement the fault handling method as described in the first aspect.
[0032] As can be seen from the above technical solution, by actively acquiring device information such as device identification information, bandwidth information, and transmission rate information of the required compatible devices, device faults can be detected in a timely manner, thereby enabling the timely determination of repair strategies for fault repair. To enable the device to execute the corresponding fault repair operation, a pre-trained target model automatically finds the first source code and target code elements corresponding to the target repair strategy, and uses these target code elements to perform code completion operations on the first source code. Thus, through the target model, the code required for executing the fault repair operation can be automatically written, effectively reducing the reliance on manual analysis in the fault handling process and thereby improving fault handling efficiency. Attached Figure Description
[0033] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0034] Figure 1 A flowchart illustrating the implementation of a fault handling method provided in this application embodiment;
[0035] Figure 2 A schematic diagram of a Sigmoid function graph provided in an embodiment of this application;
[0036] Figure 3 This is a schematic diagram of the structure of a fault handling device provided in an embodiment of this application;
[0037] Figure 4 A schematic diagram of an electronic device provided in an embodiment of this application;
[0038] Figure 5 This is a schematic diagram of a computer-readable storage medium provided in an embodiment of this application. Detailed Implementation
[0039] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0040] The terms "comprising" and "having," and any variations thereof, in the specification, claims, and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may include steps or units not listed.
[0041] As the demand for BIOS adapters increases, common problems recur, leading to a gradual increase in manpower and time consumption. The key to improving the availability of BIOS adapters lies in how to efficiently and quickly diagnose faults, promptly fix problems, and achieve reasonable resource allocation.
[0042] In related technologies, troubleshooting BIOS-compatible device faults primarily relies on manual analysis. For example, after obtaining a resource package for hot updates, manual intervention is required to detect crashes that occur after the hot update based on this resource package. Then, the fault repair strategy (such as downgrade repair) is determined through analysis, and relevant source code is written to generate corresponding scripts for the BIOS to execute. Because this fault handling process heavily depends on manual analysis, it consumes significant human and material resources, leading to problems such as untimely repairs and slow problem resolution.
[0043] To address the problems existing in the aforementioned related technologies, this application proposes the application of artificial intelligence (AI) code for fault repair in the server field. That is, using AI code modules output by the target model to replace manually edited source code to execute fault repair strategy-related operations can effectively save manpower and time costs.
[0044] The following description, in conjunction with the accompanying drawings, details a load balancing method for multi-controller array storage provided in this application through some embodiments and application scenarios.
[0045] Firstly, see [the following] Figure 1 The diagram shown is an implementation flowchart of a load balancing method for multi-controller array storage provided in this application embodiment. The method may include the following steps:
[0046] Step S101: Obtain device information, which includes at least the device identification information, bandwidth information, and transmission rate information of the device to be adapted.
[0047] In practical implementation, for the high-speed serial computer expansion bus standard (PCIe, Peripheral Component Interconnect express) devices that the BIOS needs to adapt to (i.e. connect to) deployed on the server, device information such as device identification, bandwidth, transmission rate, connection status, and temperature is acquired in real time. It can be understood that this device identification information is relevant to describe the device type of the device requiring adaptation.
[0048] As one possible implementation, the device identification information includes at least vendor identification information (VID) and device identification information (DID).
[0049] Supplier identification information, also known as Vendor ID, is an identification code representing the patent owner (technology manufacturer) of the invention device, commonly referred to as the vendor ID. This ID is uniformly compiled and named by the PCI-SGI organization and is a unique vendor identifier that cannot be duplicated. For example, graphics cards with VIDs of "0x1002" and "0x10DE" indicate that these two graphics cards come from different manufacturers.
[0050] Device identification information, also known as Device ID, is a code that identifies the device itself, commonly referred to as the Device ID. This ID is mainly used to distinguish different models of the same type of device. It is generally named by the technology inventor according to the PCI specification, and devices from different manufacturers can have the same name (since each manufacturer has a unique VID, there will be no confusion).
[0051] Step S102: Based on the obtained device information, detect whether there is a device fault, and if there is a device fault, determine the type of the device fault and the target repair strategy.
[0052] In practical implementation, the acquired device identification information reveals the type of currently connected device, allowing for the determination of the fault diagnosis criteria corresponding to that device type. This information, combined with other device information, enables fault diagnosis of the device. For example, knowing the device type (such as category and model) reveals the device's normal operating information (such as serial port bandwidth and transmission rate). By comparing this normal operating information with the currently acquired operating information, it can be determined whether the device is faulty and, if so, the type of fault.
[0053] In one embodiment, considering that different types of devices may experience different types of device failures, corresponding key operating information can be set for different types of devices. After identifying the type of device to be adapted, additional key operating information (such as temperature information, humidity information, power-on voltage information, etc.) corresponding to that type of device is captured. By comparing the currently captured key operating information with the corresponding information under normal conditions, it can be determined whether the current device has a device failure and the type of device failure, thereby expanding the application scope of fault diagnosis for the required adapted devices.
[0054] As one possible implementation, the types of equipment failures include at least abnormal connection of the required adapter equipment and abnormal equipment degradation.
[0055] In practice, by acquiring device identification information, the type of the currently connected device is determined, thereby confirming whether a normal connection to the required compatible device has been established (i.e., diagnosing any connection anomalies with the required compatible device). Furthermore, the type of the currently connected device allows for the determination of its normal bandwidth and transmission rate. Comparing this normal bandwidth and transmission rate with the acquired information reveals any instances of device degradation, such as bandwidth or speed degradation. For example, if the bandwidth of the currently connected device is less than that of a device of the same type under normal conditions, then bandwidth degradation is suspected. Therefore, by proactively acquiring device identification information, bandwidth information, and transmission rate information of the required compatible device, device faults can be detected promptly, allowing for timely determination of repair strategies and subsequent fault remediation.
[0056] Step S103: Using the target model, determine the first source code and target code element corresponding to the target repair strategy, and perform code completion operation on the first source code according to the target code element to obtain the second source code.
[0057] In practical implementation, source code for the fault repair operations corresponding to the fault repair strategy can be collected in advance, such as source code for performing operations like restarting the device, shutting down the device, or adjusting the device bandwidth or transmission rate. Variable code elements for adjusting the fault repair operations can be reserved at corresponding positions in this source code (i.e., the first source code). For example, these variable code elements could be code segments or related parameters for adjusting the number of device restarts, or code segments or related parameters for adjusting the device bandwidth or transmission rate to a specific value. After determining the first source code and target code elements corresponding to the target repair strategy, the target model can automatically perform a context search on the first source code based on the target code element, find the corresponding variable code element position, and add the target code element to that variable code element position to obtain the second source code, thereby enabling AI to replace manual code writing.
[0058] Step S104: Execute the fault repair operation corresponding to the target repair strategy according to the second source code.
[0059] In practical implementation, after the target model outputs the second source code, the corresponding script can be generated and executed through the second source code to schedule relevant devices or programs to perform fault repair operations corresponding to the target repair strategy, such as performing operations to disable the watchdog, restart the device, or pressurize and power on the device.
[0060] As can be seen from the above technical solution, by actively acquiring device information such as device identification information, bandwidth information, and transmission rate information of the required compatible devices, device faults can be detected in a timely manner, thereby enabling the timely determination of repair strategies for fault repair. To enable the device to execute the corresponding fault repair operation, a pre-trained target model automatically finds the first source code and target code elements corresponding to the target repair strategy, and uses these target code elements to perform code completion operations on the first source code. Thus, through the target model, the code required for executing the fault repair operation can be automatically written, effectively reducing the reliance on manual analysis in the fault handling process and thereby improving fault handling efficiency.
[0061] Optionally, in one embodiment, the target model can be trained based on source code samples and candidate code elements corresponding to different repair strategies in the edit sequence dataset;
[0062] The source code sample is a source code containing at least one variable code element position for performing a repair operation corresponding to the repair strategy, and the candidate code element is a code element used for code completion at the variable code element position in the source code sample.
[0063] In practical implementation, source code for the fault repair operations corresponding to the fault repair strategy is collected in advance. Variable code elements (such as variable parameters) for adjusting the fault repair operations are reserved at corresponding positions in each collected source code (i.e., the first source code), resulting in source code samples. Code elements for adjusting the fault repair operations corresponding to the fault repair strategy (such as the number of restarts used in historical fault repair processes, the reduction in bandwidth or transmission rate, etc.) are also collected, resulting in candidate code elements. An edit sequence dataset is generated based on the obtained source code samples and candidate code elements. This edit sequence dataset is used to iteratively train the target model, and the usability of the second source code output by the target model is verified. Different fault repair strategy labels can be set for different combinations of source code samples and candidate code elements, so that after the target model knows the target repair strategy, it can accurately find the first source code and target code elements corresponding to that target repair strategy, and then obtain the second source code through code completion, thereby enabling AI to replace manual coding.
[0064] As one possible implementation, the above-mentioned detection of whether a device fault exists based on the acquired device information, and determination of the type of device fault and target repair strategy if a device fault exists, includes:
[0065] Using the target model, based on the acquired device information, it detects whether there is a device fault, and if there is a device fault, determines the type of the device fault and the target repair strategy.
[0066] The target model is also trained based on device information samples corresponding to different types of device faults and historical repair strategy samples corresponding to each device information sample. The device information samples include at least device identification information samples, bandwidth information samples, and transmission rate information samples.
[0067] In practical implementation, equipment information can be captured in large quantities, and samples of equipment information under normal and fault conditions can be sorted out to build an equipment information database. This database is then used to train a target model for equipment fault detection and fault type determination. Optionally, the model can be configured to output logs when equipment faults occur, printing out the main content of the target model's interpretation for manual sampling. This facilitates the user in identifying and correcting erroneous results output by the target model during equipment fault detection and fault type determination, and avoids issues such as the target model continuously restarting the equipment to repair faults due to its inability to fix them.
[0068] Simultaneously, historical repair strategy samples corresponding to each device information sample can be collected. These historical repair strategy samples describe the specific fault repair strategies corresponding to different device information samples (such as how many times the device was restarted, how much bandwidth or transmission rate was reduced, and which devices or software were shut down during historical fault repair processes). This allows the target model to determine the optimal fault repair strategy corresponding to the current fault situation based on the input device information. Then, based on this optimal fault repair strategy, the corresponding source code and candidate code elements are found, and context-based code completion is performed to automatically write and execute code for this optimal fault repair strategy.
[0069] It should be noted that the above-mentioned equipment fault detection, equipment fault type judgment, and context-based code completion operations can be implemented by the same model or by different models respectively.
[0070] Optionally, in one embodiment, the target model described above can be constructed based on a neural network model, for example, the target model can be constructed based on a back propagation (BP) neural network model.
[0071] Understandably, a BP neural network model can perform a highly nonlinear mapping from a space pm (composed of pattern vectors p from m input neurons) to a space yn (where n is the number of output nodes) in a system. This enables functions such as automatic control system modeling and identification, parameter tuning, pole placement, internal model control, optimization design, predictive control, optimal control, filtering, and predictive fault-tolerant control. The functional relationship between the input and output of a neuron is represented using an activation function, such as the sigmoid function (i.e., the logsig function). Figure 2 As shown, the Sigmoid function is an "S"-shaped function. Due to its monotonically increasing nature and the monotonically increasing nature of its inverse function, the Sigmoid function can be used as an activation function in neural networks. The expression for the Sigmoid function is as follows:
[0072]
[0073] Here, z represents the input vector, and the sigmoid function is used as the output of the neuron, mapping a real number to the interval (0,1). The softmax function is often used in the final activation layer of a neural network, selecting the result with the highest probability as the output.
[0074] The Softmax function can "compress" a K-dimensional vector z containing arbitrary real numbers into another K-dimensional real vector σ(z), such that each element is in the range (0,1) and the sum of all elements is 1. Its expression is as follows:
[0075]
[0076] Based on the functional relationship between the input and output of neurons in the backpropagation neural network model described above, the BP neural network can be divided into a training phase and a working phase in practical applications. During the training phase, the BP neural network adjusts the weights of the input feature variables until the expected threshold or a preset number of training iterations is reached. The process of the BP neural network training phase is as follows:
[0077] (1) Forward propagation of feature vectors: The input layer receives the input feature vectors and then processes them. Finally, the results are output through the output layer neurons.
[0078] (2) Error backpropagation process. When the output result does not match the expected value and exceeds the set error range, the error will propagate back from the output layer. After repeated iterations, the expected result value is reached or the number of training iterations reaches the predetermined value, thus ending the training of the neural network.
[0079] Optionally, in one embodiment, the above method further includes:
[0080] Check whether the device identification information, bandwidth information, and transmission rate information of the required compatible device have been obtained;
[0081] If any of the device identification information, bandwidth information, and transmission rate information of the required adapter device is not obtained, the device information of the required adapter device shall be obtained again.
[0082] Having obtained the device identification information, bandwidth information, and transmission rate information of the required compatible device, the type of the required compatible device and the resources to be allocated are determined based on the obtained device identification information, bandwidth information, and transmission rate information.
[0083] In this embodiment, considering the possibility of inaccurate resource reservations for BIOS adaptation devices, before processing the device identification information, bandwidth information, and transmission rate information of the required adaptation device through the target model, it is possible to first determine whether all device information of the required adaptation device has been obtained. This avoids situations where resources are not reserved for the corresponding device or the reserved resources are inaccurate due to incomplete or missing device information. Furthermore, it proposes using the bandwidth and rate of PCIe devices as judgment indicators for resource allocation to allocate reserved resources, which can further optimize the resource allocation mechanism and improve the allocation accuracy of reserved resources (such as Hyper virtual machine resources) related to the bandwidth and rate of PCIe devices.
[0084] As one possible implementation, determining the type of the required compatible device and the required resource allocation based on the obtained device identification information, bandwidth information, and transmission rate information includes:
[0085] Based on the target model and the obtained device identification information, bandwidth information, and transmission rate information, the type of the required compatible device and the required resource allocation are determined.
[0086] The target model is trained based on device identification information samples, bandwidth information samples, and transmission rate information samples corresponding to different device types, reserved resource samples corresponding to different device types, and source code samples and candidate code elements corresponding to different repair strategies in the edit sequence dataset. The source code sample is a source code containing at least one variable code element position for performing the repair operation corresponding to the repair strategy. The candidate code element is a code element used for code completion at the variable code element position in the source code sample.
[0087] Understandably, in order to further reduce manual intervention in the equipment adaptation process and improve the accuracy of reserved resource allocation, resource allocation operations can be implemented through target models.
[0088] For example, after the acquired device information is input into the target model, the target model can detect whether there is a device connection anomaly (such as whether the corresponding device information is not obtained or the obtained corresponding device information is incomplete). If a device connection anomaly exists, the target model outputs a second source code for performing a device restart operation. To avoid a loop restart situation, the target model can obtain this second source code through the target code element used to set the number of times the power outage is repaired. For example, the device can be allowed to repeat the repair operation a maximum of 3 times. If complete device information is obtained after restarting, the resource allocation operation continues. If complete device information is still not obtained after 3 restarts, an error is reported. Similarly, when performing repair operations such as downgrade issues, a corresponding maximum number of repairs can also be set. For example, if the fault is repaired after a maximum of 3 repeat repair operations, the BIOS continues to boot; otherwise, an error alarm is reported.
[0089] Based on the above embodiments, this application provides an AI-powered automatic fault diagnosis and repair solution for equipment, which greatly improves the efficiency of handling fault problems, reduces labor costs, and enhances BIOS repair capabilities. Furthermore, by training the target model in conjunction with historical fault diagnosis and repair methods and reserved resource allocation schemes, the target model can be dynamically updated based on past solutions, improving the effectiveness of fault diagnosis and repair and reserved resource allocation, thereby saving manpower, time costs, and enhancing core competitiveness.
[0090] Secondly, embodiments of this application provide a fault handling device, such as... Figure 3 As shown, the device includes:
[0091] The first acquisition module 11 is used to acquire device information, which includes at least the device identification information, bandwidth information and transmission rate information of the required compatible device.
[0092] The first processing module 12 is used to detect whether there is a device fault based on the acquired device information, and if there is a device fault, to determine the type of the device fault and the target repair strategy.
[0093] The second processing module 13 is used to determine the first source code and target code element corresponding to the target repair strategy through the target model, and to perform code completion operation on the first source code according to the target code element to obtain the second source code;
[0094] The first execution module 14 is used to execute the fault repair operation corresponding to the target repair strategy according to the second source code.
[0095] Optionally, the target model is trained based on source code samples and candidate code elements corresponding to different repair strategies in the edit sequence dataset;
[0096] The source code sample is a source code containing at least one variable code element position for performing a repair operation corresponding to the repair strategy, and the candidate code element is a code element used for code completion at the variable code element position in the source code sample.
[0097] Optionally, the first processing module 12 includes:
[0098] The first processing submodule is used to detect whether there is a device fault based on the acquired device information through the target model, and if there is a device fault, determine the type of the device fault and the target repair strategy.
[0099] The target model is also trained based on device information samples corresponding to different types of device faults and historical repair strategy samples corresponding to each device information sample. The device information samples include at least device identification information samples, bandwidth information samples, and transmission rate information samples.
[0100] Optionally, the device further includes:
[0101] The first detection module is used to detect whether the device identification information, bandwidth information and transmission rate information of the required compatible device have been obtained;
[0102] The first response module is used to reacquire device information for the required adapter device if any of the device identification information, bandwidth information, and transmission rate information of the required adapter device is not obtained.
[0103] The second response module is used to determine the type of the required adapter and the required resources based on the device identification information, bandwidth information and transmission rate information of the required adapter.
[0104] Optionally, the second response module includes:
[0105] The first response submodule is used to determine the type of the required compatible device and the required allocated resources based on the obtained device identification information, bandwidth information and transmission rate information through the target model;
[0106] The target model is trained based on device identification information samples, bandwidth information samples, and transmission rate information samples corresponding to different device types, reserved resource samples corresponding to different device types, and source code samples and candidate code elements corresponding to different repair strategies in the edit sequence dataset. The source code sample is a source code containing at least one variable code element position for performing the repair operation corresponding to the repair strategy. The candidate code element is a code element used for code completion at the variable code element position in the source code sample.
[0107] Optionally, the device identification information includes at least supplier identification information and device identification information.
[0108] Optionally, the types of equipment failures include at least abnormal connection of the required adapter equipment and abnormal equipment degradation.
[0109] As can be seen from the above technical solution, by actively acquiring device information such as device identification information, bandwidth information, and transmission rate information of the required compatible devices, device faults can be detected in a timely manner, thereby enabling the timely determination of repair strategies for fault repair. To enable the device to execute the corresponding fault repair operation, a pre-trained target model automatically finds the first source code and target code elements corresponding to the target repair strategy, and uses these target code elements to perform code completion operations on the first source code. Thus, through the target model, the code required for executing the fault repair operation can be automatically written, effectively reducing the reliance on manual analysis in the fault handling process and thereby improving fault handling efficiency.
[0110] It should be noted that the device embodiments are similar to the method embodiments, so the description is relatively simple. For relevant details, please refer to the method embodiments.
[0111] This application also provides an electronic device, see embodiments thereof. Figure 4 , Figure 4 This is a schematic diagram of the electronic device proposed in an embodiment of this application. Figure 4 As shown, the electronic device 100 includes a memory 110 and a processor 120. The memory 110 and the processor 120 are connected via a bus. The memory 110 stores a computer program that can run on the processor 120 to implement the steps in the fault handling method disclosed in the embodiments of this application.
[0112] This application also provides a computer-readable storage medium, see [link to relevant documentation]. Figure 5 , Figure 5 This is a schematic diagram of a computer-readable storage medium proposed in an embodiment of this application. Figure 5 As shown, a computer-readable storage medium 200 stores a computer program / instruction 210, which, when executed by a processor, implements the steps in the fault handling method disclosed in the embodiments of this application.
[0113] This application also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps in the fault handling method disclosed in this application.
[0114] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0115] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, embodiments of this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of this application can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0116] This application describes embodiments of methods, systems, devices, storage media, and program products according to embodiments of this application with reference to flowchart illustrations and / or block diagrams. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0117] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0118] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0119] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0120] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0121] The above provides a detailed description of a fault handling method, apparatus, device, and medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A fault handling method, characterized in that, The method includes: Obtain device information, which includes at least the device identification information, bandwidth information, and transmission rate information of the device to be adapted. Based on the obtained device information, detect whether there is a device malfunction, and if there is a device malfunction, determine the type of device malfunction and the target repair strategy; Using the target model, the first source code and target code elements corresponding to the target repair strategy are determined, and code completion is performed on the first source code according to the target code elements to obtain the second source code; Based on the second source code, execute the fault repair operation corresponding to the target repair strategy; The method further includes: Check whether the device identification information, bandwidth information, and transmission rate information of the required compatible device have been obtained; If any of the device identification information, bandwidth information, and transmission rate information of the required adapter device is not obtained, the device information of the required adapter device shall be obtained again. Having obtained the device identification information, bandwidth information, and transmission rate information of the required compatible device, the target model determines the type of the required compatible device and the required resource allocation based on the obtained device identification information, bandwidth information, and transmission rate information. The target model is trained based on device identification information samples, bandwidth information samples, and transmission rate information samples corresponding to different device types, reserved resource samples corresponding to different device types, and source code samples and candidate code elements corresponding to different repair strategies in the edit sequence dataset. The source code sample is a source code containing at least one variable code element position for performing the repair operation corresponding to the repair strategy. The candidate code element is a code element used for code completion at the variable code element position in the source code sample. The target model is configured to automatically perform a context search on the first source code based on the target code element after determining the first source code and target code element corresponding to the target repair strategy, find the corresponding variable code element position, and supplement the target code element to the variable code element position to obtain the second source code.
2. The method according to claim 1, characterized in that, The target model is trained based on source code samples and candidate code elements corresponding to different repair strategies in the edit sequence dataset. The source code sample is a source code containing at least one variable code element position for performing a repair operation corresponding to the repair strategy, and the candidate code element is a code element used for code completion at the variable code element position in the source code sample.
3. The method according to claim 2, characterized in that, Based on the acquired device information, detect whether a device malfunction exists, and if a device malfunction exists, determine the type of the device malfunction and the target repair strategy, including: Using the target model, based on the acquired device information, it detects whether there is a device fault, and if there is a device fault, determines the type of the device fault and the target repair strategy. The target model is also trained based on device information samples corresponding to different types of device faults and historical repair strategy samples corresponding to each device information sample. The device information samples include at least device identification information samples, bandwidth information samples, and transmission rate information samples.
4. The method according to any one of claims 1-3, characterized in that, The device identification information includes at least supplier identification information and device identification information.
5. The method according to any one of claims 1-3, characterized in that, The types of equipment failures include at least abnormal connection of the required compatible equipment and abnormal equipment degradation.
6. A fault handling device, characterized in that, The device includes: The first acquisition module is used to acquire device information, which includes at least the device identification information, bandwidth information and transmission rate information of the device to be adapted. The first processing module is used to detect whether there is a device fault based on the acquired device information, and if there is a device fault, determine the type of the device fault and the target repair strategy. The second processing module is used to determine the first source code and target code element corresponding to the target repair strategy through the target model, and to perform code completion operation on the first source code according to the target code element to obtain the second source code; The first execution module is used to execute the fault repair operation corresponding to the target repair strategy according to the second source code; The device further includes: The first detection module is used to detect whether the device identification information, bandwidth information and transmission rate information of the required compatible device have been obtained; The first response module is used to reacquire device information for the required adapter device if any of the device identification information, bandwidth information, and transmission rate information of the required adapter device is not obtained. The second response module is used to determine the type of the required adaptive device and the required allocated resources based on the obtained device identification information, bandwidth information, and transmission rate information of the required adaptive device. The second response module includes: a first response submodule, used to determine the type of the required adaptive device and the required allocated resources based on the obtained device identification information, bandwidth information, and transmission rate information through the target model. The target model is trained based on device identification information samples, bandwidth information samples, and transmission rate information samples corresponding to different device types, reserved resource samples corresponding to different device types, and source code samples and candidate code elements corresponding to different repair strategies in the edit sequence dataset. The source code sample is a source code containing at least one variable code element position for performing the repair operation corresponding to the repair strategy. The candidate code element is a code element used for code completion at the variable code element position in the source code sample. The target model is configured to automatically perform a context search on the first source code based on the target code element after determining the first source code and target code element corresponding to the target repair strategy, find the corresponding variable code element position, and supplement the target code element to the variable code element position to obtain the second source code.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the fault handling method as described in any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instruction is executed by the processor, it implements the fault handling method as described in any one of claims 1 to 5.