A key sequence detection method and device

By detecting the key information input by the user and matching it with the preset sequence group, the problems of low key sequence detection efficiency and poor scalability in the prior art are solved, and the key detection requirements in most scenarios are realized, and the encoding efficiency is improved and detection accuracy.

CN115097950BActive Publication Date: 2024-11-22BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210760997.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-29
Publication Date
2024-11-22
Estimated Expiration
2042-06-29

AI Technical Summary

Technical Problem

The existing technology lacks a general key sequence detection method, and it is difficult to meet the user's key detection needs in most scenarios, resulting in low encoding efficiency, more repetitive encoding work, poor code readability, poor maintenance, poor scalability and non-portability.

Method used

By detecting the key information entered by the user, including the key value and system time stamp, it is added to the key sequence group, determining the matching with the preset sequence group, and executing the corresponding business process, using tail insertion method and head element processing, it realizes Real-time updates and accurate detection.

Benefits of technology

It improves coding efficiency, avoids repeated coding work, improves the accuracy and real-timeness of key sequence detection, and is suitable for key detection requirements in most scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115097950B_ABST
    Figure CN115097950B_ABST
Patent Text Reader

Abstract

The present application provides a key sequence detection method and device, the method comprising: detecting key information input by a user; the key information comprises a key value and a system timestamp; adding the key information to a key sequence group to obtain a new key sequence group; judging whether there is a preset sequence group matching the key sequence group in a preset sequence group library; when there is a preset sequence group matching the key sequence group in the preset sequence group library, judging whether the key sequence group is equal to the preset sequence group; when the key sequence group is equal to the preset sequence group, executing the business process corresponding to the preset sequence group. It can be seen that the implementation of this implementation method can meet the key detection requirements in most scenarios, thereby effectively improving the coding efficiency and avoiding repeated coding work.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of system detection, and in particular, to a key sequence detection method and device. Background Art

[0002] At present, in usage scenarios involving interaction between software and users through input devices such as keyboards, the software usually needs to trigger some specific functions of the software based on a key combination with certain meanings and requirements entered by the user, such as using the Ctrl+Alt+Delete key combination sequence in Windows to trigger the Windows Task Manager function. In order for the software to enable users to trigger specific software functions by entering a key sequence that meets the conditions, key sequence detection is usually required. However, the key detection scenarios and requirements vary greatly with user needs, and there is currently no universal key sequence detection method to meet the key detection requirements in most scenarios. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a key sequence detection method and device to meet the key detection requirements in most scenarios, thereby effectively improving the encoding efficiency and avoiding repeated encoding work.

[0004] A first aspect of an embodiment of the present application provides a key sequence detection method, comprising:

[0005] Detecting key information input by a user; the key information includes a key value and a system timestamp;

[0006] Adding the key information to the key sequence group to obtain a new key sequence group;

[0007] Determine whether there is a preset sequence group matching the key sequence group in the preset sequence group library;

[0008] When there is a preset sequence group matching the key sequence group in the preset sequence group library, determining whether the key sequence group is equal to the preset sequence group;

[0009] When the key sequence group is equal to the preset sequence group, the service flow corresponding to the preset sequence group is executed.

[0010] In the above implementation process, the method can preferentially detect the key information input by the user including the key value and the system timestamp, so as to realize the real-time recording of the user operation, thereby facilitating the subsequent detection and judgment of the key sequence; then, the method can add the key information to the key sequence group to obtain a new key sequence group, thereby realizing the real-time update of the key sequence group, and converting the judgment object from the key to the key sequence group, thereby realizing the improvement of the traditional method; then, the method can judge whether there is a preset sequence group matching the key sequence group in the preset sequence group library, thereby realizing the advance judgment of the preset sequence group, thereby obtaining the preliminary judgment result, and realizing the preliminary detection of the key sequence through the preliminary judgment result; then, when there is a preset sequence group matching the key sequence group in the preset sequence group library, it is judged whether the key sequence group is equal to the preset sequence group, thereby realizing the accurate judgment of the key sequence group, thereby ensuring the accurate and effective detection of the key sequence; finally, when the key sequence group is equal to the preset sequence group, the business process corresponding to the preset sequence group is executed, and this step can realize the process execution after the key sequence detection.

[0011] Furthermore, the method further comprises:

[0012] Create business processes based on business needs;

[0013] Constructing a preset sequence group corresponding to the business process;

[0014] A preset sequence group library is created according to the preset sequence group.

[0015] In the above implementation process, the method can create a business process according to business needs, thereby realizing the pre-storage of the business process; then, the method constructs a preset sequence group corresponding to the business process to realize the construction of a benchmark sequence group, thereby providing a basic basis for subsequent detection; finally, the method creates a preset sequence group library based on the preset sequence group, thereby realizing the coexistence of multiple sequences in the preset sequence group library, which is convenient for table lookup and capacity expansion.

[0016] Furthermore, the step of adding the key information to the key sequence group to obtain a new key sequence group includes:

[0017] The key information is added to the tail of the key sequence group by the tail insertion method to obtain a new key sequence group.

[0018] In the above implementation process, the method can process the key information through the tail insertion method, so that the key information in the obtained key sequence group is progressive in order, so that the subsequent steps can make automatic and reasonable judgments based on the order in the sequence, thereby obtaining more accurate key sequence detection results.

[0019] Furthermore, the method further comprises:

[0020] When there is no preset sequence group matching the key sequence group in the preset sequence group library, the head element in the key sequence group is deleted, and the step of determining whether there is a preset sequence group matching the key sequence group in the preset sequence group library is triggered to execute; wherein the head element is the key information located at the head of the key sequence group.

[0021] In the above implementation process, the method can regard the key information with an order relationship as a sequence element, and make corresponding judgments based on the insertion order of the key information, so that the head element is automatically processed when the judgment fails, thereby ensuring the real-time validity of the key sequence group and avoiding invalid key sequence groups occupying the storage space of the detection, affecting the detection efficiency and effect.

[0022] Furthermore, the method further comprises:

[0023] When the key sequence group is not equal to the preset sequence group, the head element in the key sequence group is deleted, and the step of determining whether there is a preset sequence group matching the key sequence group in the preset sequence group library is triggered; wherein the head element is the key information located at the head of the key sequence group.

[0024] In the above implementation process, the method can regard the key information with an order relationship as a sequence element, and make corresponding judgments based on the insertion order of the key information, so that the head element is automatically processed when the judgment fails, thereby ensuring the real-time validity of the key sequence group and avoiding invalid key sequence groups occupying the storage space of the detection, affecting the detection efficiency and effect.

[0025] Furthermore, the step of determining whether there is a preset sequence group matching the key sequence group in the preset sequence group library includes:

[0026] Extracting the first element of the key group in the key sequence group, and extracting the first element of the preset group of the preset sequence group in the preset sequence group library; the first element of the key group is the head element in the key sequence group, and the first element of the preset group is the head element in the preset sequence group;

[0027] Determine whether the first element of the button group exists in the first element of the preset group;

[0028] When the first element of the key group exists in the first element of the preset group, extract the second element of the key group in the key sequence group, and extract the second element of the preset group of the preset sequence group in the preset sequence group library; the second element of the key group is the second element in the key sequence group, and the second element of the preset group is the second element in the preset sequence group;

[0029] Determine whether the button group secondary element exists in the preset group secondary element;

[0030] When the button group second element does not exist in the preset group second element, deleting the button group first element, and determining whether the button sequence group is empty;

[0031] When the key sequence group is not empty, triggering the step of extracting the first element of the key group in the key sequence group, and extracting the first element of the preset group of the preset sequence group in the preset sequence group library;

[0032] When the key sequence group is empty, the step of detecting key information input by the user is triggered.

[0033] In the above implementation process, the method can detect multiple elements in the key sequence group one by one, so as to obtain a valid key sequence group while ensuring that each element is accurate; on the other hand, the method can also delete the first element one by one, and detect the user's input again when all elements are cleared, so as to ensure that the key sequence detection process will not be interrupted by the user's input, thereby improving the real-time and effectiveness of the key sequence detection.

[0034] Furthermore, the step of determining whether the key sequence group is equal to the preset sequence group includes:

[0035] Extracting the key value sequence and the system time difference in the key sequence group, and extracting the preset sequence and the preset time difference in the preset sequence group;

[0036] Determining whether the key value sequence is equal to the preset sequence, and determining whether the system time difference is equal to the preset time difference;

[0037] When the key value sequence is equal to the preset sequence and the system time difference is equal to the preset time difference, it is determined that the key sequence group is equal to the preset sequence group.

[0038] In the above implementation process, the method can further determine whether the key sequence is accurately and effectively input based on the system time difference, thereby improving the recognition dimension of the key sequence and further improving the detection accuracy of the key sequence.

[0039] A second aspect of an embodiment of the present application provides a key sequence detection device, the key sequence detection device comprising:

[0040] A detection unit, used to detect key information input by a user; the key information includes a key value and a system timestamp;

[0041] An adding unit, used for adding the key information to the key sequence group to obtain a new key sequence group;

[0042] A first judging unit, configured to judge whether there is a preset sequence group matching the key sequence group in the preset sequence group library;

[0043] A second judging unit, configured to judge whether the key sequence group is equal to the preset sequence group when there is a preset sequence group matching the key sequence group in the preset sequence group library;

[0044] An execution unit is used to execute the business process corresponding to the preset sequence group when the key sequence group is equal to the preset sequence group.

[0045] In the above implementation process, the key sequence detection device can detect the key information input by the user through the detection unit; the key information includes the key value and the system timestamp; the key information is added to the key sequence group through the adding unit to obtain a new key sequence group; the first judgment unit is used to judge whether there is a preset sequence group matching the key sequence group in the preset sequence group library; the second judgment unit is used to judge whether the key sequence group is equal to the preset sequence group when there is a preset sequence group matching the key sequence group in the preset sequence group library; the execution unit is used to execute the business process corresponding to the preset sequence group when the key sequence group is equal to the preset sequence group. It can be seen that the key sequence detection device can meet the key detection requirements in most scenarios, thereby effectively improving the encoding efficiency and avoiding repeated encoding work.

[0046] A third aspect of an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the key sequence detection method described in any one of the first aspects of the embodiments of the present application.

[0047] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium storing computer program instructions. When the computer program instructions are read and executed by a processor, the key sequence detection method described in any one of the first aspects of the embodiment of the present application is executed. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0049] Figure 1 A flowchart of a key sequence detection method provided in an embodiment of the present application;

[0050] Figure 2 A flowchart of another key sequence detection method provided in an embodiment of the present application;

[0051] Figure 3 A schematic diagram of the structure of a key sequence detection device provided in an embodiment of the present application;

[0052] Figure 4 A schematic diagram of the structure of another key sequence detection device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0054] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0055] Example 1

[0056] Please see Figure 1 , Figure 1 A flowchart of a key sequence detection method is provided for this embodiment. The key sequence detection method includes:

[0057] S101, detecting key information input by a user; the key information includes a key value and a system timestamp.

[0058] In this embodiment, the method can wait for the user to input a key to obtain key information (key input method: including any form such as keyboard input, ordinary key input, voice input, etc.).

[0059] As an optional implementation manner, before detecting key information input by the user, the method further includes:

[0060] Create business processes based on business needs;

[0061] Build preset sequence groups corresponding to business processes;

[0062] Create a preset sequence group library based on the preset sequence group.

[0063] In this embodiment, the method can construct preset key sequence groups according to business needs and set detection rules for each group.

[0064] For example, if the business requirement requires the detection of key input a+b+c+d, and the total key input time must not exceed 700ms, the device log export function is triggered. If the detection key input is b+c+a+d, and the total key input time must not exceed 500ms, the log cleanup work is triggered. The constructed target key sequence group includes two key detection sequences dst0 = ['a, time = 0', 'b, time = 0', 'c, time = 0', 'd, time < 700'] and dst1 = ['b, time = 0', 'c, time = 0', 'a, time = 0', 'd, time < 500'].

[0065] S102: Add the key information to the key sequence group to obtain a new key sequence group.

[0066] S103, determining whether there is a preset sequence group matching the key sequence group in the preset sequence group library, if so, executing step S104; if not, executing step S105.

[0067] S104, determining whether the key sequence group is equal to the preset sequence group, if so, executing step S106; if not, executing step S105.

[0068] In this embodiment, after receiving the key and target key sequence group input by the caller, the method obtains the current system timestamp. The key and the timestamp form a queue item to be detected, and the queue item to be detected is inserted into the queue to be detected of the key sequence detection module by tail insertion. Then the queue item to be detected is compared with the target detection sequence, and the comparison result is finally returned to the caller.

[0069] As an optional implementation, the step of determining whether the key sequence group is equal to the preset sequence group includes:

[0070] Extracting the key value sequence and the system time difference in the key sequence group, and extracting the preset sequence and the preset time difference in the preset sequence group;

[0071] Determine whether the key value sequence is equal to the preset sequence, and determine whether the system time difference is equal to the preset time difference;

[0072] When the key value sequence is equal to the preset sequence and the system time difference is equal to the preset time difference, it is determined that the key sequence group is equal to the preset sequence group.

[0073] In this embodiment, in the process of determining whether the key value sequence is equal to the preset sequence, it is determined whether the key values ​​and the order of the keys are the same as the preset sequence, and whether the number of the keys is the same as the preset sequence.

[0074] S105, delete the head element in the key sequence group, and execute step S103.

[0075] S106: Execute the business process corresponding to the preset sequence group.

[0076] In this embodiment, the key sequence group is initially empty, and the key sequence group is implemented in an array, a linked list, etc. This method forms a queue item to be detected by combining the key input each time with the system timestamp when the key is input, and then inserts the queue item to be detected into the tail of the queue to be detected by the tail insertion method. Then, starting from the head of the queue to be detected, one queue item to be detected is taken out in turn, and compared with each sequence in the target key sequence group from the head in turn, and the comparison content includes: whether the key value is consistent, and whether the key input time interval meets the design requirements in the target key sequence. If the queue to be detected does not match the target key sequence, a queue item to be detected is deleted from the head of the queue to be detected. Then, starting from the head of the queue to be detected, one queue item to be detected is taken out in turn, and compared with each sequence in the target key sequence group from the head in turn again, until the match is successful, or a partial match, or when the queue to be detected is empty, the matching action is no longer executed.

[0077] In this embodiment, the comparison results are specifically divided into:

[0078] Mismatch (the queue to be detected is inconsistent with the target key sequence item, or the queue item to be detected does not meet the time rule of the target key sequence);

[0079] Approximate match (under the premise of meeting the time rule, the target detection sequence item completely contains the queue items to be detected starting from the first element and the order is consistent, such as: the target is: a, b, c, d, and the queue to be detected is: a or a, b or a, b, c, this is called an approximate match);

[0080] Complete match (under the premise of meeting the time rules, the target detection sequence items are completely consistent with the queue to be detected starting from the first element, and the number is the same).

[0081] The comparison results are described in three cases:

[0082] 1) Traverse all target key sequence items from the head and compare them with the queue to be detected. If the comparison results are all mismatches, delete the first element from the head of the queue to be detected, and then traverse all target key sequence items again and compare them with the queue to be detected. Until the queue to be detected is empty, or an approximate match or a complete match occurs;

[0083] 2) Traverse all target key sequence items and compare them with the queue to be detected. If an approximate match appears in the comparison result, it means that the key sequence entered by the user may be correct. At this time, the user needs to enter the remaining keys to determine whether the match is successful. Therefore, the module returns to the caller that the match is unsuccessful and requires the user to continue inputting;

[0084] 3) Traverse all target key sequence items and compare them with the queue to be detected. If a complete match appears in the comparison result, it means that the user has accurately pressed a certain compliant key sequence. At this time, the queue to be detected is deleted and the match is returned to the caller.

[0085] The above method can accurately detect any key sequence. When the target key sequence changes, the caller only needs to change the target key sequence and related parameters. The key detection method does not need to be modified at all.

[0086] At present, this method can solve the problems of poor readability of existing key sequence detection codes; poor maintainability of existing key sequence detection codes; poor scalability of existing key sequence detection codes; lack of portability and universality of existing key sequence detection codes; and the problem that existing key sequence detection codes have complex logic and are very difficult to code when dealing with scenarios where multiple groups of key sequences need to be checked at the same time, and are prone to cause logical confusion and unreliable functions.

[0087] In this embodiment, the execution subject of the method may be a computing device such as a computer or a server, and no limitation is made in this embodiment.

[0088] In this embodiment, the execution subject of the method may also be a smart device such as a smart phone, a tablet computer, etc., which is not limited in this embodiment.

[0089] It can be seen that the key sequence detection method described in this embodiment can meet the key detection requirements in most scenarios, thereby effectively improving the encoding efficiency and avoiding repeated encoding work.

[0090] Example 2

[0091] Please see Figure 2 , Figure 2A flowchart of a key sequence detection method is provided for this embodiment. The key sequence detection method includes:

[0092] S201, detecting key information input by a user; the key information includes a key value and a system timestamp.

[0093] As an optional implementation manner, before detecting key information input by the user, the method further includes:

[0094] Create business processes based on business needs;

[0095] Build preset sequence groups corresponding to business processes;

[0096] Create a preset sequence group library based on the preset sequence group.

[0097] S202: Add the key information to the tail of the key sequence group by tail insertion method to obtain a new key sequence group.

[0098] S203, determining whether there is a preset sequence group matching the key sequence group in the preset sequence group library, if so, executing steps S204 to S205; if not, executing step S206.

[0099] As an optional implementation, the step of determining whether there is a preset sequence group matching the key sequence group in the preset sequence group library includes:

[0100] Extract the first element of the key group in the key sequence group, and extract the first element of the preset group of the preset sequence group in the preset sequence group library; the first element of the key group is the head element in the key sequence group, and the first element of the preset group is the head element in the preset sequence group;

[0101] Determine whether there is a first element of the button group in the first element of the preset group;

[0102] When the first element of the key group exists in the first element of the preset group, the second element of the key group in the key sequence group is extracted, and the second element of the preset group of the preset sequence group in the preset sequence group library is extracted; the second element of the key group is the second element in the key sequence group, and the second element of the preset group is the second element in the preset sequence group;

[0103] Determine whether there is a button group second element in the preset group second element;

[0104] When the second-order element of the key group does not exist in the second-order element of the preset group, the first-order element of the key group is deleted, and it is determined whether the key sequence group is empty;

[0105] When the key sequence group is not empty, triggering the step of extracting the first element of the key group in the key sequence group, and extracting the first element of the preset group of the preset sequence group in the preset sequence group library;

[0106] When the key sequence group is empty, the step of detecting key information input by the user is triggered.

[0107] In this embodiment, each element includes a system time, and the system time difference between two adjacent elements can also be used as key information to assist in detecting whether the key sequence group matches the preset sequence group.

[0108] S204: extracting the key value sequence and the system time difference in the key sequence group, and extracting the preset sequence and the preset time difference in the preset sequence group.

[0109] S205, determining whether the key value sequence is equal to the preset sequence, and determining whether the system time difference is equal to the preset time difference, if so, executing step S207; if not, executing step S206.

[0110] S206: Delete the head element in the key sequence group, and execute step S203.

[0111] S207: Execute the business process corresponding to the preset sequence group.

[0112] For example, the key sequence "a+b+c+d" is pre-set to trigger the device log export; the key sequence "d+b+a+c" triggers the device log clearing function. There is no time requirement for the key sequence.

[0113] If the user enters f, a, d, b, a, c in sequence, the following steps are performed:

[0114] 1) The caller constructs the target key sequence group dst = {['a', 'b', 'c', 'd'], ['d', 'b', 'a', 'c']};

[0115] 2) The user inputs key f;

[0116] 3) The caller inputs the key f and the target key sequence group dst into the universal key detection module;

[0117] 4) The universal key detection module adds the key f to the tail of the queue src to be detected, and src = ['f'];

[0118] 5) Compare src and dst and find that they do not match at all, then delete f from the end of src, and src is empty at this time;

[0119] 6) At this time, the universal key detection module notifies the caller that the input does not match;

[0120] 7) The user inputs key a;

[0121] 8) The caller inputs the key a and the target key sequence group dst into the universal key detection module;

[0122] 9) The universal key detection module adds key a to the tail of the queue src to be detected, and src = ['a'];

[0123] 10) Compare src with dst and find that src approximately matches ['a', 'b', 'c', 'd'] in dst. At this time, the user needs to continue inputting. At this time, the universal key detection module notifies the caller that the input does not match;

[0124] 11) The user inputs key d;

[0125] 12) The caller inputs the key d and the target key sequence group dst into the universal key detection module;

[0126] 13) The universal key detection module adds key d to the tail of the queue src to be detected, and src = ['a', 'd'];

[0127] 14) Compare src with dst and find that src does not match any group in dst, so delete an element from the head of src, and src = ['d'];

[0128] 15) Compare src with dst and find that src approximately matches ['d', 'b', 'a', 'c'] in dst. At this time, the user needs to continue inputting. At this time, the universal key detection module notifies the caller that the input does not match;

[0129] 16) User inputs key b;

[0130] 17) The caller inputs the key b and the target key sequence group dst into the universal key detection module;

[0131] 18) The universal key detection module adds key b to the tail of the queue src to be detected, and src = ['d', 'b'];

[0132] 19) Compare src with dst and find that src approximately matches ['d', 'b', 'a', 'c'] in dst. At this time, the user needs to continue inputting. At this time, the universal key detection module notifies the caller that the input does not match;

[0133] 20) The user inputs key a;

[0134] 21) The caller inputs the key a and the target key sequence group dst into the general key detection module

[0135] 22) The universal key detection module adds key a to the tail of the queue src to be detected. At this time, src = ['d', 'b', 'a'];

[0136] 23) Compare src with dst and find that src approximately matches ['d', 'b', 'a', 'c'] in dst. At this time, the user needs to continue inputting. At this time, the universal key detection module notifies the caller that the input does not match;

[0137] 24) User input key c;

[0138] 25) The caller inputs the key c and the target key sequence group dst into the universal key detection module;

[0139] 26) The universal key detection module adds key c to the tail of the queue src to be detected. At this time, src = ['d', 'b', 'a', 'c'];

[0140] 27) Compare src with dst and find that src matches ['d','b','a','c'] in dst. At this time, the match is successful. After deleting all src, notify the caller that the match is successful and the matching item is the second item of dst.

[0141] 28) The caller finds that the matching item is the second item of dst and executes the device log clearing function.

[0142] For another example, a key sequence of "a+b+c+d" is pre-set to trigger device log export. At the same time, the input interval between keys a and b is required to be less than 500ms, the input interval between keys b and c is required to be less than 600ms, and the input interval between keys c and d is required to be less than 800ms; the key sequence of "d+b+a+c" triggers the device log clearing function and requires the input interval between b and a to be greater than or equal to 1000ms.

[0143] If the user enters f, a at 500ms interval, d at 600ms interval, b at 700ms interval, a at 800ms interval, and c at 1000ms interval, the following steps are performed:

[0144] 1) The caller constructs the target key sequence group dst = {['a, time = 0', 'b, time < 500', 'c, time < 600', 'd, time < 800'], ['d, time = 0', 'b, time = 0', 'a, time > = 1000', 'c, time = 0']};

[0145] 2) The user inputs key f;

[0146] 3) The caller inputs the key f and the target key sequence group dst into the universal key detection module;

[0147] 4) The universal key detection module obtains the current system time (assuming that the current system time is 0), and adds the current system time and key f to the tail of the queue to be detected src. At this time, src = ['f, sys_time = 0'];

[0148] 5) Compare src and dst and find that they do not match at all, then delete f and the timestamp from the end of src, and src is empty at this time;

[0149] 6) At this time, the universal key detection module notifies the caller that the input does not match;

[0150] 7) The user inputs key a;

[0151] 8) The caller inputs the key a and the target key sequence group dst into the universal key detection module;

[0152] 9) The universal key detection module obtains the current system time, and adds the current system time and key a to the tail of the queue to be detected src. At this time, src = ['a, sys_time = 500'];

[0153] 10) Comparing src with dst, it is found that src approximately matches ['a, time = 0', 'b, time < 500', 'c, time < 600', 'd, time < 800'] in dst. At this time, the user needs to continue inputting. At this time, the universal key detection module notifies the caller that the input does not match;

[0154] 11) The user inputs key d;

[0155] 12) The caller inputs the key d and the target key sequence group dst into the universal key detection module;

[0156] 13) The universal key detection module obtains the current system time, and adds the current system time and key d to the tail of the queue src to be detected. At this time, src = ['a, sys_time = 500', 'd, sys_time = 1100'];

[0157] 14) Compare src and dst and find that src does not match any group in dst, so delete an element from the head of src. At this time, src = ['d, sys_time = 1100'];

[0158] 15) Compare src with dst and find that src approximately matches ['d, time = 0', 'b, time = 0', 'a, time > = 1000', 'c, time = 0'] in dst. At this time, the user needs to continue inputting. At this time, the universal key detection module notifies the caller that the input does not match;

[0159] 16) User inputs key b;

[0160] 17) The caller inputs the key b and the target key sequence group dst into the universal key detection module;

[0161] 18) The universal key detection module obtains the current system time, adds the current system time and key b to the tail of the queue to be detected src, and now src = ['d, sys_time = 1100', 'b, sys_time = 1800']

[0162] 19) Compare src with dst and find that src approximately matches ['d, time = 0', 'b, time = 0', 'a, time > = 1000', 'c, time = 0'] in dst. At this time, the user needs to continue inputting. At this time, the universal key detection module notifies the caller that the input does not match;

[0163] 20) The user inputs key a;

[0164] 21) The caller inputs the key a and the target key sequence group dst into the universal key detection module;

[0165] 22) The universal key detection module obtains the current system time, and adds the current system time and key a to the tail of the queue src to be detected. At this time, src = ['d, sys_time = 1100', 'b, sys_time = 1800', 'a, sys_time = 2600'];

[0166] 23) Compare src with dst and find the target key sequence items in src and dst ['d, time = 0', 'b, time = 0', 'a, time > = 1000', 'c, time = 0']. Although the key sequences are similar, the input time difference between b and a in src is 800ms, while the time interval between b and a in dst is required to be greater than 1000ms. Therefore, the match fails at this time and an element needs to be deleted from the src header. At this time, src = ['b, sys_time = 1800', 'a, sys_time = 2600'];

[0167] 24) Compare src and dst again, and if they do not match at all, delete an element from the src header again. Now src = ['a, sys_time = 2600'];

[0168] 25) Compare src and dst again. If they do not match at all, delete an element from the head of src again. At this time, src is empty, and the caller is notified of the mismatch.

[0169] 26) User input key c;

[0170] 27) The caller inputs the key c and the target key sequence group dst into the universal key detection module;

[0171] 28) The universal key detection module obtains the current system time, and adds the current system time and key c to the tail of the queue src to be detected. At this time, src = ['c, sys_time = 3600'];

[0172] 29) Compare src and dst and find that they do not match at all. Delete an element from the head of src. At this time, src is empty, and return to notify the caller of the mismatch.

[0173] 30) The caller decides whether to continue waiting for user input;

[0174] In this embodiment, the execution subject of the method may be a computing device such as a computer or a server, and no limitation is made in this embodiment.

[0175] In this embodiment, the execution subject of the method may also be a smart device such as a smart phone, a tablet computer, etc., which is not limited in this embodiment.

[0176] It can be seen that the key sequence detection method described in this embodiment can meet the key detection requirements in most scenarios, thereby effectively improving the encoding efficiency and avoiding repeated encoding work.

[0177] Example 3

[0178] Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of a key sequence detection device provided in this embodiment. Figure 3 As shown, the key sequence detection device includes:

[0179] The detection unit 310 is used to detect the key information input by the user; the key information includes the key value and the system timestamp;

[0180] An adding unit 320, used for adding the key information to the key sequence group to obtain a new key sequence group;

[0181] The first determination unit 330 is used to determine whether there is a preset sequence group matching the key sequence group in the preset sequence group library;

[0182] The second judging unit 340 is used to judge whether the key sequence group is equal to the preset sequence group when there is a preset sequence group matching the key sequence group in the preset sequence group library;

[0183] The execution unit 350 is configured to execute the service flow corresponding to the preset sequence group when the key sequence group is equal to the preset sequence group.

[0184] In this embodiment, the explanation of the key sequence detection device can refer to the description in Embodiment 1 or Embodiment 2, and will not be further elaborated in this embodiment.

[0185] It can be seen that the key sequence detection device described in this embodiment can meet the key detection requirements in most scenarios, thereby effectively improving the encoding efficiency and avoiding repeated encoding work.

[0186] Example 4

[0187] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of a key sequence detection device provided in this embodiment. Figure 4 As shown, the key sequence detection device includes:

[0188] The detection unit 310 is used to detect the key information input by the user; the key information includes the key value and the system timestamp;

[0189] An adding unit 320, used for adding the key information to the key sequence group to obtain a new key sequence group;

[0190] The first determination unit 330 is used to determine whether there is a preset sequence group matching the key sequence group in the preset sequence group library;

[0191] The second judging unit 340 is used to judge whether the key sequence group is equal to the preset sequence group when there is a preset sequence group matching the key sequence group in the preset sequence group library;

[0192] The execution unit 350 is configured to execute the service flow corresponding to the preset sequence group when the key sequence group is equal to the preset sequence group.

[0193] As an optional implementation, the key sequence detection device further includes:

[0194] A creation unit 360, used to create a business process according to business requirements;

[0195] A construction unit 370, configured to construct a preset sequence group corresponding to a business process;

[0196] The creating unit 360 is used to create a preset sequence group library according to the preset sequence group.

[0197] As an optional implementation, the adding unit 320 is specifically configured to add the key information to the tail of the key sequence group by a tail insertion method to obtain a new key sequence group.

[0198] As an optional implementation, the key sequence detection device further includes:

[0199] The deleting unit 380 is used to delete the head element in the key sequence group when there is no preset sequence group matching the key sequence group in the preset sequence group library, and trigger the first judging unit 330 to perform an operation of judging whether there is a preset sequence group matching the key sequence group in the preset sequence group library; wherein the head element is the key information located at the head of the key sequence group.

[0200] As an optional implementation, the key sequence detection device further includes:

[0201] The deleting unit 380 is used to delete the head element in the key sequence group when the key sequence group is not equal to the preset sequence group, and trigger the first judging unit 330 to perform an operation of judging whether there is a preset sequence group matching the key sequence group in the preset sequence group library; wherein the head element is the key information located at the head in the key sequence group.

[0202] As an optional implementation manner, the first determination unit 330 includes:

[0203] The first extraction subunit 331 is used to extract the first element of the key group in the key sequence group, and extract the first element of the preset group of the preset sequence group in the preset sequence group library; the first element of the key group is the head element in the key sequence group, and the first element of the preset group is the head element in the preset sequence group;

[0204] The first judging subunit 332 is used to judge whether there is a first element of the key group in the first element of the preset group;

[0205] The first extraction subunit 331 is further used to extract the key group second element in the key sequence group when there is a key group first element in the preset group first element, and extract the preset group second element of the preset sequence group in the preset sequence group library; the key group second element is the second element in the key sequence group, and the preset group second element is the second element in the preset sequence group;

[0206] The first judging subunit 332 is further used to judge whether there is a key group secondary element in the preset group secondary element;

[0207] The first deletion subunit 333 is used to delete the first element of the key group when there is no second element of the key group in the second element of the preset group, and to determine whether the key sequence group is empty; and when the key sequence group is not empty, trigger the first extraction subunit 331 to perform the operation of extracting the first element of the key group in the key sequence group, and extracting the first element of the preset group of the preset sequence group in the preset sequence group library; and when the key sequence group is empty, trigger the detection unit 310 to perform the operation of detecting the key information input by the user.

[0208] As an optional implementation manner, the second determination unit 340 includes:

[0209] The second extraction subunit 341 is used to extract the key value sequence and the system time difference in the key sequence group, and to extract the preset sequence and the preset time difference in the preset sequence group;

[0210] The second judgment subunit 342 is used to judge whether the key value sequence is equal to the preset sequence, and judge whether the system time difference is equal to the preset time difference; when the key value sequence is equal to the preset sequence and the system time difference is equal to the preset time difference, it is determined that the key sequence group is equal to the preset sequence group.

[0211] In this embodiment, the explanation of the key sequence detection device can refer to the description in Embodiment 1 or Embodiment 2, and will not be further elaborated in this embodiment.

[0212] It can be seen that the key sequence detection device described in this embodiment can meet the key detection requirements in most scenarios, thereby effectively improving the encoding efficiency and avoiding repeated encoding work.

[0213] An embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the key sequence detection method in Embodiment 1 or Embodiment 2 of the present application.

[0214] An embodiment of the present application provides a computer-readable storage medium storing computer program instructions. When the computer program instructions are read and executed by a processor, the key sequence detection method in Embodiment 1 or Embodiment 2 of the present application is executed.

[0215] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0216] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0217] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0218] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0219] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0220] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

Claims

1. A key sequence detection method, It is characterized in that include: Detect key information input by the user; The key information includes a key value and a system timestamp; Adding the key information to the key sequence group to obtain a new key sequence group; Determine whether there is a preset sequence group matching the key sequence group in the preset sequence group library; When there is a preset sequence group matching the key sequence group in the preset sequence group library, determining whether the key sequence group is equal to the preset sequence group; When the key sequence group is equal to the preset sequence group, executing the business process corresponding to the preset sequence group; Wherein, the method further comprises: When there is no preset sequence group matching the key sequence group in the preset sequence group library, the head element in the key sequence group is deleted, and the step of determining whether there is a preset sequence group matching the key sequence group in the preset sequence group library is triggered to execute; wherein the head element is the key information located at the head of the key sequence group.

2. The key sequence detection method according to claim 1, It is characterized in that The method further comprises: Create business processes based on business needs; Constructing a preset sequence group corresponding to the business process; A preset sequence group library is created according to the preset sequence group.

3. The key sequence detection method according to claim 1, It is characterized in that The step of adding the key information to the key sequence group to obtain a new key sequence group comprises: The key information is added to the tail of the key sequence group by the tail insertion method to obtain a new key sequence group.

4. The key sequence detection method according to claim 1, It is characterized in that The method further comprises: When the key sequence group is not equal to the preset sequence group, the head element in the key sequence group is deleted, and the step of determining whether there is a preset sequence group matching the key sequence group in the preset sequence group library is triggered; wherein the head element is the key information located at the head of the key sequence group.

5. The key sequence detection method according to claim 1, It is characterized in that The step of determining whether there is a preset sequence group matching the key sequence group in the preset sequence group library comprises: Extracting the first element of the key group in the key sequence group, and extracting the first element of the preset group of the preset sequence group in the preset sequence group library; the first element of the key group is the head element in the key sequence group, and the first element of the preset group is the head element in the preset sequence group; Determine whether the first element of the button group exists in the first element of the preset group; When the first element of the key group exists in the first element of the preset group, extract the second element of the key group in the key sequence group, and extract the second element of the preset group of the preset sequence group in the preset sequence group library; the second element of the key group is the second element in the key sequence group, and the second element of the preset group is the second element in the preset sequence group; Determine whether the button group secondary element exists in the preset group secondary element; When the button group second element does not exist in the preset group second element, deleting the button group first element, and determining whether the button sequence group is empty; When the key sequence group is not empty, triggering the step of extracting the first element of the key group in the key sequence group, and extracting the first element of the preset group of the preset sequence group in the preset sequence group library; When the key sequence group is empty, the step of detecting key information input by the user is triggered.

6. The key sequence detection method according to claim 1, It is characterized in that The step of determining whether the key sequence group is equal to the preset sequence group comprises: Extracting the key value sequence and the system time difference in the key sequence group, and extracting the preset sequence and the preset time difference in the preset sequence group; Determining whether the key value sequence is equal to the preset sequence, and determining whether the system time difference is equal to the preset time difference; When the key value sequence is equal to the preset sequence and the system time difference is equal to the preset time difference, it is determined that the key sequence group is equal to the preset sequence group.

7. A key sequence detection device, It is characterized in that The key sequence detection device comprises: A detection unit, used to detect key information input by a user; the key information includes a key value and a system timestamp; An adding unit, used for adding the key information to the key sequence group to obtain a new key sequence group; A first judging unit, configured to judge whether there is a preset sequence group matching the key sequence group in the preset sequence group library; A second judging unit, configured to judge whether the key sequence group is equal to the preset sequence group when there is a preset sequence group matching the key sequence group in the preset sequence group library; an execution unit, configured to execute a business process corresponding to the preset sequence group when the key sequence group is equal to the preset sequence group; Wherein, the key sequence detection device also includes: A deleting unit is used to delete the head element in the key sequence group when there is no preset sequence group matching the key sequence group in the preset sequence group library, and trigger the first judgment unit to perform an operation of judging whether there is a preset sequence group matching the key sequence group in the preset sequence group library; wherein the head element is the key information located at the head of the key sequence group.

8. An electronic device, It is characterized in that The electronic device comprises a memory and a processor, the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to perform the key sequence detection method according to any one of claims 1 to 6.

9. A readable storage medium, It is characterized in that The readable storage medium stores computer program instructions, and when the computer program instructions are read and executed by a processor, the key sequence detection method according to any one of claims 1 to 6 is executed.