Abnormal state detection method, device, electronic device and storage medium of state machine
By obtaining real-time abnormal states and finding the corresponding input signal sequence in the database, comparing and adjusting the signal position, the problem of low efficiency in detection of abnormal states by state machines is solved, and more efficient diagnosis is achieved.
Patent Information
- Application Number
- CN202111672554.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2041-12-31
AI Technical Summary
In the prior art, the abnormal state detection efficiency of state machines is not high, especially when the logical relationship between the input signal and the output state is complex, it requires a lot of manual energy and diagnosis time.
By acquiring the real-time abnormal state, obtaining the corresponding first input signal sequence in the database based on the state, comparing the sequence with the second input signal sequence of the target state, obtaining the abnormal signal position, and then adjusting the signal state of the input interface.
There is no need to obtain the process code or detection logic circuit of the state machine, and directly obtain the abnormal input signal, which significantly improves the diagnostic efficiency of the state machine.
Smart Images

Figure CN114357028B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of state machine control, and in particular to a method, device, electronic device and storage medium for detecting abnormal states of a state machine. Background Art
[0002] With the continuous development of industry, the operation requirements of state machines are constantly increasing. Among them, the state machine is composed of state registers and combinational logic circuits. It can transfer states according to the preset state based on the input signal. It is the logic control center that coordinates the relevant signal instructions of the equipment and completes specific operations.
[0003] The output state of the state machine is associated with the input signal and the current state. When the input signal of the state machine changes, the output state of the state machine also changes, causing the system to fail. In order to promptly detect the input signal that changes, the prior art generally determines the input signal that causes the fault state and the input signal that jumps out of the fault state by running code or logic circuits, thereby realizing fault diagnosis. However, when the logical relationship between the input signal and the output state is relatively complex, the solution in the prior art consumes a lot of manual effort and diagnostic time, resulting in low efficiency in abnormal state detection of the state machine in the prior art.
[0004] With respect to the technical problem that the abnormal state detection efficiency of the state machine existing in the related art is low, no effective solution has been proposed yet. Summary of the invention
[0005] In this embodiment, a method, device, electronic device and storage medium for detecting abnormal state of a state machine are provided to solve the problem of low efficiency of detecting abnormal state of a state machine in related technologies.
[0006] In a first aspect, a method for detecting an abnormal state of a state machine is provided in this embodiment, including:
[0007] Get real-time abnormal status;
[0008] Based on the real-time abnormal state, a corresponding first input signal sequence is acquired in a database, wherein the database stores a corresponding relationship between the abnormal state and the input signal sequence, and the input signal sequence includes signal states of multiple input interfaces;
[0009] The first input signal sequence is compared with the second input signal sequence of the target state to obtain an abnormal signal position, where the abnormal signal position is a position where the first input signal sequence is inconsistent with the second input signal sequence.
[0010] In some embodiments, the step of obtaining the real-time abnormal status also includes:
[0011] A corresponding relationship between the input signal sequence and the state of the state machine is established, and the corresponding relationship is saved in a database.
[0012] In some embodiments, the input signal includes an associated signal and a non-associated signal, and the associated signal affects the state of the state machine.
[0013] In some embodiments, comparing the first input signal sequence with the second input signal sequence of the target state to obtain the abnormal signal position includes:
[0014] Comparing the first input signal sequence with the second input signal sequence to obtain a deviation position, where the deviation position is a position where the first input signal sequence is inconsistent with the second input signal sequence;
[0015] It is determined whether the input signal corresponding to the deviation position belongs to a related signal. If so, the deviation position is determined as the abnormal signal position.
[0016] In some embodiments, after comparing the first input signal sequence with the second input signal sequence of the target state to obtain the abnormal signal position, the method further includes:
[0017] Based on the second input signal sequence, a signal state of the input interface corresponding to the abnormal signal position is adjusted.
[0018] In some of the embodiments, the state machine state includes at least a running state and a debugging state.
[0019] In some of the embodiments, the input signal includes at least a system interaction signal and an external interaction signal.
[0020] In a second aspect, in this embodiment, a device for detecting an abnormal state of a state machine is provided, comprising:
[0021] Status acquisition module, used to obtain real-time abnormal status;
[0022] A signal acquisition module, configured to acquire a corresponding first input signal sequence in a database based on the real-time abnormal state, wherein the database stores a correspondence between the abnormal state and the input signal sequence, and the input signal sequence includes signal states of multiple input interfaces;
[0023] The comparison module is used to compare the first input signal sequence with the second input signal sequence of the target state to obtain an abnormal signal position, where the abnormal signal position is a position where the first input signal sequence is inconsistent with the second input signal sequence.
[0024] In a third aspect, an electronic device is provided in this embodiment, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for detecting an abnormal state of the state machine described in the first aspect is implemented.
[0025] In a fourth aspect, in this embodiment, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the abnormal state detection method of the state machine described in the first aspect is implemented.
[0026] Compared with the related art, the abnormal state detection method, device, electronic device and storage medium of the state machine provided in this embodiment obtain the real-time abnormal state; based on the real-time abnormal state, the corresponding first input signal sequence is obtained in the database, and the database stores the corresponding relationship between the abnormal state and the input signal sequence, and the input signal sequence includes the signal states of multiple input interfaces; the first input signal sequence is compared with the second input signal sequence of the target state to obtain the abnormal signal position, and the abnormal signal position is the position where the first input signal sequence is inconsistent with the second input signal sequence. Through the pre-established corresponding relationship between the state of the state machine and the input signal sequence, the first input signal sequence corresponding to the real-time abnormal state is obtained, and compared with the second input signal sequence of the target state to obtain the abnormal signal position, without obtaining the process code of the state machine or detecting the logic circuit of the state machine, which solves the technical problem of low efficiency of abnormal state detection of the state machine in the prior art and improves the diagnostic efficiency of the state machine.
[0027] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0029] Figure 1 It is a hardware structure diagram of a terminal of an abnormal state detection method of a state machine according to an embodiment of the present invention;
[0030] Figure 2 It is a flow chart of an abnormal state detection method of a state machine according to an embodiment of the present invention;
[0031] Figure 3 It is a structural block diagram of an abnormal state detection device of a state machine according to an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0033] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the", "these" and the like in this application do not represent quantitative restrictions, and they can be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether directly or indirectly. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. Usually, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0034] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 FIG. 1 is a hardware structure diagram of a terminal of the abnormal state detection method of the state machine of this embodiment. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 and memory 104 for storing data, wherein processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0035] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the abnormal state detection method of the state machine in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0036] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by the communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0037] Exemplarily, the state machine in the present invention refers to an integrated circuit composed of a state register and a combinational logic resistor, which can transfer states according to a preset output state based on an input signal. The state machine is a control center that coordinates related signal actions in the system and completes specific operations. Among them, the state machine in the prior art is generally based on a finite state machine, that is, the output state of the state machine is limited in number. Depending on whether the output state in the finite state machine is related to the input signal, the finite state machine can be divided into a Moore-type state machine and a Millie-type state machine.
[0038] See also Figure 2 , Figure 2 FIG. 1 is a flow chart of a method for detecting an abnormal state of a state machine according to an embodiment of the present invention. In this embodiment, the method for detecting an abnormal state of a state machine includes:
[0039] S202: Acquire real-time abnormal status.
[0040] Exemplarily, if an abnormal condition occurs, the current state of the state machine is obtained as a real-time abnormal state. It is understandable that when the state machine works normally, the output state of the state machine should be the preset target state. If the output state of the current state machine is inconsistent with the target state, it indicates that an abnormal condition has occurred in the state machine, and it is necessary to obtain the real-time abnormal state of the state machine for subsequent acquisition of the input signal of the state machine through the real-time abnormal state and analysis.
[0041] S204: Acquire a corresponding first input signal sequence in a database based on the real-time abnormal state, wherein the database stores a corresponding relationship between the abnormal state and the input signal sequence, and the input signal sequence includes signal states of multiple input interfaces.
[0042] Exemplarily, the input signal sequence refers to the signal state of multiple input interfaces. Specifically, each input interface in the state machine has a corresponding state value, which is used to identify the signal state of the input interface. The state value of each input interface is arranged in a certain order to obtain the input signal sequence. The input signal sequence corresponding to each state of the state machine is pre-stored in the database. Based on this, when the output state of the state machine is an abnormal state, the corresponding first input signal sequence can be obtained in the database based on the real-time abnormal state.
[0043] S206: Compare the first input signal sequence with the second input signal sequence of the target state to obtain an abnormal signal position, where the abnormal signal position is a position where the first input signal sequence is inconsistent with the second input signal sequence.
[0044] Exemplarily, the target state preset by the current state machine is obtained, and based on the correspondence between the state machine state and the input signal sequence, the second input signal sequence corresponding to the target state is obtained in the database. The first input signal sequence is compared with the second input signal sequence bit by bit to obtain the sequence position with inconsistent values as the abnormal signal position. It can be understood that the input signal corresponding to the abnormal signal position is the signal that jumps in the input signal of the real-time abnormal state.
[0045] This embodiment obtains a real-time abnormal state; based on the real-time abnormal state, a corresponding first input signal sequence is obtained in a database, and a corresponding relationship between the abnormal state and the input signal sequence is stored in the database, and the input signal sequence includes signal states of multiple input interfaces; the first input signal sequence is compared with the second input signal sequence of the target state to obtain the abnormal signal position, and the abnormal signal position is the position where the first input signal sequence is inconsistent with the second input signal sequence. Through the pre-established corresponding relationship between the state machine state and the input signal sequence, the abnormal input signal is directly obtained without the need for complex analysis through the process code or logic circuit of the state machine, which solves the technical problem of low abnormal state detection efficiency of the state machine in the prior art and improves the diagnostic efficiency of the state machine.
[0046] In another embodiment, before obtaining the real-time abnormal status, the method further includes:
[0047] Establish the corresponding relationship between the input signal sequence and the state of the state machine, and save the corresponding relationship to the database.
[0048] Exemplarily, a corresponding relationship between each input signal sequence and the state of the state machine is established, and the corresponding relationship is saved in a database. It can be understood that each input signal sequence has a unique corresponding state machine state.
[0049] Specifically, if the state machine has n input signals, and the signal state of each input signal includes "0" and "1", where "0" indicates that the input signal is not input and "1" indicates that the input signal is input, then the state machine has 2 n There are 2 combinations of input signals. n In one specific embodiment, if n=3, the state machine has eight input signal sequences including "000", "001", "010", "011", "100", "101", "110", and "111", and each input signal sequence can correspond to a state of the state machine.
[0050] In another specific embodiment, the correspondence between each input signal sequence and the state of the state machine is recorded in the form of a state table. Please refer to the following table, which is an example of a state table when the number of input signals is 3. The first row of the state table is used to record the input signal, and rows 2-9 are used to record each input signal sequence and the corresponding state machine state.
[0051] Input signal 1 Input signal 2 Input signal 3 state 0 0 0 State 1 0 0 1 State 2 0 1 0 State 3 0 1 1 State 4 1 0 0 State 5 1 0 1 State 6 1 1 0 Status 7 1 1 1 State 8
[0052] In another embodiment, the input signal includes an associated signal and a non-associated signal, and the associated signal affects the state of the state machine.
[0053] Exemplarily, the input signals of the state machine can be divided into associated signals and non-associated signals. An associated signal means that the state of the input signal will affect the output state of the state machine, and a non-associated signal means that the state of the input signal will not affect the output state of the state machine. For example, in a state machine with three input signals, a certain output state of the state machine depends only on input signal 1 and input signal 2, but has nothing to do with input signal 3, then input signal 1 and input signal 2 are associated signals, and input signal 3 is a non-associated signal.
[0054] In one specific embodiment, the correspondence between the associated signal and the non-associated signal and the state of the state machine is as shown in the following table. Among them, the input signal includes input signal 1, input signal 2 and input signal 3, input signal 1 and input signal 2 are associated signals of state 1, and input signal 3 is a non-associated signal of the state machine. At this time, under the premise that input signal 1 and input signal 2 are both in state "0", no matter whether the state of input signal 3 is "0" or "1", the output state of the state machine is state 1.
[0055] Input signal 1 Input signal 2 Input signal 3 state 0 0 X State 1 X X 0 State 2 0 1 1 State 3 1 X 1 State 4
[0056] In another embodiment, comparing the first input signal sequence with the second input signal sequence of the target state to obtain the abnormal signal position includes:
[0057] Step 1: Compare the first input signal sequence with the second input signal sequence to obtain a deviation position, where the deviation position is a position where the first input signal sequence is inconsistent with the second input signal sequence;
[0058] Step 2: Determine whether the input signal corresponding to the deviation position belongs to a related signal. If so, determine the deviation position as an abnormal signal position.
[0059] Exemplarily, the first input signal sequence corresponding to the real-time abnormal state is compared with the second input signal sequence corresponding to the target state to obtain sequence positions with inconsistent values in the sequence, and the sequence positions are used as deviation positions.
[0060] Exemplarily, the category of the input signal corresponding to the deviation position is determined. If the input signal belongs to an associated signal, it indicates that the deviation position is the abnormal signal position. It is understandable that since the associated signal will affect the output state of the state machine, it is necessary to obtain the abnormal signal in the associated signal, and then correct the abnormal signal to jump out of the abnormal state of the state machine. If the input signal belongs to an unassociated signal, it indicates that the deviation position is not the abnormal signal position. It is understandable that since the unassociated signal is irrelevant to the output state of the state machine, even if the unassociated signal jumps, the output state of the state machine will not be affected. Based on this, when the input signal corresponding to the deviation position is a unassociated signal, no correction is required.
[0061] In one specific embodiment, the input signal of the state machine includes input signal 1, input signal 2 and input signal 3, wherein input signal 1 and input signal 2 are associated signals, and input signal 3 is a non-associated signal. The second input signal sequence corresponding to the target state is "010". If the first input signal sequence corresponding to the real-time abnormal state is "001", the first input sequence is compared with the second input signal sequence to obtain deviation position 1 and deviation position 2, wherein deviation position 1 is the second position in the sequence, and deviation position 2 is the third position in the sequence. The input signal 2 corresponding to deviation position 1 is an associated signal, so the input signal 2 corresponding to the abnormal state is an abnormal signal. The input signal 3 corresponding to deviation position 2 is a non-associated signal, so the input signal 3 corresponding to the abnormal state is irrelevant to the state of the state machine, that is, input signal 3 is not an abnormal signal.
[0062] In this embodiment, the first input signal sequence is compared with the second input signal sequence to obtain a deviation position, which is a position where the first input signal sequence is inconsistent with the second input signal sequence; it is determined whether the input signal corresponding to the deviation position belongs to an associated signal, and if so, the deviation position is determined as an abnormal signal position. By comparing the first input signal sequence with the second input signal sequence to obtain the deviation position, and judging whether the input signal is an abnormal signal by the relationship between the input signal corresponding to the deviation position and the associated signal, the input signal of the state machine can be flexibly set based on the associated signal and the non-associated signal. At the same time, since the non-associated signal is irrelevant to the output state of the state machine, it is not necessary to analyze the non-associated signal during detection, which reduces the cost of abnormal state detection of the state machine.
[0063] In another embodiment, after comparing the first input signal sequence with the second input signal sequence of the target state to obtain the abnormal signal position, the method further includes:
[0064] Based on the second input signal sequence, the signal state of the input interface corresponding to the abnormal signal position is adjusted.
[0065] Exemplarily, after the abnormal signal position is acquired, the signal state of the input interface corresponding to the position is adjusted to the corresponding state in the second input signal sequence, so as to realize the correction of the input signal corresponding to the real-time abnormal state.
[0066] In another embodiment, the state of the state machine includes at least a running state and a debugging state.
[0067] Exemplarily, the state of the state machine includes at least a running state and a debugging state, wherein the running state refers to the state of the state machine during normal operation, and the debugging state refers to the state of the state machine during debugging of the state machine.
[0068] Specifically, the state machine in the present invention can be applied to a mechanical device with a conveyor belt. In one of the specific embodiments, the running state of the state machine includes an execution state, a chip analysis state, a signal analysis state, and a component analysis state. Specifically, the execution state refers to the state in which the mechanical equipment executes relevant operation instructions, the chip analysis state refers to the state in which the chip analyzes the received instructions, feedback data and other information, and the signal analysis state refers to the state in which the received external signal is analyzed. Among them, the execution state includes but is not limited to the idle state, the electric roller moving in state, the electric roller moving out state, the electric roller prompting state, the moving in success state, the moving in failure state, the moving out success state, the moving out failure state, the self-test state, the height measurement state, the height measurement success state, the electric roller forward state, the electric roller reverse state, and the electric roller stop state. The chip analysis state includes but is not limited to the system prompt state, the system prompt release state, the system emergency stop state, the system emergency stop release state, and the system reset state. The signal analysis state includes but is not limited to the transmission object in place signal analysis state and the electric roller prompt signal analysis state. The component analysis state includes the upstream component moving out request analysis state and the downstream component moving in response analysis state.
[0069] In another specific embodiment, the debugging state of the state machine includes a start debugging state, an end debugging state, an electric roller forward debugging state, an electric roller reverse debugging state, and an electric roller stop state.
[0070] In another embodiment, the input signal includes at least a system interaction signal and an external interaction signal.
[0071] Exemplarily, the input signal includes at least a system interaction signal and an external interaction signal, wherein the system interaction signal is used to implement interactive control inside the chip, and the external interaction signal is used to implement interactive control between the chip and an external control device.
[0072] Specifically, the state machine in the present invention can be applied to a mechanical device with a conveyor belt. In one specific embodiment, the system interaction signal includes but is not limited to a system safety control signal, an emergency stop signal, an enable signal, a reset signal, an operation mode feedback signal, an interrupt signal, and a prompt signal. Among them, the safety control signal, the emergency stop signal, the enable signal, and the reset signal are sent by the processor inside the computer to the programmable logic device, and the operation mode feedback signal is sent by the programmable logic device to the processor to feedback whether the programmable logic device is operating normally; the interrupt signal and the prompt signal are used to realize the switching of the connection state between the processor and the programmable logic device.
[0073] In another specific embodiment, the external interactive signal of this embodiment includes an electric roller prompt signal, a transmission object arrival signal, an upstream component removal signal, a move-in execution signal, a move-in delay signal, a move-in timeout signal, a move-in execution result output signal, a weighing start signal, a weighing success signal, a downstream component move-in signal, a move-out execution signal, a downstream feedback signal, a move-out execution signal, an electric roller forward rotation signal, and an electric roller reverse rotation signal. Among them, the electric roller prompt signal and the transmission object arrival signal are interactive signals between the external mechanical device and the state machine, the electric roller forward rotation signal and the electric roller reverse rotation signal are used to control the rotation direction of the electric roller, and the remaining signals are interactive signals between the state machine and other data processing modules.
[0074] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0075] In this embodiment, a device for detecting abnormal state of a state machine is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. The terms "module", "unit", "subunit", etc. used below can implement a combination of software and / or hardware of predetermined functions. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0076] Figure 3 : is a structural block diagram of the abnormal state detection device of the state machine of this embodiment, such as Figure 3 As shown, the device comprises:
[0077] Status acquisition module, used to obtain real-time abnormal status;
[0078] A signal acquisition module, used to acquire a corresponding first input signal sequence in a database based on the real-time abnormal state, wherein the database stores a corresponding relationship between the abnormal state and the input signal sequence, and the input signal sequence includes signal states of multiple input interfaces;
[0079] A comparison module, used for comparing the first input signal sequence with the second input signal sequence of the target state to obtain an abnormal signal position, where the abnormal signal position is a position where the first input signal sequence is inconsistent with the second input signal sequence;
[0080] The comparison module is further used to compare the first input signal sequence with the second input signal sequence to obtain a deviation position, where the deviation position is a position where the first input signal sequence is inconsistent with the second input signal sequence;
[0081] Determine whether the input signal corresponding to the deviation position belongs to the associated signal, and if so, determine the deviation position as the abnormal signal position;
[0082] The abnormal state detection device of the state machine also includes a establishing module;
[0083] Establishing a module for establishing a corresponding relationship between an input signal sequence and a state of a state machine, and saving the corresponding relationship to a database;
[0084] The abnormal state detection device of the state machine also includes an adjustment module;
[0085] The adjustment module is used to adjust the signal state of the input interface corresponding to the abnormal signal position based on the second input signal sequence.
[0086] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0087] In this embodiment, an electronic device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0088] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0089] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0090] S1, obtain real-time abnormal status;
[0091] S2, based on the real-time abnormal state, obtaining a corresponding first input signal sequence in a database, wherein the database stores a corresponding relationship between the abnormal state and the input signal sequence, and the input signal sequence includes signal states of multiple input interfaces;
[0092] S3, comparing the first input signal sequence with the second input signal sequence of the target state to obtain an abnormal signal position, where the abnormal signal position is a position where the first input signal sequence is inconsistent with the second input signal sequence.
[0093] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.
[0094] In addition, in combination with the abnormal state detection method of the state machine provided in the above embodiments, a storage medium can also be provided in this embodiment to implement the abnormal state detection method of the state machine provided in the above embodiments. The storage medium stores a computer program; when the computer program is executed by the processor, any abnormal state detection method of the state machine provided in the above embodiments is implemented.
[0095] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.
[0096] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.
[0097] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.
[0098] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.
Claims
1. A method for detecting abnormal state of a state machine, It is characterized in that include: Get real-time abnormal status; Based on the real-time abnormal state, a corresponding first input signal sequence is acquired in a database, wherein the database stores a corresponding relationship between the abnormal state and the input signal sequence, wherein the input signal sequence includes signal states of multiple input interfaces; the input signal includes an associated signal and a non-associated signal, and the associated signal affects the state of the state machine; Comparing the first input signal sequence with the second input signal sequence of the target state to obtain an abnormal signal position, where the abnormal signal position is a position where the first input signal sequence is inconsistent with the second input signal sequence; The comparing the first input signal sequence with the second input signal sequence of the target state to obtain the abnormal signal position includes: comparing the first input signal sequence with the second input signal sequence to obtain a deviation position, the deviation position being a position where the first input signal sequence and the second input signal sequence are inconsistent; judging whether the input signal corresponding to the deviation position is an associated signal, and if so, determining the deviation position as the abnormal signal position.
2. The abnormal state detection method of the state machine according to claim 1, It is characterized in that The step of obtaining the real-time abnormal status also includes: A corresponding relationship between the input signal sequence and the state of the state machine is established, and the corresponding relationship is saved in a database.
3. The abnormal state detection method of the state machine according to claim 1, It is characterized in that After comparing the first input signal sequence with the second input signal sequence of the target state to obtain the abnormal signal position, the method further includes: Based on the second input signal sequence, a signal state of the input interface corresponding to the abnormal signal position is adjusted.
4. The abnormal state detection method of a state machine according to claim 1, It is characterized in that The state of the state machine includes at least a running state and a debugging state.
5. The abnormal state detection method of a state machine according to claim 1, It is characterized in that The input signal includes at least a system interaction signal and an external interaction signal.
6. An abnormal state detection device for a state machine, It is characterized in that include: Status acquisition module, used to obtain real-time abnormal status; A signal acquisition module, configured to acquire a corresponding first input signal sequence in a database based on the real-time abnormal state, wherein the database stores a correspondence between the abnormal state and the input signal sequence, wherein the input signal sequence includes signal states of multiple input interfaces; the input signal includes an associated signal and a non-associated signal, wherein the associated signal affects the state of the state machine; A comparison module, configured to compare the first input signal sequence with a second input signal sequence of a target state to obtain an abnormal signal position, wherein the abnormal signal position is a position where the first input signal sequence is inconsistent with the second input signal sequence; The comparing the first input signal sequence with the second input signal sequence of the target state to obtain the abnormal signal position includes: comparing the first input signal sequence with the second input signal sequence to obtain a deviation position, the deviation position being a position where the first input signal sequence and the second input signal sequence are inconsistent; judging whether the input signal corresponding to the deviation position is an associated signal, and if so, determining the deviation position as the abnormal signal position.
7. An electronic device comprising a memory and a processor, It is characterized in that A computer program is stored in the memory, and the processor is configured to run the computer program to execute the abnormal state detection method of the state machine according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the abnormal state detection method of the state machine according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Exception prompting method, device and system for big data product, equipment and medium
CN110347560A
Positioning analysis method for CPU failure position and related product
CN113377593A