Communication command processing method, circuit, chip and electronic equipment
By comparing the to-process commands with historical commands in the integrated circuit and generating different calculation results, the security risk problem of the integrated circuit authentication process is solved, and higher security and difficulty in imitation are achieved.
Patent Information
- Application Number
- CN202510597379.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-09
- Publication Date
- 2025-08-19
AI Technical Summary
In the prior art, the authentication process of integrated circuits has a high security risk, which is easily attacked and deciphered, resulting in low security.
By obtaining the pending commands and the stored historical commands for comparison, different preset algorithms are used to generate calculation results based on the comparison results, and the historical calculation results are updated, and feedback to the target terminal device to achieve diversified processing of the same commands.
It increases the difficulty of imitation of integrated circuits, improves the security of the authentication process, and reduces security risks.
Smart Images

Figure CN120509024A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of integrated circuit technology, and in particular to communication command processing methods, circuits, chips, and electronic devices. Background Art
[0002] With the rapid development of electronic technology, integrated circuits (ICs) have become widely used in various applications, including industry, communications, automotive, the Internet of Things, and artificial intelligence. The security of integrated circuits has become increasingly important to protect the product ecosystem and user privacy. For example, in specific scenarios such as consumer electronic accessories and printer toner cartridges, the host terminal device often requires communication authentication for its slave accessories or third-party devices. Only authenticated accessories or third-party devices can function normally.
[0003] The authentication method used in related technologies involves a master sending a communication command to a slave. The slave receives the command, processes it, and returns the result. The master then determines whether authentication is successful based on the result. However, this method, in which the slave outputs a single result for each command, presents a high security risk and is susceptible to attacks and counterfeiting, requiring improvement. Summary of the Invention
[0004] The embodiments of the present application provide a communication command processing method, circuit, chip and electronic device, which solve the problem that related technologies have high security risks, are easy to be attacked and deciphered and imitated, and need to be improved. It realizes the feedback of different processing results generated based on the command to be processed itself or historical calculation results for the same communication command, improves the flexibility of authentication calculation, and thereby increases the difficulty of chip imitation, improves the security of the authentication process, and reduces security risks.
[0005] In a first aspect, an embodiment of the present application provides a communication command processing method, comprising:
[0006] Obtaining a command to be processed, comparing the command to be processed with at least one stored historical command to obtain a comparison result, and updating the at least one stored historical command based on the command to be processed;
[0007] If the comparison result shows that the at least one historical command is the same as the command to be processed, generating a first calculation result based on a first preset algorithm and a stored historical calculation result corresponding to the command to be processed, updating the stored historical calculation result based on the first calculation result, and feeding back the first calculation result to the target terminal device;
[0008] When the comparison result shows that the historical command is different from the command to be processed, a second calculation result is generated based on a second preset algorithm and the command to be processed, the stored historical calculation result is updated based on the second calculation result, and the second calculation result is fed back to the target terminal device.
[0009] In a second aspect, an embodiment of the present application further provides a communication command processing circuit, comprising:
[0010] a command comparison module, configured to receive a command to be processed, and to output to the state control module a comparison result obtained by comparing the command to be processed with at least one stored historical command;
[0011] The state control module is configured to output a first control signal to the first calculation module if the comparison result shows that the at least one historical command is the same as the command to be processed, and to output a second control signal to the second calculation module if the comparison result shows that the historical command is different from the command to be processed, so as to control the command comparison module to update the at least one stored historical command based on the command to be processed, and to output a result selection signal to the selector according to the comparison result;
[0012] the first calculation module being configured to output, to the selector module, upon receiving the first control signal, a first calculation result generated based on a first preset algorithm and stored historical calculation results corresponding to the command to be processed;
[0013] the second calculation module is configured to receive the command to be processed, and to output a second calculation result generated based on a second preset algorithm and the command to be processed to the selector module and the first calculation module when the second control signal is received;
[0014] The state control module is further configured to control the first calculation module to update the stored historical calculation result based on the first calculation result or the second calculation result;
[0015] The selector module is configured to output a target calculation result determined from the first calculation result and the second calculation result according to the result selection signal to a target terminal device.
[0016] In a third aspect, an embodiment of the present application further provides a chip comprising a communication command processing circuit as described in any embodiment of the present application.
[0017] In a fourth aspect, an embodiment of the present application further provides an electronic device comprising the chip described in any embodiment of the present application.
[0018] As described above, the embodiments of the present application provide a communication command processing method, circuit, chip, and electronic device. The communication command processing method obtains a command to be processed, compares the command to be processed with at least one stored historical command to obtain a comparison result, and updates the stored at least one historical command based on the command to be processed; if the comparison result shows that there is a historical command identical to the command to be processed in at least one historical command, a first calculation result is generated based on a first preset algorithm and the stored historical calculation result corresponding to the command to be processed, the stored historical calculation result is updated based on the first calculation result, and the first calculation result is fed back to the target terminal device; if the comparison result shows that the historical command is different from the command to be processed, a second calculation result is generated based on a second preset algorithm and the command to be processed, the stored historical calculation result is updated based on the second calculation result, and the second calculation result is fed back to the target terminal device. The communication command processing circuit that implements the communication command processing method is provided with a command comparison module, a state control module, a first calculation module, a second calculation module, and a selector module. This solution realizes the feedback of different processing results generated based on the command to be processed itself or the historical calculation result for the same communication command, thereby improving the flexibility of the authentication calculation, thereby increasing the difficulty of the chip being imitated, improving the security of the authentication process, and reducing security risks. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 A flowchart of a communication command processing method provided in an embodiment of the present application;
[0020] Figure 2 A schematic diagram of the structure of a communication command processing circuit provided in an embodiment of the present application;
[0021] Figure 3 A schematic structural diagram of another communication command processing circuit provided in an embodiment of the present application;
[0022] Figure 4 A schematic structural diagram of another communication command processing circuit provided in an embodiment of the present application;
[0023] Figure 5 A schematic structural diagram of another communication command processing circuit provided in an embodiment of the present application;
[0024] Figure 6 A schematic diagram of the structure of another communication command processing circuit provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The following is a further detailed description of the embodiments of the present application in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the embodiments of the present application, and are not intended to limit the embodiments of the present application. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions of the embodiments of the present application, rather than all structures.
[0026] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, not to describe a specific order or precedence. It should be understood that such terms are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein. The terms "first," "second," and the like generally distinguish objects of a class and do not limit the number of objects. For example, the first object can be one or more, and should not be construed as indicating or implying relative importance. Furthermore, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates an "or" relationship between the connected objects. Furthermore, unless otherwise expressly specified or limited, the terms "disposed," "mounted," "connected," "connected," and "in series" should be interpreted broadly, meaning, for example, fixed, removable, or integral; mechanically or electrically; directly or indirectly through an intermediary; or internally between two components. Those skilled in the art will understand the specific meanings of these terms in this application on a case-by-case basis.
[0027] In the related art, the host can be a terminal device, and the slave can be an accessory chip or a third-party device. The host and the slave can be mutually authenticated or one-way authenticated. The two exchange data through a wired or wireless communication protocol, and can determine whether the other party is trustworthy. Taking the authentication of printers and consumable chips as an example, communication protocols such as IIC (Inter-Integrated Circuit) and SPI (Serial Peripheral Interface) can be used. The specific host-to-slave authentication process is as follows: the host sends a command to the slave, which can include a command header representing the authentication function and input data for the authentication algorithm calculation; after the slave receives the command, it can identify the command header as an authentication command, transmit the received input data to the algorithm circuit, obtain the algorithm result, and feed the algorithm result back to the host; the host compares the received algorithm result with the expected value, and if the two are consistent, the authentication is successful. However, the inventor found that for the same authentication command provided by the host, the slave needs to spend the same time to obtain the same algorithm result, the algorithm result is single, easy to imitate or even copied, and has low security. Based on this, the embodiments of the present application provide a communication command processing method, circuit, chip and electronic device, aiming to solve the problem that related technologies have high security risks, are easily attacked and deciphered and imitated, and need to be improved.
[0028] Figure 1 This is a flow chart of a communication command processing method provided in an embodiment of the present application. Figure 1 As shown, the communication command processing method can be applied to the slave in the authentication process, and specifically includes the following steps:
[0029] Step S101: Acquire a command to be processed, compare the command to be processed with at least one stored historical command to obtain a comparison result, and update the at least one stored historical command based on the command to be processed.
[0030] The pending command may be an authentication command sent by the master to the slave, and may specifically include a command header and input data for calculation by a preset algorithm. By comparing the pending command with at least one stored historical command, it can be determined whether the pending command has been processed. Furthermore, the stored historical commands can be updated based on the pending command to maintain the timeliness of the historical commands.
[0031] Step S102: When the comparison result shows that there is a historical command identical to the command to be processed in at least one historical command, a first calculation result is generated based on a first preset algorithm and the stored historical calculation results corresponding to the command to be processed, the stored historical calculation results are updated based on the first calculation result, and the first calculation result is fed back to the target terminal device.
[0032] Among them, if the comparison result is that there is a historical command that is the same as the command to be processed in at least one historical command, it can be regarded as that the command to be processed has been processed and the corresponding historical calculation result is obtained. In order to output different calculation results for the same command, a first calculation result can be generated based on a first preset algorithm and the historical calculation result corresponding to the command to be processed. The first calculation result can be regarded as obtained by iteratively processing the command to be processed. In addition, the first calculation result is updated with the historical calculation result, which can be used as input data for the next iterative calculation. The first preset algorithm can be AES (Advanced Encryption Standard), RSA algorithm, etc., which is not limited in this application.
[0033] Step S103: When the comparison result shows that the historical command is different from the command to be processed, a second calculation result is generated based on the second preset algorithm and the command to be processed, the stored historical calculation result is updated based on the second calculation result, and the second calculation result is fed back to the target terminal device.
[0034] Among them, if the comparison result is that the historical command is different from the pending command, it can be regarded as that the pending command has not been processed, and the second calculation result can be directly generated based on the second preset algorithm and the pending command. The second preset algorithm can be AES (Advanced Encryption Standard), RSA algorithm, etc., which is not limited in this application. It should be noted that if the host sends command A for the first time, the slave can process command A based on the second preset algorithm to obtain calculation result B, and feedback calculation result B to the host. At this time, the host can authenticate based on the calculation result B, and generate a reference result C based on the first preset algorithm and calculation result B; if the host sends command A for the second time, when the slave determines that the same command A is received, it can process the stored calculation result B based on the first preset algorithm to obtain calculation result C, store calculation result C, and feedback calculation result C to the host. At this time, the host can determine that the reference result C is consistent with the calculation result C, thereby completing the authentication; if the host sends command A for the third time, when the slave determines that the same command A is received, it can continue to process the stored calculation result C based on the first preset algorithm, and so on.
[0035] As described above, by feeding back different processing results based on the command to be processed or historical calculation results for the same communication command, the flexibility of the authentication calculation can be improved, thereby increasing the difficulty of chip imitation, improving the security of the authentication process, and reducing security risks.
[0036] The communication command processing method in the embodiment of the present application is applied to the communication command processing circuit. The entire scheme has been described in detail in the relevant embodiments of the communication command processing circuit. For any incomplete description in the communication command processing method, reference can be made to the embodiments of the communication command processing circuit. The communication command processing method has the same technical effect.
[0037] Figure 2 This is a schematic diagram of the structure of a communication command processing circuit provided in an embodiment of the present application. The communication command processing circuit can be used to implement the communication command processing method provided in the above embodiment. Figure 2 As shown, the communication command processing circuit includes a command comparison module 101 , a state control module 102 , a first calculation module 103 , a second calculation module 104 and a selector module 105 .
[0038] The first end of the command comparison module 101 is used to receive the command to be processed, and the second end of the command comparison module 101 is connected to the first end of the state control module 102, and is used to output the comparison result obtained by comparing the command to be processed with at least one stored historical command to the state control module 102.
[0039] In one embodiment, Figure 3 A schematic diagram of another communication command processing circuit provided in an embodiment of the present application, wherein Figure 2 On the basis of Figure 3 As shown, the command comparison module 101 includes an input data memory module 1011 and a comparator module 1012. The input data memory module 1011 can be used to store at least one historical command. The first end of the input data memory module 1011 and the first end of the comparator module 1012 can serve as the first end of the command comparison module 101, for receiving a command to be processed. The second end of the input data memory module 1011 is connected to the second end of the comparator module 1012, for providing at least one historical command to the comparator module 1012. The third end of the comparator module 1012 serves as the second end of the command comparison module 101, for outputting a comparison result obtained by comparing the command to be processed with the at least one historical command to the state control module 102. The third end of the input data memory module 1011 serves as the third end of the command comparison module 101.
[0040] The second end of the state control module 102 is connected to the first end of the first calculation module 103, and is used to output a first control signal to the first calculation module 103 when the comparison result is that there is a historical command that is the same as the command to be processed in at least one historical command; the third end of the state control module 102 is connected to the first end of the second calculation module 104, and is used to output a second control signal to the second calculation module 104 when the comparison result is that the historical command is different from the command to be processed; the fourth end of the state control module 102 is connected to the third end of the command comparison module 101, and is used to control the command comparison module 101 to update at least one stored historical command based on the command to be processed; the fifth end of the state control module 102 is connected to the first end of the selector module 105, and is used to output a result selection signal to the selector module 105 according to the comparison result.
[0041] In one embodiment, Figure 3 As shown, the state control module 102 includes a state register module 1021, a decoding circuit 1022, an output memory control circuit 1023 and an input memory control circuit 1024. Among them, the first end of the state register module 1021 serves as the first end of the state control module 102, and is used to receive the comparison result obtained by comparing the command to be processed with at least one stored historical command output by the command comparison module 101; the second end of the state register module 1021 is connected to the first end of the decoding circuit 1022, and is used to output a state code corresponding to the comparison result to the decoding circuit 1022; the second end of the decoding circuit 1022 serves as the second end of the state control module 102, and is used to output a first control signal to the first calculation module 103 when the state code indicates that there is a historical command that is the same as the command to be processed in at least one historical command; the third end of the decoding circuit 1022 serves as the third end of the state control module 102, and is used to output a second control signal to the second calculation module 104 when the state code indicates that the historical command is different from the command to be processed; the fourth end of the decoding circuit 1022 serves as The fifth end of the state control module 102 is used to output a result selection signal to the selector module 105 according to the state code; the fifth end of the decoding circuit 1022 is connected to the first end of the input memory control circuit 1024, and is used to output a first update signal to the input memory control circuit 1024; the second end of the input memory control circuit 1024 serves as the fourth end of the state control module 102, and is used to control the command comparison module 101 to update at least one stored historical command based on the command to be processed according to the first update signal; the sixth end of the decoding circuit 1022 is connected to the first end of the output memory control circuit 1023, and is used to output a second update signal to the output memory control circuit 1023; the second end of the output memory control circuit 1023 serves as the sixth end of the state control module 102, and is used to control the first calculation module 103 to update the stored historical calculation result based on the first calculation result or the second calculation result according to the second update signal.
[0042] The second end of the first calculation module 103 is connected to the second end of the selector module 105, and is used to output a first calculation result generated based on the first preset algorithm and the stored historical calculation results corresponding to the command to be processed to the selector module 105 when receiving the first control signal.
[0043] Optionally, if some authentication commands during the authentication process require a short feedback time and the communication command processing circuit needs to promptly feedback the calculation results, then the first calculation module 103 can be configured accordingly: when receiving the first control signal, output the stored historical calculation results corresponding to the command to be processed to the selector module 105, so as to achieve the purpose of quickly feeding back the result data, which is suitable for scenarios with higher authentication efficiency requirements.
[0044] In one embodiment, Figure 3 As shown, the first calculation module 103 includes an output data memory module 1031 and an iterative calculation module 1032. The first terminal of the iterative calculation module 1032 serves as the first terminal of the first calculation module 103 and is configured to receive the first control signal output by the state control module 102. The second terminal of the iterative calculation module 1032 serves as the second terminal of the first calculation module 103 and is configured to output, to the selector module 105, a first calculation result generated based on the first preset algorithm and the historical calculation results corresponding to the command to be processed, upon receiving the first control signal. The output data memory module 1031 is configured to store at least one historical calculation result. The first terminal of the output data memory module 1031 is connected to the third terminal of the iterative calculation module 1032 and is configured to provide the iterative calculation module 1032 with the historical calculation result corresponding to the command to be processed, or to receive the first calculation result generated by the iterative calculation module 1032. The second terminal of the output data memory module 1031 serves as the third terminal of the first calculation module 103 and is configured to receive the second calculation result output by the second calculation module 104. The third terminal of the output data memory module 1031 serves as the fourth terminal of the first calculation module 103.
[0045] The second end of the second computing module 104 is used to receive the command to be processed, and the third end of the second computing module 104 is connected to the third end of the selector module 105 and the third end of the first computing module 103, and is used to output the second calculation result generated based on the second preset algorithm and the command to be processed to the selector module 105 and the first computing module 103 when a second control signal is received.
[0046] The sixth terminal of the state control module 102 is connected to the fourth terminal of the first calculation module 103 and is used to control the first calculation module 103 to update the stored historical calculation result based on the first calculation result or the second calculation result.
[0047] The fourth terminal of the selector module 105 is used to output a target calculation result determined from the first calculation result and the second calculation result according to the result selection signal to the target terminal device.
[0048] As described above, by setting different calculation modules and selecting specific calculation modules based on the command comparison results, different processing results generated based on the command to be processed itself or historical calculation results can be fed back for the same communication command, thereby improving the flexibility of authentication calculation, thereby increasing the difficulty of chip imitation, improving the security of the authentication process, and reducing security risks.
[0049] In one embodiment, Figure 4 A schematic diagram of another communication command processing circuit provided in an embodiment of the present application, wherein Figure 2 On the basis of Figure 4 As shown, the communication command processing circuit further includes a first register group 106. A first end of the first register group 106 is used to receive and store commands to be processed; a second end of the first register group 106 is connected to a first end of the command comparison module 101, for outputting the commands to be processed to the command comparison module 101; and a third end of the first register group 106 is connected to a second end of the second calculation module 104, for outputting the commands to be processed to the second calculation module 104.
[0050] In one embodiment, Figure 4 As shown, the communication command processing circuit further includes a second register group 107. A first end of the second register group 107 is connected to the third end of the second calculation module 104, for receiving and storing the second calculation result; a second end of the second register group 107 is connected to the third end of the selector module 105, for outputting the second calculation result to the selector module 105; and a third end of the second register group 107 is connected to the third end of the first calculation module 103, for outputting the second calculation result to the first calculation module 103.
[0051] In one embodiment, Figure 5 A structural diagram of another communication command processing circuit provided in an embodiment of the present application is shown as follows: Figure 5 As shown, the communication command processing circuit further includes a data decryption module 108. A first end of the data decryption module 108 is used to receive a command to be processed; a second end of the data decryption module 108 is connected to a first end of the command comparison module 101, and is used to output a decryption calculation result obtained by decrypting the command to be processed based on a preset decryption algorithm to the command comparison module 101; a third end of the data decryption module 108 is connected to a second end of the second calculation module 104, and is used to output a decryption calculation result obtained by decrypting the command to be processed based on the preset decryption algorithm to the second calculation module 104.
[0052] In one embodiment, Figure 5As shown, the communication command processing circuit also includes a data encryption module 109, the first end of the data encryption module 109 is connected to the fourth end of the selector module 105, and is used to receive the target calculation result; the second end of the data encryption module 109 is used to output the encrypted calculation result obtained by encrypting the target calculation result based on a preset encryption algorithm to the target terminal device.
[0053] In one embodiment, Figure 6 A schematic diagram of another communication command processing circuit provided in an embodiment of the present application, wherein Figure 3 On the basis of Figure 6 As shown, a register set IN1 is provided for storing commands to be processed. The input data memory module 1011 includes register sets IN2, IN3, and IN3. The comparator module 1012 includes comparators C1, C2, and C3, which are respectively provided for register sets IN2, IN3, and IN3. Specifically, a register set OUT1 is further provided for storing the calculation results output by the second calculation module 104. The output data memory module 1031 includes register sets OUT2, OUT3, and OUT4.
[0054] Register group IN2 is used to store the most recent historical commands, register group IN3 is used to store relatively recent historical commands, and register group IN4 is used to store the most distant historical commands. Register group OUT2 is used to store historical calculation results corresponding to historical commands stored in register group IN2, register group OUT3 is used to store historical calculation results corresponding to historical commands stored in register group IN3, and register group OUT4 is used to store historical calculation results corresponding to historical commands stored in register group IN4.
[0055] In a specific implementation, comparator C1 can output a result S0 by comparing the historical commands provided by register set IN2 with the pending commands provided by register set IN1. If the two are identical, S0 is a logic 1; if they are different, S0 is a logic 0. Comparator C2 can output a result S1 by comparing the historical commands provided by register set IN3 with the pending commands provided by register set IN1. If the two are identical, S1 is a logic 1; if they are different, S1 is a logic 0. Comparator C3 can output a result S2 by comparing the historical commands provided by register set IN4 with the pending commands provided by register set IN1. If the two are identical, S2 is a logic 1; if they are different, S2 is a logic 0. The status register module 1021 is used to store the values of S0, S1, and S2 and generate a status code. Possible results are 000, 100, 010, and 001. If the result is 000, it indicates that the pending command and the stored historical command are different. If the result is 100, it indicates that the pending command and the historical command stored in register group IN2 are the same. If the result is 010, it indicates that the pending command and the historical command stored in register group IN3 are the same. If the result is 001, it indicates that the pending command and the historical command stored in register group IN4 are the same. If the status code is 000, the decoding circuit 1022 outputs a first control signal to the second calculation module 104, so that the second calculation module 104 can generate a second calculation result based on the second preset algorithm and the pending command. If the status code is 100, 010, or 001, the decoding circuit 1022 outputs a second control signal to the iterative calculation module 1032, so that the iterative calculation module 1032 can generate a first calculation result based on the first preset algorithm and the stored historical calculation results corresponding to the pending command.
[0056] Specifically, the input memory control circuit 1024 can be used to control the data update of register set IN2, register set IN3, and register set IN4. Register set IN2 is used to store the most recent historical commands. For example, if the pending command is A1, and the historical commands stored in register sets IN2, IN3, and IN4 are B1, C1, and D1, respectively, then the corresponding status code is 000. Since the pending command and the historical commands are different, the input memory control circuit 1024 can update the historical commands stored in register sets IN2, IN3, and IN4 to A1, B1, and C1, respectively. For another example, the pending command is B1, and the historical commands stored in register group IN2, register group IN3, and register group IN4 are A1, B1, and C1 respectively. Then the corresponding status code is 010. Since the pending command B1 and the historical command B1 stored in register group IN3 are the same, the historical command C1 stored in register group IN4 can be kept unchanged, and B1 stored in register group IN3 can be replaced with A1, and A1 stored in register group IN2 can be replaced with B1, that is, the historical commands stored in register group IN2, register group IN3, and register group IN4 are B1, A1, and C1 respectively.
[0057] Furthermore, the output memory control circuit 1023 can be used to control data updates in register sets OUT2, OUT3, and OUT4. After data updates occur in register sets IN2, IN3, and IN4, the output memory control circuit 1023 can control the historical calculation results stored in register set OUT2 to match the historical commands stored in register set IN2, the historical calculation results stored in register set OUT3 to match the historical commands stored in register set IN3, and the historical calculation results stored in register set OUT4 to match the historical commands stored in register set IN4.
[0058] Furthermore, if the same command is received multiple times, the calculation result corresponding to the command will be continuously iterated based on the historical calculation results. For example, if the historical commands stored in register sets IN2, IN3, and IN4 are A1, B1, and C1, respectively, and the historical calculation results stored in register sets OUT2, OUT3, and OUT4 are A2, B2, and C2, respectively, when the pending command is B1, the corresponding status code is 010. The iterative calculation module 1032 will calculate B3 based on the historical calculation result B2 stored in register set OUT3. Correspondingly, the output memory control circuit 1023 can update the historical calculation result stored in register set OUT2 to B3. In addition, the output memory control circuit 1023 will update the historical commands stored in register sets IN2, IN3, and IN4 to B1, A1, and C1, respectively. Correspondingly, the output memory control circuit 1023 will update the historical calculation results stored in register sets OUT2, OUT3, and OUT4 to B3, A2, and C2, respectively. By analogy, if register group IN1 receives the pending command B1 again, then after completing the iterative calculation to obtain B4, the historical commands stored in register group IN2, register group IN3, and register group IN4 are B1, A1, and C1, respectively, and the historical calculation results stored in register group OUT2, register group OUT3, and register group OUT4 are B4, A2, and C2, respectively.
[0059] Of course, the above description is merely an example. The number of specific register groups and comparators can be adaptively set according to the storage requirements of the actual application scenario, and this application does not limit this.
[0060] An embodiment of the present application also provides a chip, including the communication command processing circuit provided in the aforementioned embodiment, which has corresponding functions and beneficial effects as the communication command processing circuit.
[0061] An embodiment of the present application also provides an electronic device, comprising the chip provided in the aforementioned embodiment.
[0062] It should be noted that the sequence numbers of the steps in this solution are used only to describe the overall design framework of this solution and do not necessarily indicate a sequential order between the steps. As long as the overall implementation process conforms to the overall design framework of this solution, it falls within the scope of protection of this solution. The order of description in the text does not constitute an exclusive limitation on the specific implementation process of this solution.
[0063] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0064] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will appreciate that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments, and substitutions are possible for those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the scope of the present invention. The scope of the present invention is determined by the scope of the appended claims.
Claims
1. A communication command processing method, characterized in that: The method comprises: Obtaining a command to be processed, comparing the command to be processed with at least one stored historical command to obtain a comparison result, and updating the at least one stored historical command based on the command to be processed; If the comparison result shows that the at least one historical command is the same as the command to be processed, generating a first calculation result based on a first preset algorithm and a stored historical calculation result corresponding to the command to be processed, updating the stored historical calculation result based on the first calculation result, and feeding back the first calculation result to the target terminal device; When the comparison result shows that the historical command is different from the command to be processed, a second calculation result is generated based on a second preset algorithm and the command to be processed, the stored historical calculation result is updated based on the second calculation result, and the second calculation result is fed back to the target terminal device.
2. A communication command processing circuit, characterized in that: include: a command comparison module, configured to receive a command to be processed, and to output to the state control module a comparison result obtained by comparing the command to be processed with at least one stored historical command; The state control module is configured to output a first control signal to the first calculation module if the comparison result shows that the at least one historical command is the same as the command to be processed, output a second control signal to the second calculation module if the comparison result shows that the historical command is different from the command to be processed, and control the command comparison module to update the at least one stored historical command based on the command to be processed, and output a result selection signal to the selector module according to the comparison result; the first calculation module being configured to output, to the selector module, upon receiving the first control signal, a first calculation result generated based on a first preset algorithm and stored historical calculation results corresponding to the command to be processed; the second calculation module is configured to receive the command to be processed, and to output a second calculation result generated based on a second preset algorithm and the command to be processed to the selector module and the first calculation module when the second control signal is received; The state control module is further configured to control the first calculation module to update the stored historical calculation result based on the first calculation result or the second calculation result; The selector module is configured to output a target calculation result determined from the first calculation result and the second calculation result according to the result selection signal to a target terminal device.
3. The communication command processing circuit according to claim 2, characterized in that: The state control module includes a state register module, a decoding circuit, an output memory control circuit and an input memory control circuit; The state register module is used to output a state code corresponding to the comparison result to the decoding circuit; The decoding circuit is configured to output a first control signal to the first calculation module if the status code indicates that there is a historical command identical to the command to be processed in the at least one historical command, output a first update signal to the input memory control circuit, output a second control signal to the second calculation module if the status code indicates that the historical command is different from the command to be processed, output a second update signal to the output memory control circuit, and output a result selection signal to the selector module based on the status code; The input memory control circuit is configured to control the command comparison module to update the at least one stored historical command based on the command to be processed according to the first update signal; The output memory control circuit is used to control the first calculation module to update the stored historical calculation result based on the first calculation result or the second calculation result according to the second update signal.
4. The communication command processing circuit according to claim 2, characterized in that: The command comparison module includes an input data memory module and a comparator module; The input data memory module is configured to receive a command to be processed, to store at least one historical command, and to provide the at least one historical command to the comparator module; The comparator module is configured to output a comparison result obtained by comparing the command to be processed with the at least one historical command to the state control module.
5. The communication command processing circuit according to claim 2, characterized in that: The first calculation module includes an output data memory module and an iterative calculation module; The output data memory module is configured to receive the second calculation result output by the second calculation module, to store at least one historical calculation result, and to provide the iterative calculation module with the historical calculation result corresponding to the command to be processed; The iterative calculation module is configured to output a first calculation result generated based on a first preset algorithm and a historical calculation result corresponding to the command to be processed to the selector module when the first control signal is received.
6. The communication command processing circuit according to claim 2, characterized in that: The communication command processing circuit further includes a first register group; The first register group is used to receive and store the command to be processed, and to output the command to be processed to the command comparison module and the second calculation module.
7. The communication command processing circuit according to claim 2, characterized in that: The communication command processing circuit further includes a second register group; The second register group is used to receive and store the second calculation result, and output the second calculation result to the first calculation module and the selector module.
8. The communication command processing circuit according to claim 2, characterized in that: The communication command processing circuit also includes a data decryption module; The data decryption module is used to receive the command to be processed, and to output a decryption calculation result obtained by decrypting the command to be processed based on a preset decryption algorithm to the command comparison module and the second calculation module.
9. The communication command processing circuit according to claim 2, characterized in that: The communication command processing circuit also includes a data encryption module; The data encryption module is used to receive the target calculation result and output to the target terminal device an encrypted calculation result obtained by encrypting the target calculation result based on a preset encryption algorithm.
10. A chip, characterized in that: The method comprises the communication command processing circuit according to any one of claims 2 to 9.
11. An electronic device, characterized in that: Comprising the chip as claimed in claim 10.