Instruction generation method, instruction parsing method and device
By performing arithmetic operations and partial encoding processing on the transmitted instructions, target instructions are generated, and combined with the binary conversion and fill-up information, the redundant data and easy-to-crack problems in traditional data packets are solved, achieving higher data Security and storage efficiency.
Patent Information
- Application Number
- CN202311319302.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-11
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2043-10-11
AI Technical Summary
Traditional data packets contain a large amount of redundant data during encryption processing, and the header and tail of the packet are easily cracked, resulting in the risk of data leakage or tampering.
By detecting the trigger of the target functional control, the instructions to be used are determined, and arithmetic operations and partial encoding are performed on them to generate the target instructions. This method no longer uses the traditional head and tail data method of preset instruction data for encryption, reduces redundant data, and enhances the security of data transmission through the combination of phase conversion and complement information.
It effectively improves data security during instruction transmission, reduces the amount of redundant data, saves storage space, and prevents the leakage or tampering of instruction data.
Smart Images

Figure CN117395326B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data security technology, and in particular to an instruction generation method, an instruction parsing method and a device. Background Art
[0002] With the development of communication technology, the security of data transmission between devices is very important.
[0003] At present, the information transmitted between devices is usually transmitted in the form of data messages, but traditional data messages usually use relatively similar message headers and message tails to encrypt the transmitted data. This operation method will cause the final transmitted data to contain a large amount of redundant data, and similar message headers and message tails are easy to be cracked, resulting in data leakage or malicious data tampering;
[0004] In order to ensure the security of data transmission, the data encryption and decryption methods need to be improved. Summary of the invention
[0005] The present invention provides an instruction generation method, an instruction parsing method and an apparatus to solve the risk of instruction data being leaked or tampered with during traditional instruction transmission, and the problem of data storage space being wasted due to a large amount of redundant data in traditional instructions.
[0006] In a first aspect, an embodiment of the present invention provides an instruction generation method, comprising:
[0007] When it is detected that the target function control is triggered, determining the instruction to be used corresponding to the target function control; wherein the target function control is deployed in the display interface of the first communication device;
[0008] Encoding the instruction to be used to obtain an instruction to be processed, and determining target instruction filling information corresponding to the instruction to be processed;
[0009] A target instruction is obtained based on the instruction to be processed and the target instruction filling information, and the target instruction is sent to a second communication device connected to the first communication device.
[0010] In a second aspect, an embodiment of the present invention further provides an instruction parsing method, comprising:
[0011] Receiving the target instruction, and parsing to obtain valid instruction information in the target instruction; wherein the valid instruction information is consistent with the instruction information contained in the instruction to be processed;
[0012] Reversely encoding the valid instruction information to obtain instruction information to be corrected;
[0013] The instruction information to be corrected is subjected to instruction correction to obtain a target control instruction, and the second communication device is controlled to execute a corresponding device function based on the target control instruction.
[0014] In a third aspect, an embodiment of the present invention further provides an instruction generation device, including:
[0015] A to-be-used instruction determination module, configured to determine, when detecting that a target function control is triggered, an instruction to be used corresponding to the target function control; wherein the target function control is deployed in a display interface of a first communication device;
[0016] An instruction padding information determination module, used for encoding the instruction to be used to obtain an instruction to be processed, and determining target instruction padding information corresponding to the instruction to be processed;
[0017] The instruction sending module is used to obtain a target instruction based on the instruction to be processed and the target instruction filling information, and send the target instruction to a second communication device connected to the first communication device.
[0018] In a fourth aspect, an embodiment of the present invention further provides an instruction parsing device, comprising:
[0019] An effective instruction information determination module, used for receiving the target instruction and parsing to obtain effective instruction information in the target instruction; wherein the effective instruction information is consistent with the instruction information contained in the instruction to be processed;
[0020] An instruction information determination module, used for reverse encoding the valid instruction information to obtain the instruction information to be corrected;
[0021] The device control module is used to perform instruction correction on the instruction information to be corrected to obtain a target control instruction, and control the second communication device to execute a corresponding device function based on the target control instruction.
[0022] The technical solution of the embodiment of the present invention is to determine the instruction to be used corresponding to the target function control when it is detected that the target function control is triggered; encode the instruction to be used to obtain the instruction to be processed, and determine the target instruction filling information corresponding to the instruction to be processed; obtain the target instruction based on the instruction to be processed and the target instruction filling information, and send the target instruction to the second communication device connected to the first communication device. In this technical solution, when transmitting instructions between two communication devices, the instruction to be used is no longer encrypted by the traditional method of presetting the head and tail data of the instruction data, but firstly the instruction to be used is processed based on arithmetic operations and base conversion to obtain the instruction to be processed. Furthermore, the target instruction filling information is determined according to the number of data bits contained in the instruction obtained after the base conversion, and then the target instruction filling information is combined with the instruction to be processed to obtain the target instruction, and the target instruction is sent to the second communication device, so that the second communication device performs the corresponding device function based on the target instruction. Since the process of generating the target instruction in this technical solution is completely different from the traditional instruction generation method, if you want to parse the target instruction, you must first obtain the instruction parsing method corresponding to the target instruction, otherwise you will not be able to easily obtain the instruction information carried in the target instruction. Therefore, this technical solution greatly improves the data security during the instruction transmission process. In addition, the redundant data contained in this technical solution is far less than the amount of redundant data in the traditional instruction generation process, so the effect of saving storage space is achieved.
[0023] 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
[0024] 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.
[0025] Figure 1 is a flow chart of an instruction generation method provided according to Embodiment 1 of the present invention;
[0026] Figure 2 is a flow chart of an instruction parsing method provided according to Embodiment 2 of the present invention;
[0027] Figure 3 is a flowchart of a specific example of an instruction generation method provided according to an embodiment of the present invention;
[0028] Figure 4 is a flowchart of a specific example of an instruction parsing method provided according to an embodiment of the present invention;
[0029] Figure 5 is a schematic diagram of the structure of an instruction generating device provided according to Embodiment 3 of the present invention;
[0030] Figure 6 It is a structural diagram of an instruction parsing device provided according to Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0031] 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.
[0032] It should be noted that the terms "first", "second", 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 numbers 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.
[0033] Before elaborating on the technical solution in detail, the application scenario of the technical solution is briefly introduced to make the technical solution more clearly understood. The communication protocol between traditional hardware is easily captured by packet sniffing software, such as existing packet sniffing software WireShark, Fiddler or mitmproxy. After obtaining the request or response content, the packet sniffing software can crack the content in the request or response content, thereby forging the transmission instructions between devices and affecting system security. In order to maintain system security, the front and back ends of the valid data in the traditional instructions usually need to add some unnecessary data, such as 30 3a ba 08 62 4a .....83 b3 bd, resulting in the data carried in the instruction being very redundant, usually reaching more than 20 bits to represent an instruction. Moreover, since the instructions are in a tree structure, there are many similar data between the same instructions. For example, turning on the microphone and turning off the microphone may contain similar parts, such as both containing "ac 10 15". Such instruction setting methods are easily cracked. Based on this, this technical solution adopts a completely hashed corresponding method, and there are no similar headers between instructions, so that when actually generating or parsing instructions, it can effectively prevent the valid data carried by the instructions from being leaked or tampered with. Secondly, in order to solve the problem of wasting storage space due to redundant data carried by instructions, this technical solution uses less data to encrypt valid data, so as to achieve the effect of small amount of data carried by instructions and save memory space.
[0034] Embodiment 1
[0035] Figure 1 A flowchart of an instruction generation method is provided for the first embodiment of the present invention. This embodiment can be applied to the situation where, when it is detected that a target function control in a display interface of a first communication device is triggered, arithmetic operations and base encoding and other operations are performed on the instruction to be used corresponding to the target function control to obtain a target instruction, and the target instruction is sent to a second communication device, so as to control the second communication device to perform a corresponding device function based on the target instruction. The method can be executed by an instruction generation device, which can be implemented in the form of hardware and / or software, and the instruction generation device can be configured in a computing device that can execute the instruction generation method.
[0036] like Figure 1 As shown, the method includes:
[0037] S110: When it is detected that the target function control is triggered, determine the instruction to be used corresponding to the target function control.
[0038] In this technical solution, the transmission of instructions usually occurs between two communication devices, and the amount of data carried by the instructions is small, usually not involving very large data, and is very suitable for application scenarios of small data instruction transmission. For example, this technical solution can be applied to data transmission between a conference host and a target microphone.
[0039] Taking the application scenario of data transmission between a conference host and a target microphone as an example, optionally, if the first communication device is a conference host, the second communication device is a target microphone connected to the conference host; if the first communication device is a target microphone, the second device is a conference host connected to the target microphone. That is to say, in actual applications, the conference host can send control instructions to the target microphone, such as querying the microphone power of the target microphone, turning the microphone on or off, etc. Alternatively, the target microphone can also send a request instruction to the conference host. For example, based on the display interface of the target microphone, a request instruction can be sent to the conference host, such as "provide conference materials to the conference room."
[0040] For ease of understanding, this embodiment is described by taking the first communication device as a conference host and the second communication device as a target microphone as an example.
[0041] Among them, the target function control is deployed in the display interface of the first communication device, that is, the target function control is the function control in the display interface of the conference host. The so-called target function control refers to the function control that is triggered in the display interface. For example, in the display interface of the first communication device, there are three function controls of "check microphone power", "turn on microphone" and "turn off microphone". When the "turn on microphone" function control is triggered, the target function control is the "turn on microphone" function control. The instruction to be used refers to the functional instruction corresponding to the target function control. For example, if the target function control is "turn on microphone", the instruction to be used is an instruction containing "turn on microphone" information, which is used to send the instruction to be used to the target microphone, and after the target microphone receives and parses the instruction to be used, control the target microphone to turn on.
[0042] In actual applications, the user can trigger the target function control from at least one function control in the display interface of the first communication device according to the needs. When it is detected that the target function control in the display interface of the first communication device is triggered, the instruction to be used corresponding to the target function control is determined based on the preset target mapping table. The target mapping table includes at least one function control and the instruction to be triggered corresponding to each function control.
[0043] S120, performing encoding processing based on the instruction to be used to obtain the instruction to be processed, and determining the target instruction filling information corresponding to the instruction to be processed.
[0044] Among them, the pending instruction refers to the instruction obtained after encoding the data carried in the instruction to be used. In the present technical solution, when the pending instruction is obtained based on the pending instruction, data operations and base conversion and the like can be performed on the pending instruction. In order to prevent the pending instruction from being intercepted and cracked during the transmission process, in the present technical solution, on the basis of the pending instruction, security data is further added to the front end of the data contained in the instruction to be processed to enhance the security of data transmission. Among them, the security data can be preset data, and the security data is not fixed data, and the number of data bits of the security data is also not fixed. For example, the security data is set to "0", and the number of data bits of the specific security data can be determined by the number of data bits of the data corresponding to the pending instruction.
[0045] In actual applications, since the data transmission content between the first communication device and the second communication device is relatively fixed, the protocol information corresponding to the transmission instructions between the first communication device and the second communication device can be preset. For example, in the communication protocol between the first communication device and the second communication device, it is stipulated that "0" corresponds to "microphone off" and "1" corresponds to "microphone on". In other words, the functions to be executed between the first communication device and the second communication device can be set correspondingly with easily identifiable digital information.
[0046] In a specific example, Figure 3 As shown, when the target function control is "check the microphone power", based on the target mapping table, it can be known that the number "5" corresponds to this function, that is, the instruction to be used is "5". In order to prevent the instructions from being cracked, the technical solution needs to encode the instructions to be used to obtain the instructions to be processed. Optionally, encoding the instructions to be used to obtain the instructions to be processed includes: converting the instructions to be used based on a preset first conversion method to obtain the instructions to be converted; encoding the instructions to be converted to obtain the instructions to be processed.
[0047] In the present technical solution, the first conversion mode may be an arithmetic operation mode, for example, the first conversion mode may be a conversion mode of performing "addition, subtraction, multiplication and division" on the instruction to be used. The instruction to be converted refers to a data instruction obtained after performing an arithmetic operation on the instruction to be used.
[0048] Based on the above examples, continue to see Figure 3 , the instruction to be used is "5", and the "+1" operation is performed on the basis of the instruction to be used to obtain the instruction to be converted "6". Further, the instruction to be converted "6" is binary-encoded to obtain the binary data instruction corresponding to the instruction to be converted. Then, after the instruction to be converted is converted through the binary encoding, the instruction to be processed is "110".
[0049] It should be noted that when performing base encoding on instructions, binary, quaternary, octal or hexadecimal systems can be used. In other words, the specific conversion method for base encoding conversion is not limited in this technical solution, and only binary encoding is used as an example in this technical solution.
[0050] Optionally, determining the target instruction fill information corresponding to the instruction to be processed includes: determining the number of to-be-filled bits corresponding to the instruction to be processed based on the number of characters contained in the instruction to be processed; and obtaining the target instruction fill information corresponding to the instruction to be processed based on the number of to-be-filled bits and preset instruction fill information.
[0051] Among them, the number of characters refers to the number of data bits corresponding to the data contained in the instruction to be processed. The number of bits to be filled is the number of data bits corresponding to the security data. For example, if the instruction to be processed is "110", the number of characters is 3. The number of bits to be filled can be determined based on the number of characters. For example, if the number of bits to be filled is set to one less than the number of characters, the number of bits to be filled is 2. The so-called preset instruction filling information is the security data mentioned above. For example, the preset instruction filling information is "0". Based on this, the target instruction filling information "00" can be obtained according to the number of bits to be filled and the preset instruction filling information.
[0052] S130: Obtain a target instruction based on the instruction to be processed and the target instruction filling information, and send the target instruction to a second communication device connected to the first communication device.
[0053] Based on the above example, continue to see Figure 3 , add the target instruction padding information "00" to the front end based on the instruction to be processed "110" to obtain the target instruction "00110", and send the target instruction to the second communication device connected to the first communication device, so that the second communication device receives and parses the target instruction, and controls the second communication device to execute the corresponding device function.
[0054] The technical solution of the embodiment of the present invention is to determine the instruction to be used corresponding to the target function control when it is detected that the target function control is triggered; encode the instruction to be used to obtain the instruction to be processed, and determine the target instruction filling information corresponding to the instruction to be processed; obtain the target instruction based on the instruction to be processed and the target instruction filling information, and send the target instruction to the second communication device connected to the first communication device. In this technical solution, when transmitting instructions between two communication devices, the instruction to be used is no longer encrypted by the traditional method of presetting the head and tail data of the instruction data, but firstly the instruction to be used is processed based on arithmetic operations and base conversion to obtain the instruction to be processed. Furthermore, the target instruction filling information is determined according to the number of data bits contained in the instruction obtained after the base conversion, and then the target instruction filling information is combined with the instruction to be processed to obtain the target instruction, and the target instruction is sent to the second communication device, so that the second communication device performs the corresponding device function based on the target instruction. Since the process of generating the target instruction in this technical solution is completely different from the traditional instruction generation method, if you want to parse the target instruction, you must first obtain the instruction parsing method corresponding to the target instruction, otherwise you will not be able to easily obtain the instruction information carried in the target instruction. Therefore, this technical solution greatly improves the data security during the instruction transmission process. In addition, the redundant data contained in this technical solution is far less than the amount of redundant data in the traditional instruction generation process, so the effect of saving storage space is achieved.
[0055] Embodiment 2
[0056] Figure 2 A flowchart of an instruction parsing method is provided for the second embodiment of the present invention. This embodiment can be applied to the situation where a target instruction is parsed after being received, and a second communication device is controlled to perform a corresponding device function according to the target instruction. The method can be executed by an instruction parsing device, which can be implemented in the form of hardware and / or software, and the instruction parsing device can be configured in a computing device that can execute the instruction parsing method.
[0057] like Figure 2 As shown, the method includes:
[0058] S210: Receive a target instruction, and parse to obtain valid instruction information in the target instruction.
[0059] The effective instruction information is consistent with the instruction information included in the instruction to be processed.
[0060] In actual applications, after receiving the target instruction, the second communication device may parse the target instruction to control the second communication device to execute a corresponding device function based on the target instruction.
[0061] Optionally, parsing to obtain valid instruction information in the target instruction includes: determining the instruction reading position in the target instruction, and the number of character bits of the character to be read starting from the instruction reading position; determining the target number of character bits corresponding to the valid instruction information in the target instruction based on the number of character bits, and reading instruction characters consistent with the target number of character bits starting from the instruction reading position to obtain the valid instruction information in the target instruction.
[0062] In the present technical solution, since the instruction information carried by the target instruction needs to be transmitted confidentially, a small amount of prefix data is included in the target instruction to protect the valid instruction information. The instruction reading position refers to the boundary position between the prefix data contained in the target instruction and the valid instruction information. The characters to be read can be understood as character information corresponding to the valid instruction information, such as the characters to be read can be characters composed of numbers. The valid instruction information can be understood as the information in the target instruction that actually represents the functional control of the first communication device over the second communication device.
[0063] In practical applications, the target instruction is detected based on the preset instruction padding information until the position of the non-preset instruction padding information is detected, and the position between the last preset instruction padding information and the first non-preset instruction padding information is used as the instruction reading position of the target instruction. Further, according to the number of data bits of the preset instruction padding information in the target instruction, the number of character bits of the character to be read in the target instruction is determined, and the number of bits corresponding to the character bit is read backward from the first non-preset padding information to obtain the valid instruction information in the target instruction.
[0064] For example, based on the example of embodiment 1, Figure 4 As shown, the target instruction is "00110", and the preset instruction padding information is "0". Then, the data with the first bit being "0" (i.e., the preset instruction padding information) is read, until a non-"0" (i.e., non-preset instruction padding information) position is read. The total number of "0"s read is 2, i.e., the number of character bits of the character to be read is 2. Further, 3 instruction characters (i.e., the number of target character bits) are read backward from the first non-"0" digit to obtain "110". At this point, it is determined that the valid instruction information in the target instruction is "110".
[0065] S220: Reverse encode the valid instruction information to obtain the instruction information to be corrected.
[0066] The instruction information to be corrected refers to the instruction information obtained by reversely encoding the valid instruction information.
[0067] Specifically, reverse encoding the valid instruction information to obtain the instruction information to be corrected includes: determining the reverse encoding method corresponding to the valid instruction information according to the encoding method corresponding to the instruction to be used; and reverse encoding the valid instruction information based on the reverse encoding method to obtain the instruction information to be corrected.
[0068] The so-called reverse encoding method refers to an encoding method that is opposite to the encoding method used for the instruction to be used. For example, if the instruction to be used adopts a binary encoding method, the reverse encoding method is a reverse binary encoding.
[0069] Based on the above example, continue to see Figure 4 If the decimal number "6" is encoded in binary to obtain "110", the reverse encoding method refers to converting "110" from binary to decimal to obtain "6", that is, the instruction information to be corrected is "6".
[0070] S230: Perform instruction correction on the instruction information to be corrected to obtain a target control instruction, and control the second communication device to execute a corresponding device function based on the target control instruction.
[0071] The target control instruction parsed by the second communication device is the instruction to be used corresponding to the target function control.
[0072] Optionally, performing instruction correction on the instruction information to be corrected to obtain a target control instruction includes: performing information conversion on the instruction information to be corrected based on a preset second conversion method to obtain a target control instruction; wherein the second conversion method is opposite to the first conversion method corresponding to the instruction to be used.
[0073] Based on the above example, continue to see Figure 4 After obtaining the instruction information to be corrected, the target control instruction can be obtained by further performing reverse arithmetic operations on the instruction information to be corrected. Specifically, if the instruction information to be corrected is "6", then the "-1" operation is performed on the basis of "6" to obtain the target control instruction "5". That is, the device function corresponding to the target control instruction is consistent with the device function selected based on the first communication device. Based on this, the second communication device can know that the device function to be executed is "check the microphone power" after obtaining the target control instruction.
[0074] It should be noted that in the present technical solution, only the example when the number of target function controls triggered is 1 is used for explanation. In actual applications, the user can trigger multiple target function controls in sequence, and send the to-be-used instructions corresponding to the multiple target function controls to the second communication device, so as to obtain multiple target control instructions based on the instruction information of the multiple received target instructions in sequence by the second communication device, and perform corresponding function control on the second communication device.
[0075] Exemplarily, multiple target function controls are triggered based on the display interface of the first communication device to obtain multiple instructions to be used, such as the instructions to be used corresponding to the triggered target function controls are "1", "2" and "3" in sequence. Further, target instructions corresponding to each instruction to be used are obtained respectively, and the multiple target instructions are sent to the second communication device in sequence.
[0076] In addition, the instructions to be used may be sent sequentially, or the instructions to be used may be separated by separators, and multiple instructions to be used may be spliced to obtain a target processing instruction, so as to convert the target processing instruction to obtain a target instruction corresponding to the target processing instruction. At this time, the target instruction includes multiple instruction function information. Further, after the target instruction is sent to the second communication device, the second communication device may identify and parse the target instruction, and execute the corresponding device functions in sequence based on the target instruction.
[0077] The technical solution of the embodiment of the present invention receives the target instruction and parses it to obtain the valid instruction information in the target instruction; reversely encodes the valid instruction information to obtain the instruction information to be corrected; performs instruction correction on the instruction information to be corrected to obtain the target control instruction, and controls the second communication device to perform the corresponding device function based on the target control instruction. In this technical solution, after the second communication device receives the target instruction, since the first communication device is a device connected to the second communication device, that is, the first communication device and the second communication device are mutually authorized devices. Based on this, after receiving the target instruction, the second communication device can know the parsing method of the target instruction, and parse the target instruction to obtain the valid instruction information in the target instruction, and then convert the valid instruction information into the target control instruction, so as to control the second communication device to perform the corresponding device function based on the target control instruction. The problem of the risk of instruction data being leaked or tampered with in the traditional instruction transmission process is solved, and the effect of ensuring data security in the instruction transmission process is achieved by setting a special instruction generation method and instruction parsing method.
[0078] Embodiment 3
[0079] Figure 5 This is a schematic diagram of the structure of an instruction generation device provided by Embodiment 3 of the present invention. Figure 5 As shown, the device includes: a module 310 for determining instructions to be used, a module 320 for determining instruction filling information, and a module 330 for sending instructions.
[0080] The to-be-used instruction determination module 310 is used to determine the to-be-used instruction corresponding to the target function control when it is detected that the target function control is triggered; wherein the target function control is deployed in the display interface of the first communication device;
[0081] The instruction padding information determining module 320 is used to perform encoding processing based on the instruction to be used to obtain the instruction to be processed, and determine the target instruction padding information corresponding to the instruction to be processed;
[0082] The instruction sending module 330 is used to obtain a target instruction based on the instruction to be processed and the target instruction filling information, and send the target instruction to the second communication device connected to the first communication device.
[0083] The technical solution of the embodiment of the present invention is to determine the instruction to be used corresponding to the target function control when it is detected that the target function control is triggered; encode the instruction to be used to obtain the instruction to be processed, and determine the target instruction filling information corresponding to the instruction to be processed; obtain the target instruction based on the instruction to be processed and the target instruction filling information, and send the target instruction to the second communication device connected to the first communication device. In this technical solution, when transmitting instructions between two communication devices, the instruction to be used is no longer encrypted by the traditional method of presetting the head and tail data of the instruction data, but firstly the instruction to be used is processed based on arithmetic operations and base conversion to obtain the instruction to be processed. Furthermore, the target instruction filling information is determined according to the number of data bits contained in the instruction obtained after the base conversion, and then the target instruction filling information is combined with the instruction to be processed to obtain the target instruction, and the target instruction is sent to the second communication device, so that the second communication device performs the corresponding device function based on the target instruction. Since the process of generating the target instruction in this technical solution is completely different from the traditional instruction generation method, if you want to parse the target instruction, you must first obtain the instruction parsing method corresponding to the target instruction, otherwise you will not be able to easily obtain the instruction information carried in the target instruction. Therefore, this technical solution greatly improves the data security during the instruction transmission process. In addition, the redundant data contained in this technical solution is far less than the amount of redundant data in the traditional instruction generation process, so the effect of saving storage space is achieved.
[0084] Optionally, the instruction padding information determination module includes: a to-be-converted instruction determination unit, configured to perform instruction conversion on the to-be-used instruction based on a preset first conversion method to obtain the to-be-converted instruction;
[0085] The pending instruction determination unit is used to perform binary encoding on the instruction to be converted to obtain the pending instruction.
[0086] Optionally, the instruction fill-in information determination module includes: a digit determination unit, used to determine the number of digits to be filled corresponding to the instruction to be processed according to the number of characters contained in the instruction to be processed;
[0087] The instruction padding information determining unit is used to obtain target instruction padding information corresponding to the instruction to be processed based on the number of bits to be filled and preset instruction padding information.
[0088] The instruction generation device provided in the embodiment of the present invention can execute the instruction generation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0089] Embodiment 4
[0090] Figure 6 This is a schematic diagram of the structure of an instruction parsing device provided by Embodiment 4 of the present invention. Figure 6 As shown, the apparatus includes: a valid instruction information determination module 410, an instruction information determination module 420 and a device control module 430;
[0091] The effective instruction information determination module 410 is used to receive the target instruction and parse the target instruction to obtain the effective instruction information; wherein the effective instruction information is consistent with the instruction information contained in the instruction to be processed;
[0092] The instruction information determination module 420 is used to reverse encode the valid instruction information to obtain the instruction information to be corrected;
[0093] The device control module 430 is used to perform instruction correction on the instruction information to be corrected to obtain a target control instruction, and control the second communication device to execute a corresponding device function based on the target control instruction.
[0094] The technical solution of the embodiment of the present invention receives the target instruction and parses it to obtain the valid instruction information in the target instruction; reversely encodes the valid instruction information to obtain the instruction information to be corrected; performs instruction correction on the instruction information to be corrected to obtain the target control instruction, and controls the second communication device to perform the corresponding device function based on the target control instruction. In this technical solution, after the second communication device receives the target instruction, since the first communication device is a device connected to the second communication device, that is, the first communication device and the second communication device are mutually authorized devices. Based on this, after receiving the target instruction, the second communication device can know the parsing method of the target instruction, and parse the target instruction to obtain the valid instruction information in the target instruction, and then convert the valid instruction information into the target control instruction, so as to control the second communication device to perform the corresponding device function based on the target control instruction. The problem of the risk of instruction data being leaked or tampered with in the traditional instruction transmission process is solved, and the effect of ensuring data security in the instruction transmission process is achieved by setting a special instruction generation method and instruction parsing method.
[0095] Optionally, the effective instruction information determination module includes: a character bit number determination unit, used to determine the instruction reading position in the target instruction, and the character bit number of the character to be read from the instruction reading position;
[0096] The effective instruction information determining unit is used to determine the target number of character bits corresponding to the effective instruction information in the target instruction based on the number of character bits, and read the instruction characters consistent with the target number of character bits from the instruction reading position to obtain the effective instruction information in the target instruction.
[0097] Optionally, the instruction information determination module includes: an encoding mode determination unit, configured to determine a reverse encoding mode corresponding to the valid instruction information according to the encoding mode corresponding to the instruction to be used;
[0098] The instruction information determination unit is used to reverse encode the effective instruction information based on the reverse encoding method to obtain the instruction information to be corrected.
[0099] Optionally, the device control module is used to convert the information of the instruction to be corrected based on a preset second conversion method to obtain a target control instruction; wherein the second conversion method is opposite to the first conversion method corresponding to the instruction to be used.
[0100] Optionally, if the first communication device is a conference host, the second communication device is a target microphone connected to the conference host; if the first communication device is a target microphone, the second device is a conference host connected to the target microphone.
[0101] The instruction parsing device provided in the embodiment of the present invention can execute the parsing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0102] 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 method for generating an instruction, characterized in that: include: When it is detected that the target function control is triggered, determining the instruction to be used corresponding to the target function control; wherein the target function control is deployed in the display interface of the first communication device; Encoding the instruction to be used to obtain an instruction to be processed, and determining target instruction filling information corresponding to the instruction to be processed; Adding the target instruction padding information to the front end of the instruction to be processed to obtain the target instruction, and sending the target instruction to a second communication device connected to the first communication device; The step of determining target instruction fill information corresponding to the instruction to be processed includes: Determine the number of to-be-filled digits corresponding to the instruction to be processed according to the number of characters contained in the instruction to be processed; Based on the number of bits to be filled and the preset instruction filling information, the target instruction filling information corresponding to the instruction to be processed is obtained; The step of encoding the instruction to be used to obtain the instruction to be processed includes: Performing instruction conversion on the instruction to be used based on a preset first conversion method to obtain an instruction to be converted; wherein the first conversion method is an arithmetic operation method; The instruction to be converted is encoded in binary format to obtain the instruction to be processed.
2. A command parsing method, characterized in that: include: Receive a target instruction, and parse to obtain valid instruction information in the target instruction; wherein the valid instruction information is consistent with the instruction information contained in the instruction to be processed; the target instruction includes target instruction padding information and the instruction to be processed, and the target instruction padding information is located at the front end of the instruction to be processed; the instruction to be processed refers to an instruction obtained after data encoding the data carried in the instruction to be used, and the instruction to be used refers to a functional instruction corresponding to the target function control; Reversely encoding the valid instruction information to obtain instruction information to be corrected; Performing instruction correction on the instruction information to be corrected to obtain a target control instruction, and controlling the second communication device to execute a corresponding device function based on the target control instruction; The parsing to obtain valid instruction information in the target instruction includes: Determine an instruction reading position in the target instruction and the number of character bits of the character to be read starting from the instruction reading position; Determine the target number of character bits corresponding to the valid instruction information in the target instruction based on the number of character bits, and read the instruction character consistent with the target number of character bits from the instruction reading position to obtain the valid instruction information in the target instruction; The step of performing instruction correction on the instruction information to be corrected to obtain a target control instruction includes: The information of the instruction to be modified is converted based on a preset second conversion method to obtain the target control instruction; wherein the second conversion method is opposite to the first conversion method corresponding to the instruction to be used; and the first conversion method is an arithmetic operation method; The step of determining the instruction reading position in the target instruction and the number of character bits of the character to be read from the instruction reading position, determining the target number of character bits corresponding to the valid instruction information in the target instruction based on the number of character bits, and reading the instruction characters consistent with the target number of character bits from the instruction reading position to obtain the valid instruction information in the target instruction includes: The target instruction is detected based on the preset instruction padding information until the position of the non-preset instruction padding information is detected, and the position between the last bit of the preset instruction padding information and the first bit of the non-preset instruction padding information is used as the instruction reading position of the target instruction; According to the number of data bits of the preset instruction padding information in the target instruction, the number of character bits of the character to be read in the target instruction is determined, and the number of bits corresponding to the number of character bits is read backward from the first non-target padding information to obtain the valid instruction information in the target instruction.
3. The method according to claim 2, characterized in that The reverse encoding of the valid instruction information to obtain the instruction information to be corrected includes: Determine, according to the encoding method corresponding to the instruction to be used, a reverse encoding method corresponding to the valid instruction information; The effective instruction information is reversely encoded based on the reverse encoding method to obtain the instruction information to be corrected.
4. The method according to claim 1 or 2, characterized in that: include: If the first communication device is a conference host, the second communication device is a target microphone connected to the conference host; If the first communication device is the target microphone, the second communication device is a conference host connected to the target microphone.
5. An instruction generating device, characterized in that: include: A to-be-used instruction determination module, configured to determine, when detecting that a target function control is triggered, an instruction to be used corresponding to the target function control; wherein the target function control is deployed in a display interface of a first communication device; An instruction padding information determination module, used for encoding the instruction to be used to obtain an instruction to be processed, and determining target instruction padding information corresponding to the instruction to be processed; An instruction sending module, used for adding the target instruction padding information to the front end of the instruction to be processed to obtain the target instruction, and sending the target instruction to a second communication device connected to the first communication device; Wherein, the instruction padding information determination module includes: A digit determination unit, used to determine the number of to-be-filled digits corresponding to the instruction to be processed according to the number of characters contained in the instruction to be processed; An instruction filling information determining unit, configured to obtain target instruction filling information corresponding to the instruction to be processed based on the number of bits to be filled and preset instruction filling information; Wherein, the instruction padding information determination module further includes: The instruction to be converted determining unit is used to convert the instruction to be used based on a preset first conversion method to obtain the instruction to be converted; wherein the first conversion method is an arithmetic operation method; The to-be-processed instruction determining unit is used to perform base encoding on the to-be-converted instruction to obtain the to-be-processed instruction.
6. A command parsing device, characterized in that: include: An effective instruction information determination module is used to receive a target instruction and parse the effective instruction information in the target instruction; wherein the effective instruction information is consistent with the instruction information contained in the instruction to be processed; the target instruction includes target instruction padding information and the instruction to be processed, and the target instruction padding information is located at the front end of the instruction to be processed; the instruction to be processed refers to an instruction obtained after data encoding is performed on the data carried in the instruction to be used, and the instruction to be used refers to a functional instruction corresponding to the target function control; An instruction information determination module, used for reverse encoding the valid instruction information to obtain the instruction information to be corrected; A device control module, configured to perform instruction correction on the instruction information to be corrected to obtain a target control instruction, and control the second communication device to execute a corresponding device function based on the target control instruction; Wherein, the effective instruction information determination module includes: A character bit number determination unit, used to determine an instruction reading position in the target instruction, and a character bit number of a character to be read starting from the instruction reading position; an effective instruction information determining unit, configured to determine a target number of character bits corresponding to the effective instruction information in the target instruction based on the number of character bits, and read instruction characters consistent with the target number of character bits from the instruction reading position to obtain the effective instruction information in the target instruction; The device control module is used to convert the instruction information to be modified based on a preset second conversion method to obtain the target control instruction; wherein the second conversion method is opposite to the first conversion method corresponding to the instruction to be used; and the first conversion method is an arithmetic operation method; The character bit determination unit is specifically used to detect the target instruction based on the preset instruction padding information until the position of the non-preset instruction padding information is detected, and the position between the last preset instruction padding information and the first non-preset instruction padding information is used as the instruction reading position of the target instruction; according to the data bit number of the preset instruction padding information in the target instruction, the character bit number of the character to be read in the target instruction is determined; The effective instruction information determining unit is specifically used to read the number of bits corresponding to the number of character bits backward from the first non-target supplementary information to obtain the effective instruction information in the target instruction.
Citation Information
Patent Citations
Unmanned aerial vehicle communication method, device, equipment and storage medium
CN113949438A