Instruction verification method, device, equipment and storage medium

By obtaining the byte array and initial verification byte of the instruction to be verified, the target verification byte is determined and adjusted, which solves the problem of low verification efficiency of satellite remote control instructions, realizes automatic verification and completion, and improves the verification efficiency. Test efficiency.

CN115081429BActive Publication Date: 2024-10-22BEIJING WEINA STAR TECH CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210802484.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-07
Publication Date
2024-10-22
Estimated Expiration
2042-07-07

AI Technical Summary

Technical Problem

In the existing satellite remote control command uploading and telemetry content downloading system, the command verification efficiency is low and requires frequent copying and pasting of buttons, resulting in time consumption and low efficiency.

Method used

By obtaining the byte array and initial verification byte of the instruction to be verified, the target verification byte is determined. If an error is found, the instruction to be verified is adjusted to obtain the correct target instruction, thereby realizing automatic verification and completion of batch instructions. .

Benefits of technology

It improves the speed, accuracy and efficiency of instruction verification, reduces the frequent copy and paste clicks of manual operations, saves staff time and improves work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115081429B_ABST
    Figure CN115081429B_ABST
Patent Text Reader

Abstract

The present invention discloses an instruction verification method, device, equipment and storage medium. The method comprises: obtaining an instruction to be verified, wherein the instruction to be verified comprises a byte array and an initial verification byte; determining a target verification byte according to the byte array, wherein the target verification byte comprises: a first verification byte and a second verification byte; if the instruction to be verified is determined to be an erroneous instruction according to the first verification byte, the second verification byte and the initial verification byte, adjusting the instruction to be verified according to the first verification byte and the second verification byte to obtain a target instruction. The embodiment of the present invention obtains the instruction to be verified, determines the target verification byte according to the byte array, and adjusts the instruction to be verified according to the target verification byte to obtain the target instruction, thereby realizing a process of quickly, accurately and efficiently verifying the instruction to be verified and obtaining the correct target instruction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to an instruction checking method, device, equipment and storage medium. Background Art

[0002] Currently, there is a system for uploading satellite remote control commands and downloading telemetry content. This system needs to be used with three tables: remote control command table, telemetry package table, and telemetry package content table. All three tables are EXCEL tables. There is currently a verification tool with an input box for command verification, but only one command can be entered at a time, and then a button is clicked for XOR and verification. After the verification is completed, it is copied and pasted into the remote control command table. However, if there are many commands that need to be verified, it is necessary to frequently copy, paste, and click buttons, which is relatively inefficient and time-consuming. Summary of the invention

[0003] The present invention provides an instruction verification method, device, equipment and storage medium to realize a process of quickly, accurately and efficiently verifying instructions to be verified and obtain correct target instructions.

[0004] According to one aspect of the present invention, there is provided an instruction checking method, the method comprising:

[0005] Obtaining an instruction to be verified, wherein the instruction to be verified includes a byte array and an initial verification byte;

[0006] Determine a target check byte according to the byte array, wherein the target check byte includes: a first check byte and a second check byte;

[0007] If the instruction to be checked is determined to be an erroneous instruction according to the first check byte, the second check byte and the initial check byte, the instruction to be checked is adjusted according to the first check byte and the second check byte to obtain a target instruction.

[0008] According to another aspect of the present invention, there is provided an instruction checking device, the device comprising:

[0009] An acquisition module, used for acquiring an instruction to be checked, wherein the instruction to be checked includes a byte array and an initial check byte;

[0010] A first determination module is used to determine a target check byte according to the byte array, wherein the target check byte includes: a first check byte and a second check byte;

[0011] The adjustment module is used to adjust the instruction to be checked according to the first check byte and the second check byte to obtain a target instruction if it is determined that the instruction to be checked is an erroneous instruction according to the first check byte, the second check byte and the initial check byte.

[0012] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0013] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the instruction checking method described in any embodiment of the present invention.

[0014] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the instruction checking method described in any embodiment of the present invention when executed.

[0015] The technical solution of the embodiment of the present invention obtains the instruction to be checked, wherein the instruction to be checked includes a byte array and an initial check byte, determines the target check byte according to the byte array, wherein the target check byte includes a first check byte and a second check byte, and if the instruction to be checked is determined to be an erroneous instruction according to the first check byte, the second check byte and the initial check byte, the instruction to be checked is adjusted according to the first check byte and the second check byte to obtain the target instruction. The embodiment of the present invention can realize the process of quickly, accurately and efficiently checking the instruction to be checked, and obtain the correct target instruction.

[0016] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0018] Figure 1 is a flow chart of an instruction checking method provided according to the first embodiment of the present invention;

[0019] Figure 2is a rendering of an instruction checking method provided according to Embodiment 1 of the present invention;

[0020] Figure 3 is a structural diagram of an instruction checking device provided according to Embodiment 2 of the present invention;

[0021] Figure 4 It is a schematic diagram of the structure of an electronic device for implementing the instruction checking method of an embodiment of the present invention. DETAILED DESCRIPTION

[0022] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0023] It should be noted that the terms "first", "target", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0024] Embodiment 1

[0025] Figure 1 1 is a flowchart of an instruction verification method provided according to Embodiment 1 of the present invention. This embodiment is applicable to instruction verification situations. The method can be executed by an instruction verification device. The instruction verification device can be implemented in the form of hardware and / or software. The instruction verification device can be integrated in any electronic device that provides an instruction verification function. Figure 1 As shown, the method includes:

[0026] S101, obtaining the instruction to be verified.

[0027] In this embodiment, the instruction to be verified may be an initial instruction to be verified. Exemplarily, the initial instruction may be a satellite remote control instruction.

[0028] The instruction to be checked includes a byte array and an initial check byte.

[0029] It should be noted that the byte array may be the main data component of the instruction to be checked, and the initial check byte may be the data component used for instruction verification. In this embodiment, the complete instruction to be checked may be composed of 16-bit bytes of hexadecimal data, wherein the hexadecimal data of the first 14 bytes of the instruction to be checked constitute the byte array, and the hexadecimal data of the last two bytes are the initial check bytes.

[0030] Specifically, a batch of instructions to be verified is obtained. In actual operation, the obtained batch of instructions to be verified may include complete instructions to be verified, that is, the instructions to be verified are composed of 16 bytes of hexadecimal data, wherein the first 14 bytes of hexadecimal data constitute a byte array, and the last two bytes of hexadecimal data are initial verification bytes.

[0031] S102. Determine a target check byte according to the byte array.

[0032] It should be noted that the target check byte may be the correct check byte corresponding to the instruction to be checked determined based on the byte array in the instruction to be checked.

[0033] The target check byte includes: a first check byte and a second check byte.

[0034] In this embodiment, the target check byte may be composed of two bytes of hexadecimal data, the hexadecimal data of the first byte in the target check byte is the first check byte, and the hexadecimal data of the second byte in the target check byte is the second check byte.

[0035] Specifically, an XOR operation is performed on the byte array in each instruction to be checked to determine the first check byte and the second check byte corresponding to each instruction to be checked, and the target check byte corresponding to each instruction to be checked is determined based on the first check byte and the second check byte corresponding to each instruction to be checked.

[0036] S103: If the instruction to be checked is determined to be an erroneous instruction according to the first check byte, the second check byte and the initial check byte, the instruction to be checked is adjusted according to the first check byte and the second check byte to obtain a target instruction.

[0037] It should be noted that an erroneous instruction may mean that the initial check byte is incorrectly equivalent to the instruction to be checked, that is, after performing an XOR operation on the byte array in the instruction to be checked, the target check byte obtained is different from the initial check byte.

[0038] The adjustment operation may be to overwrite the initial check byte in the instruction to be checked with the determined first check byte and the second check byte.

[0039] It should be noted that the target instruction may be a complete and correct instruction obtained after checking and adjusting the instruction to be checked.

[0040] Specifically, if the target check byte determined according to the byte array of a certain instruction to be checked is different from its initial check byte, the instruction to be checked is determined to be an erroneous instruction, and the initial check byte in the instruction to be checked is overwritten with the determined first check byte and second check byte to obtain the correct target instruction.

[0041] The technical solution of the embodiment of the present invention obtains the instruction to be checked, wherein the instruction to be checked includes a byte array and an initial check byte, determines the target check byte according to the byte array, wherein the target check byte includes a first check byte and a second check byte, and if the instruction to be checked is determined to be an erroneous instruction according to the first check byte, the second check byte and the initial check byte, the instruction to be checked is adjusted according to the first check byte and the second check byte to obtain the target instruction. The embodiment of the present invention can realize the process of quickly, accurately and efficiently checking the instruction to be checked, and obtain the correct target instruction.

[0042] Optionally, the initial check byte includes a first initial check byte and a second initial check byte.

[0043] In this embodiment, the initial check byte may be composed of two bytes of hexadecimal data, the hexadecimal data of the first byte in the initial check byte is the first initial check byte, and the hexadecimal data of the second byte in the initial check byte is the second initial check byte.

[0044] Correspondingly, if the instruction to be checked is determined to be an erroneous instruction according to the first check byte, the second check byte and the initial check byte, the instruction to be checked is adjusted according to the first check byte and the second check byte to obtain the target instruction, including:

[0045] If the first check byte is different from the first initial check byte, and / or the second check byte is different from the second initial check byte, it is determined that the instruction to be checked is an erroneous instruction.

[0046] Specifically, if a first check byte determined according to the byte array of a certain instruction to be checked is different from its first initial check byte, or a second check byte determined according to the byte array is different from its second initial check byte, or a first check byte determined according to the byte array is different from its first initial check byte and a second check byte determined according to the byte array is different from its second initial check byte, then the instruction to be checked is determined to be an erroneous instruction.

[0047] The first check byte and the second check byte overwrite the initial check byte to obtain the target instruction.

[0048] Specifically, the first check byte determined according to the byte array in the instruction to be checked overwrites the first initial check byte in the instruction to be checked, and the second check byte determined according to the byte array in the instruction to be checked overwrites the second initial check byte in the instruction to be checked to obtain the target instruction.

[0049] Optionally, the method further includes:

[0050] If the first check byte is the same as the first initial check byte, and the second check byte is the same as the second initial check byte, then it is determined that the instruction to be checked is a correct instruction.

[0051] It should be noted that a correct instruction may mean that the initial check byte is equivalent to the correct instruction to be checked, that is, after performing an XOR operation on the byte array in the instruction to be checked, the target check byte obtained is the same as the initial check byte.

[0052] Specifically, if the first check byte determined according to the byte array of a certain instruction to be checked is the same as the first initial check byte thereof, and the second check byte determined according to the byte array is the same as the second initial check byte thereof, then the instruction to be checked is determined to be a correct instruction. If the instruction to be checked is a correct instruction, then the instruction to be checked is not processed.

[0053] Optionally, after obtaining the instruction to be verified, the following is further included:

[0054] Determine whether the number of bytes in the byte array in the instruction to be checked is less than the byte number threshold.

[0055] The byte count threshold may be the number of bytes in the byte array of the instruction to be checked, which is set according to the total number of bytes in the byte array of the complete instruction to be checked. For example, the total number of bytes in the byte array of the complete instruction to be checked may be 14, and the byte count threshold may be set to 14.

[0056] Specifically, after obtaining a batch of instructions to be verified, it is determined whether the number of bytes in the byte array of each instruction to be verified is less than the byte number threshold, that is, it is determined whether the byte array of each instruction to be verified is complete. In the actual operation process, the obtained batch of instructions to be verified may include complete instructions to be verified, that is, the instructions to be verified are composed of 16-bit bytes of hexadecimal data, wherein the first 14 bytes of hexadecimal data constitute the byte array, and the last two bytes of hexadecimal data are the initial verification bytes; at the same time, the obtained batch of instructions to be verified may also include incomplete instructions, that is, the instructions to be verified only contain byte arrays, and the initial verification bytes are missing, or the instructions to be verified only contain part of the byte array, the byte array is incomplete and the initial verification bytes are missing.

[0057] If the number of bytes in the byte array in the instruction to be checked is less than the byte number threshold, the difference between the byte number threshold and the byte number is determined as the number of missing bytes.

[0058] The number of missing bytes may be the number of bytes missing from the byte array of the instruction to be checked compared with the total number of bytes of the complete byte array of the instruction to be checked.

[0059] Specifically, it is determined whether the number of bytes in the byte array of each instruction to be checked is less than the byte number threshold. If the number of bytes in the byte array of a certain instruction to be checked is less than the byte number threshold, the difference between the byte number threshold and the number of bytes in the byte array of the instruction to be checked is determined as the number of missing bytes. Exemplarily, the total number of bytes in the byte array of a complete instruction to be checked may be 14, and the byte number threshold may be set to 14. If the number of bytes in the byte array of a certain instruction to be checked is 7, the difference between the byte number threshold 14 and the number of bytes of the byte array of the instruction to be checked is 7, and the number of missing bytes is determined as 7.

[0060] Complete the instruction to be verified according to the number of missing bytes and the preset value.

[0061] In this embodiment, the preset value may be a hexadecimal number used to complete the instruction to be checked. Specifically, the preset value may be set by the user according to actual conditions. For example, the preset value may be a hexadecimal number AA.

[0062] Specifically, the preset value of the number of missing bytes is completed in the instruction to be checked. Exemplarily, the byte number threshold can be set to 14, and the preset value can be set to AA. If a certain instruction to be checked is 22 00 06 01 0C 01 01, the number of bytes of the byte array of the instruction to be checked is 7. If it is determined that the number of bytes of the byte array in the instruction to be checked is less than the byte number threshold, 7 AAs are used to complete the instruction to be checked, and the completed instruction to be checked is 22 00 06 010C 01 01 AA AA AA AA AA AA AA.

[0063] Optionally, determine the target check byte based on the byte array, including:

[0064] The first check byte is determined based on the odd-numbered bytes in the byte array.

[0065] It should be explained that the odd-numbered bytes may be the odd-numbered bytes in the byte array of the instruction to be checked, for example, the first byte, the third byte, the fifth byte, the seventh byte, the ninth byte, etc. Specifically, the number of odd-numbered bytes may be determined according to the total number of bytes in the byte array of the instruction to be checked, for example, if the total number of bytes in the byte array of the instruction to be checked is 14, then the number of odd-numbered bytes may be 7.

[0066] Specifically, an XOR operation is performed on the odd-numbered bytes in the byte array of the instruction to be checked to obtain a first check byte. For example, the first byte and the third byte in the byte array of the instruction to be checked are XORed, and the result is XORed with the fifth byte, and so on, until the last odd-numbered byte in the byte array of the instruction to be checked is XORed, and the XOR result obtained is the first check byte.

[0067] The second check byte is determined based on the even-numbered bytes in the byte array.

[0068] It should be explained that the even-numbered bytes may be the even-numbered bytes in the byte array of the instruction to be checked, for example, the second byte, the fourth byte, the sixth byte, the eighth byte, the tenth byte, etc. Specifically, the number of even-numbered bytes may be determined according to the total number of bytes in the byte array of the instruction to be checked, for example, if the total number of bytes in the byte array of the instruction to be checked is 14, then the number of even-numbered bytes may be 7.

[0069] Specifically, an XOR operation is performed on the even-numbered bytes in the byte array of the instruction to be checked to obtain a first check byte. For example, the second byte and the fourth byte in the byte array of the instruction to be checked are XORed, and the obtained result is XORed with the sixth byte, and so on, until the XOR operation is performed on the last even-numbered byte in the byte array of the instruction to be checked, and the obtained XOR result is the second check byte.

[0070] A target check byte is determined according to the first check byte and the second check byte.

[0071] Specifically, the first check byte and the second check byte are combined to form the target check byte. In this embodiment, the first check byte and the second check byte can be combined in such a way that the first check byte is in front and the second check byte is in the back.

[0072] Optionally, determining the first check byte according to odd-numbered bytes in the byte array includes:

[0073] An XOR operation is performed on the first odd-numbered byte and the second odd-numbered byte in the byte array to obtain a first odd-numbered XOR result.

[0074] The first odd-numbered byte may be the first byte in the instruction to be checked, and the second odd-numbered byte may be the third byte in the instruction to be checked.

[0075] It should be noted that the XOR operation may be to first convert the hexadecimal numbers of the first odd-numbered byte and the second odd-numbered byte in the byte array into binary numbers, and then perform an XOR operation on the first odd-numbered byte and the second odd-numbered byte in the byte array.

[0076] The first odd-bit XOR result may be a result obtained by performing an XOR operation on the first byte in the instruction to be checked and the third byte in the instruction to be checked.

[0077] Specifically, the hexadecimal numbers of the first byte in the instruction to be checked and the third byte in the instruction to be checked are first converted into binary numbers, and then the two numbers are XORed to obtain the first odd-bit XOR result.

[0078] An XOR operation is performed on the Nth odd-numbered bit XOR result and the N+2th odd-numbered bit byte to obtain the N+1th odd-numbered bit XOR result, where N=1, 2, 3, 4, 5.

[0079] Specifically, the total number of bytes of the byte array of the complete instruction to be checked may be 14, that is, the number of odd bytes in the byte array of the instruction to be checked may be 7. The first odd byte in the byte array is XORed with the second odd byte to obtain a first odd XOR result, the first odd XOR result is XORed with the third odd byte to obtain a second odd XOR result, the second odd XOR result is XORed with the fourth odd byte to obtain a third odd XOR result, and so on, the fifth odd XOR result is XORed with the seventh odd byte to obtain a sixth odd XOR result.

[0080] The XOR result of the sixth odd bit is determined as the first check byte.

[0081] The sixth odd-bit XOR result may be an XOR result obtained by performing an XOR operation on the fifth odd-bit XOR result and the seventh odd-bit byte in the byte array.

[0082] It should be noted that the hexadecimal number in the byte array needs to be converted into a binary number each time an XOR operation is performed. Therefore, after the XOR result of the fifth odd-numbered bit in the byte array is XORed with the seventh odd-numbered bit byte to obtain the XOR result, the XOR result needs to be converted into a hexadecimal number and the hexadecimal number is determined as the first check byte.

[0083] Optionally, determining a second check byte according to even-numbered bytes in the byte array includes:

[0084] An XOR operation is performed on the first even-numbered byte and the second even-numbered byte in the byte array to obtain a first even-numbered XOR result.

[0085] The first even-numbered byte may be the second byte in the instruction to be checked, and the second even-numbered byte may be the fourth byte in the instruction to be checked.

[0086] It should be noted that the XOR operation can be performed by first converting the hexadecimal numbers of the first even-numbered byte and the second even-numbered byte in the byte array into binary numbers, and then performing an XOR operation on the first even-numbered byte and the second even-numbered byte in the byte array.

[0087] The first even-numbered bit XOR result may be a result obtained by performing an XOR operation on the second byte in the instruction to be checked and the fourth byte in the instruction to be checked.

[0088] Specifically, the hexadecimal numbers of the second byte in the instruction to be checked and the fourth byte in the instruction to be checked are first converted into binary numbers, and then the two numbers are XORed to obtain the first even-bit XOR result.

[0089] An XOR operation is performed on the Nth even-bit XOR result and the N+2th even-bit byte to obtain the N+1th even-bit XOR result, where N=1, 2, 3, 4, 5.

[0090] Specifically, the total number of bytes of the byte array of the complete instruction to be checked may be 14, that is, the number of even bytes in the byte array of the instruction to be checked may be 7. The first even byte in the byte array is XORed with the second even byte to obtain the first even XOR result, the first even XOR result is XORed with the third even byte to obtain the second even XOR result, the second even XOR result is XORed with the fourth even byte to obtain the third even XOR result, and so on, the fifth even XOR result is XORed with the seventh even byte to obtain the sixth even XOR result.

[0091] The XOR result of the sixth even-numbered bit is determined as the second check byte.

[0092] The sixth even-bit XOR result may be an XOR result obtained by performing an XOR operation on the fifth even-bit XOR result and the seventh even-bit byte in the byte array.

[0093] It should be noted that the hexadecimal number in the byte array needs to be converted into a binary number each time an XOR operation is performed. Therefore, after the XOR result of the fifth even-bit byte in the byte array is XORed with the seventh even-bit byte to obtain the XOR result, the XOR result needs to be converted into a hexadecimal number and the hexadecimal number is determined as the second check byte.

[0094] In the specific implementation process of the technical solution of the embodiment of the present invention, after first obtaining a batch of instructions to be verified, a new EXCEL table can be created, and the "Tools → Macro → Visual Basic (a language) Editor" menu command in the menu bar of the EXCEL table is executed (or the shortcut key "Alt+F11" can be pressed through the shortcut method), the Visual Basic editing window is opened, and the "Insert → Module" menu command is executed in the window to insert a new module, and the relevant code of the technical solution of the embodiment of the present invention is entered in the "Code Window" on the right. After the entry is completed, the window is closed, and the custom function is completed. The custom function can be named jy (the abbreviation of the Chinese pinyin of the verification), and then this custom function can be used like a built-in function. Figure 2 is a rendering of an instruction checking method provided according to the first embodiment of the present invention. Figure 2 As shown, copy and paste the obtained batch of instructions to be verified into column A of the newly created EXCEL table, enter the custom function name jy in the input cell, click the OK button, and the automatic verification of the batch of instructions to be verified can be achieved through the drop-down function.

[0095] Figure 2 Column A is the batch of instructions to be verified, and column B is the target instructions after verification. Figure 2 It can be seen that, through the technical solution of the embodiment of the present invention, the instruction to be checked can be automatically completed, the target check byte can be determined, and finally the target instruction can be obtained (for example Figure 2 For the error instruction with incorrect initial check bytes in the instruction to be checked, the target instruction can be automatically adjusted (for example, Figure 2 For the instruction to be checked that lacks the initial check byte, the target check byte can be automatically calculated and added to the instruction to be checked to obtain the target instruction (for example Figure 2 The fifteenth line of the command to be verified).

[0096] The technical solution of the embodiment of the present invention can realize batch verification of instructions through custom functions, can automatically complete the instructions to be verified, and automatically correct the initial verification bytes in the instructions to be verified. It can solve the operations of frequent copying, pasting and clicking buttons, which can save the time of staff and improve the work efficiency of staff.

[0097] Embodiment 2

[0098] Figure 3 Schematic diagram of the structure of an instruction checking device provided according to the second embodiment of the present invention. Figure 3 As shown, the device includes: an acquisition module 201, a first determination module 202 and an adjustment module 203.

[0099] Wherein, the acquisition module 201 is used to acquire the instruction to be checked, wherein the instruction to be checked includes a byte array and an initial check byte;

[0100] A first determination module 202 is configured to determine a target check byte according to the byte array, wherein the target check byte includes: a first check byte and a second check byte;

[0101] The adjustment module 203 is used to adjust the instruction to be checked according to the first check byte and the second check byte to obtain a target instruction if it is determined that the instruction to be checked is an erroneous instruction according to the first check byte, the second check byte and the initial check byte.

[0102] Optionally, the initial check byte includes a first initial check byte and a second initial check byte;

[0103] Accordingly, the adjustment module 203 includes:

[0104] a first determining unit, configured to determine that the instruction to be checked is an erroneous instruction if the first check byte is different from the first initial check byte and / or the second check byte is different from the second initial check byte;

[0105] The overwriting unit is used to overwrite the initial check byte with the first check byte and the second check byte to obtain a target instruction.

[0106] Optionally, the device further comprises:

[0107] The second determination module is used to determine that the instruction to be checked is a correct instruction if the first check byte is the same as the first initial check byte, and the second check byte is the same as the second initial check byte.

[0108] Optionally, the device further comprises:

[0109] A judgment module, used for judging whether the number of bytes in the byte array in the instruction to be checked is less than a byte number threshold after obtaining the instruction to be checked;

[0110] A third determination module is used for, after obtaining the instruction to be checked, if the number of bytes in the byte array in the instruction to be checked is less than a byte number threshold, determining the difference between the byte number threshold and the number of bytes as the number of missing bytes;

[0111] The completion module is used to complete the instruction to be checked according to the number of missing bytes and a preset value after obtaining the instruction to be checked.

[0112] Optionally, the first determining module 202 includes:

[0113] A second determining unit, configured to determine a first check byte according to odd-numbered bytes in the byte array;

[0114] A third determining unit, configured to determine a second check byte according to the even-numbered bytes in the byte array;

[0115] The fourth determining unit is configured to determine a target check byte according to the first check byte and the second check byte.

[0116] Optionally, the third determining unit is specifically configured to:

[0117] Performing an XOR operation on the first odd-numbered byte and the second odd-numbered byte in the byte array to obtain a first odd-numbered XOR result;

[0118] Perform an XOR operation on the Nth odd-bit XOR result and the N+2th odd-bit byte to obtain the N+1th odd-bit XOR result, where N=1, 2, 3, 4, 5;

[0119] The XOR result of the sixth odd bit is determined as the first check byte.

[0120] Optionally, the fourth determining unit is specifically configured to:

[0121] Performing an XOR operation on the first even-numbered byte and the second even-numbered byte in the byte array to obtain a first even-numbered XOR result;

[0122] Perform an XOR operation on the Nth even-bit XOR result and the N+2th even-bit byte to obtain the N+1th even-bit XOR result, where N=1, 2, 3, 4, 5;

[0123] The XOR result of the sixth even-numbered bit is determined as the second check byte.

[0124] The instruction checking device provided in the embodiment of the present invention can execute the instruction checking method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0125] Embodiment 3

[0126] Figure 4 A schematic diagram of the structure of an electronic device 30 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0127] like Figure 4 As shown, the electronic device 30 includes at least one processor 31, and a memory connected to the at least one processor 31, such as a read-only memory (ROM) 32, a random access memory (RAM) 33, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 31 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 32 or the computer program loaded from the storage unit 38 to the random access memory (RAM) 33. In the RAM 33, various programs and data required for the operation of the electronic device 30 can also be stored. The processor 31, the ROM 32, and the RAM 33 are connected to each other through a bus 34. An input / output (I / O) interface 35 is also connected to the bus 34.

[0128] A number of components in the electronic device 30 are connected to the I / O interface 35, including: an input unit 36, such as a keyboard, a mouse, etc.; an output unit 37, such as various types of displays, speakers, etc.; a storage unit 38, such as a disk, an optical disk, etc.; and a communication unit 39, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 39 allows the electronic device 30 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0129] The processor 31 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 31 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 31 performs the various methods and processes described above, such as the instruction verification method:

[0130] Obtaining an instruction to be verified, wherein the instruction to be verified includes a byte array and an initial verification byte;

[0131] Determine a target check byte according to the byte array, wherein the target check byte includes: a first check byte and a second check byte;

[0132] If the instruction to be checked is determined to be an erroneous instruction according to the first check byte, the second check byte and the initial check byte, the instruction to be checked is adjusted according to the first check byte and the second check byte to obtain a target instruction.

[0133] In some embodiments, the instruction checking method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 38. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 30 via the ROM 32 and / or the communication unit 39. When the computer program is loaded into the RAM 33 and executed by the processor 31, one or more steps of the instruction checking method described above may be performed. Alternatively, in other embodiments, the processor 31 may be configured to perform the instruction checking method in any other appropriate manner (e.g., by means of firmware).

[0134] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0135] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0136] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0137] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0138] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0139] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0140] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0141] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A command verification method, It is characterized in that include: Obtaining an instruction to be verified, wherein the instruction to be verified includes a byte array and an initial verification byte; Determine a target check byte according to the byte array, wherein the target check byte includes: a first check byte and a second check byte; If it is determined that the instruction to be checked is an erroneous instruction according to the first check byte, the second check byte and the initial check byte, the instruction to be checked is adjusted according to the first check byte and the second check byte to obtain a target instruction; Wherein, determining the target check byte according to the byte array includes: Determine a first check byte according to the odd-numbered bytes in the byte array; Determine a second check byte according to the even-numbered bytes in the byte array; Determine a target check byte according to the first check byte and the second check byte; The step of determining the first check byte according to the odd-numbered bytes in the byte array includes: Performing an XOR operation on the first odd-numbered byte and the second odd-numbered byte in the byte array to obtain a first odd-numbered XOR result; XOR the Nth odd-bit XOR result with the N+2th odd-bit byte to obtain the N+1th odd-bit XOR result, where N=1, 2, 3, 4, 5; The XOR result of the sixth odd bit is determined as the first check byte.

2. The method according to claim 1, It is characterized in that The initial check bytes include a first initial check byte and a second initial check byte; Correspondingly, if the instruction to be checked is determined to be an erroneous instruction according to the first check byte, the second check byte and the initial check byte, the instruction to be checked is adjusted according to the first check byte and the second check byte to obtain a target instruction, including: If the first check byte is different from the first initial check byte, and / or the second check byte is different from the second initial check byte, determining that the instruction to be checked is an erroneous instruction; The first check byte and the second check byte are overwritten on the initial check byte to obtain a target instruction.

3. The method according to claim 2, It is characterized in that Also includes: If the first check byte is the same as the first initial check byte, and the second check byte is the same as the second initial check byte, it is determined that the instruction to be checked is a correct instruction.

4. The method according to claim 1, It is characterized in that After obtaining the instruction to be verified, it also includes: Determine whether the number of bytes in the byte array in the instruction to be checked is less than a byte number threshold; If the number of bytes in the byte array in the instruction to be checked is less than the byte number threshold, the difference between the byte number threshold and the byte number is determined as the number of missing bytes; According to the number of missing bytes and a preset value, the instruction to be checked is completed.

5. The method according to claim 1, It is characterized in that Determining a second check byte according to the even-numbered bytes in the byte array includes: Performing an XOR operation on the first even-numbered byte and the second even-numbered byte in the byte array to obtain a first even-numbered XOR result; XOR the Nth even-bit XOR result with the N+2th even-bit byte to obtain the N+1th even-bit XOR result, where N=1, 2, 3, 4, 5; The XOR result of the sixth even-numbered bit is determined as the second check byte.

6. An instruction checking device, It is characterized in that include: An acquisition module, used for acquiring an instruction to be checked, wherein the instruction to be checked includes a byte array and an initial check byte; A first determination module is used to determine a target check byte according to the byte array, wherein the target check byte includes: a first check byte and a second check byte; an adjustment module, configured to adjust the instruction to be checked according to the first check byte and the second check byte to obtain a target instruction if the instruction to be checked is determined to be an erroneous instruction according to the first check byte, the second check byte and the initial check byte; Wherein, the first determining module includes: A second determining unit, configured to determine a first check byte according to odd-numbered bytes in the byte array; A third determining unit, configured to determine a second check byte according to the even-numbered bytes in the byte array; a fourth determining unit, configured to determine a target check byte according to the first check byte and the second check byte; The third determining unit is specifically used for: Performing an XOR operation on the first odd-numbered byte and the second odd-numbered byte in the byte array to obtain a first odd-numbered XOR result; XOR the Nth odd-bit XOR result with the N+2th odd-bit byte to obtain the N+1th odd-bit XOR result, where N=1, 2, 3, 4, 5; The XOR result of the sixth odd bit is determined as the first check byte.

7. An electronic device, It is characterized in that The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the instruction checking method according to any one of claims 1 to 5.

8. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the instruction checking method according to any one of claims 1 to 5 when executed.