Communication module encryption method and device, equipment, storage medium and product

By loading encryption firmware in external memory in the communication module for data encryption, the problem of limited storage space is solved, the expansion and upgrading of secure encryption functions is achieved, and the cost is reduced, and suitable for portable and mobile products.

CN119203182APending Publication Date: 2024-12-27LINKZHILIAN (CHONGQING) TECH CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411249907.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

In the prior art, the memory of the communication module is small and it is difficult to integrate the secure SDK therein, resulting in high cost of implementing the secure encryption function and not suitable for modules with limited storage space.

Method used

By loading the encrypted firmware in the external memory into the running memory in the communication module, encrypting the encrypted data using the encrypted firmware, the secure encryption function is expanded, and functions are upgraded and managed by upgrading the firmware package.

Benefits of technology

It reduces the demand for secure encryption functions in the internal storage space of the communication module, reduces hardware costs, and improves the scalability and flexibility of secure encryption functions. It is suitable for portable and mobile products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119203182A_ABST
    Figure CN119203182A_ABST
Patent Text Reader

Abstract

The invention discloses an encryption method and device of a communication module, equipment, a storage medium and a product. The method comprises the following steps: confirming to-be-encrypted data; copying the encrypted firmware in the external memory to a running memory of the communication module; wherein the encrypted firmware comprises a program written according to an encryption algorithm; and encrypting the data to be encrypted by using the encryption firmware. According to the application, the external memory is added on the communication module to expand the security encryption function, so that the communication module is low in cost, high in expandability and applicable to the communication module with a relatively small internal storage space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data protection technology, and in particular to an encryption method, device, equipment, storage medium and product of a communication module. Background Art

[0002] With the rapid development of terminal communication technology and Internet of Things technology, especially the current huge demand for device connection, new requirements have been put forward for the communication security of terminal devices and servers. In the prior art, terminal devices usually integrate a security SDK (Software Development Kit) in the storage memory of the communication module, such as the built-in flash (flash memory), and use the encryption capability of the security SDK to encrypt the plaintext data of the communication to obtain the ciphertext data, thereby ensuring the security of the communication between the terminal and the server.

[0003] However, this solution requires that a portion of the storage memory of the communication module be allocated for storing the security SDK, and the security SDK requires a large amount of storage space in the storage memory, and is not suitable for communication modules with smaller internal storage memory. Summary of the invention

[0004] To solve the above technical problems, the present application provides an encryption method, device, equipment, storage medium and product for a communication module, which has low storage space requirements for storage memory and can be suitable for communication modules with smaller storage memory.

[0005] The present application provides an encryption method for a communication module, including:

[0006] Confirm the data to be encrypted;

[0007] Copying the encrypted firmware in the external memory to the running memory of the communication module; wherein the encrypted firmware includes a program written according to the encryption algorithm;

[0008] The data to be encrypted is encrypted using the encryption firmware.

[0009] As an improvement of the above solution, the step of copying the encrypted firmware in the external memory to the running memory of the communication module includes:

[0010] Obtaining the target encryption firmware type required for the data to be encrypted;

[0011] Obtaining target address information corresponding to the target encrypted firmware type from index information of the external memory; the index information includes the type of the encrypted firmware and its address information in the external memory;

[0012] The encrypted firmware corresponding to the target address information is copied from the external memory to the running memory of the communication module.

[0013] As an improvement of the above solution, at least one temporary storage area of ​​a preset size is provided in the running memory, and the temporary storage area is used to temporarily store the encrypted firmware;

[0014] The encrypting the data to be encrypted by using the encryption firmware includes: querying and jumping to the starting address of the encryption firmware in the temporary storage area, starting to run the encryption firmware, so as to encrypt the data to be encrypted by using the encryption firmware;

[0015] The encryption method of the communication module also includes: after the execution of the encryption firmware ends, deleting the encryption firmware from the temporary storage area.

[0016] As an improvement of the above solution, the encryption method of the communication module further includes:

[0017] Obtain an upgrade firmware package; the upgrade firmware package includes: an encrypted upgrade firmware package and a main upgrade firmware package;

[0018] Based on the encrypted upgrade firmware package, index information is generated and written into the external memory; the index information includes the type of encrypted firmware and its address information in the external memory;

[0019] Based on the current encrypted firmware of the external memory, the encrypted upgrade firmware package is used to upgrade the current encrypted firmware, and the upgraded encrypted firmware is written into the address corresponding to the external memory according to the index information;

[0020] Set the upgrade flag;

[0021] After the communication module is restarted, if the upgrade flag is detected, the communication module is upgraded according to the main upgrade firmware package, so that the communication module has the function of obtaining the encrypted firmware from the external memory and performing data encryption.

[0022] As an improvement of the above solution, the encryption method of the communication module further includes:

[0023] Obtaining verification information of the external memory;

[0024] If it is determined according to the verification information that the external memory is an authorized memory, the encrypted firmware is obtained from the external memory.

[0025] As an improvement of the above solution, the address information includes at least two of the starting address of the encrypted firmware in the external memory, the ending address of the encrypted firmware in the external memory, and the data length of the encrypted firmware.

[0026] The embodiment of the present application also provides an encryption device for a communication module, including:

[0027] An encryption judgment module is used to confirm the data to be encrypted;

[0028] A firmware acquisition module, used to copy the encrypted firmware in the external memory to the running memory of the communication module; wherein the encrypted firmware includes a program written according to the encryption algorithm;

[0029] A data encryption module is used to encrypt the data to be encrypted using the encryption firmware.

[0030] An embodiment of the present application also provides an encryption device for a communication module, including a processor and a memory, wherein a computer program is stored in the memory, and the computer program is configured to be executed by the processor, and when the processor executes the computer program, the encryption method for the communication module described in any one of the above items is implemented.

[0031] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the encryption methods of the communication module described above.

[0032] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the encryption method of the communication module described in any one of the above.

[0033] Compared with the prior art, the encryption method, device, equipment, storage medium and product of a communication module provided by the present application have the following beneficial effects: by connecting an external memory device storing encryption firmware to the communication module, the communication module can load the encryption firmware from the external memory device into the running memory for execution, thereby expanding the security encryption function of the communication module, so that the communication module has basic communication functions while realizing secure encryption of data, without the need to specifically allocate a portion of the storage memory inside the communication module for storing the integrated SDK, thereby reducing the requirements of the security encryption function for the internal storage space of the communication module, and also reducing the hardware cost of the communication module to implement the security encryption function.

[0034] In addition, the embodiment of the present application makes index information according to the upgrade firmware package, writes the index information into the external memory, and then writes the encrypted firmware into the external memory according to the index information, and finally completes the communication module upgrade, and can expand the security encryption function of the conventional communication module to obtain a secure communication module, or upgrade the security encryption function of the secure communication module, thereby improving the scalability of the security encryption function. The present application can be applied to portable and mobile products, and can flexibly provide corresponding secure encryption communication functions for different usage scenarios, with low cost, high flexibility, and strong scalability. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a flowchart of an encryption method of a communication module provided in an embodiment of the present application;

[0036] Figure 2 It is a structural diagram of a secure communication module provided in an embodiment of the present application;

[0037] Figure 3 It is a structural schematic diagram of an encryption device of a communication module provided in an embodiment of the present application;

[0038] Figure 4 It is a structural diagram of an encryption device of a communication module provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0040] See also Figure 1 , Figure 1 1 is a flow chart of an encryption method of a communication module provided in an embodiment of the present application. The encryption method of the communication module includes:

[0041] S1: Confirm the data to be encrypted;

[0042] S2: copying the encrypted firmware in the external memory to the running memory of the communication module; wherein the encrypted firmware includes a program written according to the encryption algorithm;

[0043] S3: Encrypt the data to be encrypted using the encryption firmware.

[0044] Specifically, see Figure 2 , Figure 2This is a structural diagram of a secure communication module provided by an embodiment of the present application, wherein the solid-line frame is the basic part, and the dotted-line frame is the extended part. The basic part is a conventional communication module, which has basic communication functions; the extended part is an external memory, specifically, an external memory is connected to the communication module; these two parts constitute a secure communication module, so that the conventional communication module can realize the expansion of the secure encryption function and can realize the encryption method provided by the present application.

[0045] Among them, the external memory is preferably a flash memory, which is a memory that stores one or more encrypted firmware for secure encryption. The encrypted firmware stored in the memory can be read and loaded by the communication module, and can also be modified or erased by the communication module. Furthermore, the firmware package running in the communication module includes a main firmware, and an optional arbitrary number (can be 0) of encrypted firmware. Among them, each encrypted firmware includes code data that supports its operation in the communication module, and the program recorded in the encrypted firmware can be loaded and run by the communication module to achieve data encryption. That is to say, the encrypted firmware includes a program written according to the encryption algorithm, so that the encrypted firmware has a data encryption function.

[0046] It should be noted that for a communication module that has not undergone security encryption function expansion, the firmware package it runs only contains the main thread business firmware, i.e., the main firmware; for a communication module that has undergone security encryption function expansion, the firmware package it runs contains the main firmware and the loaded encryption firmware.

[0047] When the secure communication module is running, first the communication module is powered on and the main firmware is run, which runs the main thread business according to the main program (i.e., the established program) in the main firmware, and the main program includes a step of detecting whether it is necessary to run in a secure encryption mode; if not, the main firmware is kept running and continues to run according to the main program until the main thread business is completed; if necessary, the data to be encrypted that needs to be securely encrypted is determined, and then the corresponding encryption firmware in the external memory is loaded into the running memory of the communication module for running, so as to create a corresponding encryption thread to encrypt the data to be encrypted, and return the encrypted data to the main thread, and the main thread continues to run the main thread business until the main thread business is completed.

[0048] Furthermore, the step of copying the encrypted firmware in the external memory to the running memory of the communication module includes:

[0049] Obtaining the target encryption firmware type required for the data to be encrypted;

[0050] Obtaining target address information corresponding to the target encrypted firmware type from index information of the external memory; the index information includes the type of the encrypted firmware and its address information in the external memory;

[0051] The encrypted firmware corresponding to the target address information is copied from the external memory to the running memory of the communication module.

[0052] Specifically, the communication module accesses the external memory through a physical connection, reads the index information recorded in the external memory from the preset index start address to the preset index end address, and obtains the type of encryption firmware stored in the index information and the address information of each encryption firmware stored in the external memory.

[0053] The main program running in the communication module detects one or more target encryption firmware required for the data to be encrypted. According to the target address information corresponding to the target encryption firmware in the acquired index information, the communication module reads the required target encryption firmware from the target address information in the external memory and copies it to the running memory of the communication module.

[0054] Among them, one or more encrypted firmware and index information are stored in the external memory. Among them, the index information is stored in the preset index start address to the preset index end address, which is an index header with a preset data length, and the information recorded includes the type of encrypted firmware stored in the external memory, and the address information of each encrypted firmware stored in the external memory; the encrypted firmware is stored in an indefinite start address and a continuous address thereafter, and the address information of any encrypted firmware in the external memory is recorded in the index information, and the required encrypted firmware can be retrieved according to the index information.

[0055] As shown in Table 1, the index address information, address information 1, ..., address information N of the external memory respectively store index information, encryption firmware 1, ..., encryption firmware N, and the index information stores the relationship between the types of encryption firmware 1, ..., encryption firmware N and the corresponding address information.

[0056] Table 1

[0057] Storage Information Storage address Index information Index address information Encrypted firmware 1 Address information 1 Encrypted firmware 2 Address information 2 ... ... Encrypted FirmwareN Address Information

[0058] The embodiments of the present application can determine the required type of target encryption firmware according to the requirements of the data to be encrypted, thereby ensuring the correctness and security of the encryption process; by quickly locating and copying the target encryption firmware from the index information, the firmware loading time is reduced and the operating efficiency is improved; by loading the firmware from the external storage device into the running memory, the flexibility of the communication module to cope with various encryption requirements is also improved.

[0059] As one of the optional embodiments, the address information includes at least two of the starting address of the encrypted firmware in the external memory, the ending address of the encrypted firmware in the external memory, and the data length of the encrypted firmware.

[0060] Specifically, by storing at least two of the starting address, ending address and data length of the encrypted firmware in the external memory in the index information, accurate positioning of the encrypted firmware is achieved, avoiding reading errors caused by incomplete or inaccurate address information. Not only can accurate positioning of the encrypted firmware be achieved, but address management can also be simplified, making access to the encrypted firmware more flexible and efficient.

[0061] Furthermore, at least one temporary storage area of ​​a preset size is set in the running memory, and the temporary storage area is used to temporarily store the encryption firmware; the use of the encryption firmware to encrypt the data to be encrypted includes: querying and jumping to the starting address of the encryption firmware in the temporary storage area, starting to run the encryption firmware, so as to use the encryption firmware to encrypt the data to be encrypted.

[0062] Specifically, after the target encrypted firmware is copied to the running memory, the main program running in the communication module jumps to the starting address of the target encrypted firmware in the running memory of the communication module, that is, the starting address in the temporary storage area, in a preset sequence, and starts running the program in the target encrypted firmware. When the encrypted firmware is running, a corresponding encryption thread will be created. At this time, the main thread of the communication module sends the data to be encrypted to the corresponding encryption thread, and the corresponding encryption thread encrypts the data to be encrypted and sends the encrypted data back to the main thread, thereby realizing the security encryption function of the secure communication module.

[0063] In an embodiment of the present application, the communication module does not need to reserve a fixed memory space for each encrypted firmware, but dynamically loads the encrypted firmware into the temporary memory as needed, thereby improving flexibility and reducing memory waste; by executing the encrypted firmware in the temporary storage area, the continuity and integrity of the encrypted firmware in the memory are ensured, reducing the risk of operation failure due to firmware fragmentation or memory conflicts.

[0064] Furthermore, the encryption method of the communication module also includes: after the execution of the encryption firmware ends, deleting the encryption firmware from the temporary storage area.

[0065] Specifically, the embodiment of the present application can quickly release memory resources by promptly deleting the encrypted firmware in the temporary storage area, making room for subsequent tasks, which is conducive to maintaining the efficient operation of the communication module and effectively reducing the risk of sensitive data remaining in the memory, thereby ensuring the security of the communication module when processing encryption tasks.

[0066] Furthermore, for the firmware package running in the communication module, a corresponding firmware package can be set according to different application scenario requirements.

[0067] Specifically, for the use scenario where the user will only use one encryption firmware at the same time, the firmware package running the communication module includes a main firmware and multiple encryption firmware. When making the firmware package, first make all the encryption firmware, and then query and obtain the size of the encryption firmware that occupies the largest storage space in the encryption firmware, assuming that its size is X bytes; when making the main firmware, configure the code so that when the main firmware is running, a partition of size X bytes is opened in the running memory of the communication module, that is, a temporary storage area, which is used to temporarily store and run the currently used encryption firmware when the communication module is running. It should be noted that when the communication module is carrying out encryption business, the temporary storage area only stores and runs one encryption firmware at the same time. When other encryption firmware needs to be run, it is necessary to wait for the running encryption firmware to finish running, clear the encryption firmware data in the temporary storage area, and then copy other encryption firmware from the external memory to the temporary storage area for operation.

[0068] For the use scenario where the user will use no more than Y (Y>1) encrypted firmware at the same time, the firmware package running the communication module includes a main firmware and multiple encrypted firmware. When making the firmware package, all the required encrypted firmware are also made first, and then the size of the encrypted firmware that occupies the largest storage space is queried and obtained, assuming that its size is Z bytes; when making the main firmware, the configuration code is so that when the main firmware is running, Y partitions of size Z bytes are opened in the running memory of the communication module, that is, Y temporary storage areas of size Z bytes, which are used to temporarily store and run the currently used number of no more than Y encrypted firmware when the communication module is running. It should be noted that when the corresponding communication module carries out encryption business, it is similar to the case of only one partition. A temporary storage area only stores and runs one encrypted firmware at the same time, and no more than Y encrypted firmware can be stored and run in the corresponding temporary storage area at the same time.

[0069] Furthermore, the communication module can be burned or upgraded through the firmware package to achieve the expansion and upgrade of the security encryption function of the communication module.

[0070] As one of the optional embodiments, the encryption method of the communication module further includes:

[0071] Obtain an upgrade firmware package; the upgrade firmware package includes: an encrypted upgrade firmware package and a main upgrade firmware package;

[0072] Based on the encrypted upgrade firmware package, index information is generated and written into the external memory; the index information includes the type of encrypted firmware and its address information in the external memory;

[0073] Based on the current encrypted firmware of the external memory, the encrypted upgrade firmware package is used to upgrade the current encrypted firmware, and the upgraded encrypted firmware is written into the address corresponding to the external memory according to the index information;

[0074] Set the upgrade flag;

[0075] After the communication module is restarted, if the upgrade flag is detected, the communication module is upgraded according to the main upgrade firmware package, so that the communication module has the function of obtaining the encrypted firmware from the external memory and performing data encryption.

[0076] Specifically, the developer, producer or user first creates an upgrade firmware package for the communication module and deploys it in a host computer burning tool or an upgrade server; when in the burning phase, it is deployed in the host computer burning tool; when in the upgrade phase, it is deployed in the upgrade server. The upgrade firmware package includes an encrypted upgrade firmware package and a main upgrade firmware package.

[0077] The encrypted upgrade firmware package stores the encrypted firmware that needs to be added to the external storage. When the upgrade firmware package is deployed, several types of encrypted firmware and their corresponding data lengths are obtained from the prepared encrypted upgrade firmware package, and index information corresponding to the encrypted firmware is prepared. The index information is also deployed in the host computer burning tool or upgrade server.

[0078] Next, the communication module runs the current main firmware, obtains index information from the host computer burning tool or upgrade server, and writes it into the preset index address information of the external memory; the communication module obtains the encrypted upgrade firmware package from the host computer burning tool or upgrade server, and writes the encrypted firmware in the encrypted upgrade firmware package to the corresponding starting address and a subsequent continuous address in the external memory in accordance with the index information in a full upgrade or differential upgrade manner; the communication module obtains the main upgrade firmware package from the host computer burning tool or upgrade server, saves the main upgrade firmware package in the built-in flash of the communication module, and sets the upgrade flag; wherein the index address information includes a preset index starting address and a preset index ending address, or the index address information includes a preset index starting address and an index data length.

[0079] Finally, restart the communication module. If the upgrade flag is detected after restart, run the boot loader to directly overwrite (full upgrade) or overwrite (differential upgrade) the main upgrade firmware package to the current main firmware after differential calculation, complete the upgrade and clear the upgrade flag. After the communication module is restarted again, the upgraded main firmware can be run.

[0080] Among them, the upgrade flag is the flag information recorded in the built-in flash of the communication module for determining whether the main firmware needs to be upgraded; when the upgrade flag exists, the communication module enters the boot loader and upgrades the main firmware after power-on; when the upgrade flag does not exist, the communication module runs the program in the main firmware after power-on.

[0081] It should be noted that, according to actual needs, the above-mentioned upgrade firmware package is a full upgrade package or a differential upgrade package in actual application. Among them, for the full upgrade package, when performing the upgrade operation, the upgraded upgrade firmware package is used to overwrite the original firmware package; for the differential upgrade package, when performing the upgrade operation, the original firmware package data is first obtained from the external memory or the built-in flash of the communication module, and the original firmware package data and the differential upgrade package data are calculated to obtain the upgraded firmware package, and then the upgraded firmware package is used to overwrite the original firmware package.

[0082] The embodiment of the present application can modify or add the functions, quantity and types of the encryption firmware stored in the external memory by upgrading the communication module upgrade firmware package, and can flexibly expand and upgrade the security encryption function; through phased upgrades and indexed management, flexible and efficient management of the encryption firmware is achieved, ensuring the security and consistency of the firmware upgrade.

[0083] As one of the optional embodiments, the encryption method of the communication module further includes:

[0084] Obtaining verification information of the external memory;

[0085] If it is determined according to the verification information that the external memory is an authorized memory, the encrypted firmware is obtained from the external memory.

[0086] Specifically, verification information is added to the communication between the communication module and the external memory to distinguish whether the external memory used is a device authorized by the manufacturer. When the communication module communicates with the external memory, the verification information of the external memory is obtained, and it is determined whether it is an authorized memory based on the verification information. If so, the memory can be used, otherwise the memory is prohibited from being used. The embodiment of the present application ensures that only trusted external memories can be accessed through an authorization verification mechanism, reducing potential security risks.

[0087] In the security SDK solutions provided by existing software integrated security encryption manufacturers (conventional solutions provided by security encryption manufacturers), a portion of the storage memory of the communication module needs to be allocated for storing the security SDK. However, the security SDK requires a large amount of storage space for the storage memory and is not suitable for communication modules with smaller internal storage memory. In other existing solutions, a security chip is introduced to transmit ciphertext data after encryption by the security chip. Although this type of solution has low requirements for the storage space of the internal storage memory of the communication module and can also ensure security, the cost of adding a dedicated security chip is too high.

[0088] The communication module encryption scheme provided in the embodiment of the present application can provide a communication module encryption scheme with strong scalability, reliable performance and low cost for users with security encryption requirements without affecting the use of existing communication module functions by users without security encryption requirements. The scheme can upgrade the original communication module to a secure communication module to achieve secure encrypted communication functions. Compared with the conventional solution of using a communication module in conjunction with an external security chip, the embodiment of the present application has lower hardware costs. Compared with the conventional solution of integrating a security SDK in the communication module software, the embodiment of the present application has lower storage memory requirements for the communication module, and is more suitable for portable and mobile products.

[0089] Correspondingly, the present application also provides an encryption device for a communication module, which can implement all processes of the encryption method for the communication module in the above embodiment.

[0090] See also Figure 3 , Figure 3 1 is a schematic diagram of the structure of an encryption device of a communication module provided in an embodiment of the present application. The encryption device of the communication module includes:

[0091] An encryption detection module 31, used to confirm the data to be encrypted;

[0092] The firmware acquisition module 32 is used to copy the encrypted firmware in the external memory to the running memory of the communication module; wherein the encrypted firmware includes a program written according to the encryption algorithm;

[0093] The data encryption module 33 is used to encrypt the data to be encrypted using the encryption firmware.

[0094] Preferably, the firmware acquisition module 32 is specifically used for:

[0095] Obtaining the target encryption firmware type required for the data to be encrypted;

[0096] Obtaining target address information corresponding to the target encrypted firmware type from index information of the external memory; the index information includes the type of the encrypted firmware and its address information in the external memory;

[0097] The encrypted firmware corresponding to the target address information is copied from the external memory to the running memory of the communication module.

[0098] Preferably, at least one temporary storage area of ​​a preset size is provided in the running memory, and the temporary storage area is used to temporarily store the encrypted firmware;

[0099] The data encryption module 33 is specifically used for:

[0100] Query and jump to the starting address of the encryption firmware in the temporary storage area, start running the encryption firmware, and use the encryption firmware to encrypt the data to be encrypted;

[0101] The encryption device of the communication module also includes:

[0102] The temporary storage unit is used to delete the encrypted firmware from the temporary storage area after the encrypted firmware is finished running.

[0103] Preferably, the encryption device of the communication module further includes an upgrade module, and the upgrade module includes:

[0104] An upgrade firmware package unit, used to obtain an upgrade firmware package; the upgrade firmware package includes: an encrypted upgrade firmware package and a main upgrade firmware package;

[0105] An index information unit, used to generate index information based on the encrypted upgrade firmware package and write the index information into the external memory; the index information includes the type of the encrypted firmware and its address information in the external memory;

[0106] An encryption firmware unit, configured to upgrade the current encryption firmware based on the current encryption firmware in the external memory by using the encryption upgrade firmware package, and write the upgraded encryption firmware into the address corresponding to the external memory according to the index information;

[0107] A flag setting unit, used for setting an upgrade flag;

[0108] The main firmware unit is used to upgrade the communication module according to the main upgrade firmware package if the upgrade flag is detected after the communication module is restarted, so that the communication module has the function of obtaining the encrypted firmware from the external memory and performing data encryption.

[0109] Preferably, the encryption device of the communication module further includes:

[0110] The information verification module is used to obtain verification information of the external memory; if it is determined according to the verification information that the external memory is an authorized memory, the encrypted firmware is obtained from the external memory.

[0111] Preferably, the address information includes at least two of a starting address of the encrypted firmware in the external memory, an ending address of the encrypted firmware in the external memory, and a data length of the encrypted firmware.

[0112] In the specific implementation, the working principle, control process and technical effect achieved by the encryption device of the communication module provided in the embodiment of the present application are the same as those of the encryption method of the communication module in the above-mentioned embodiment, and will not be repeated here.

[0113] See also Figure 4 , Figure 4 : is a schematic diagram of the structure of an encryption device of a communication module provided in an embodiment of the present application, wherein the encryption device of the communication module comprises: a processor 41, a memory 42, and a computer program stored in the memory 42 and executable on the processor 41. When the processor 41 executes the computer program, the steps in the encryption method embodiment of the communication module are implemented. Alternatively, when the processor 41 executes the computer program, the functions of each module / unit in the above-mentioned device embodiments are implemented.

[0114] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory 42 and executed by the processor 41 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the encryption device of the communication module.

[0115] The encryption device of the communication module may include, but is not limited to, a processor 41 and a memory 42. Those skilled in the art will appreciate that the schematic diagram is merely an example of the encryption device of the communication module and does not constitute a limitation on the encryption device of the communication module. The encryption device may include more or fewer components than shown in the diagram, or may combine certain components, or different components. For example, the encryption device of the communication module may also include an input / output device, a network access device, a bus, etc.

[0116] The processor 41 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor 41 is the control center of the encryption device of the communication module, and uses various interfaces and lines to connect various parts of the encryption device of the entire communication module.

[0117] The memory 42 can be used to store the computer program and / or module, and the processor 41 realizes various functions of the encryption device of the communication module by running or executing the computer program and / or module stored in the memory 42, and calling the data stored in the memory 42. The memory 42 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory 42 can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0118] Wherein, if the module / unit integrated in the encryption device of the communication module is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor 41, the steps of the above-mentioned method embodiments can be implemented. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc.

[0119] An embodiment of the present application further provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the encryption method of the communication module described in any of the above embodiments.

[0120] An embodiment of the present application also provides a computer program product, including a computer program / instruction, which, when executed by a processor of the computer program / instruction, implements the encryption method of the communication module described in any of the above embodiments.

[0121] The method in the present application can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the present application is executed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, a core network device, an OAM or other programmable device.

[0122] The computer program or instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disk; it may also be a semiconductor medium, such as a solid-state drive. The computer-readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.

[0123] The computer programs / instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing / processing device.

[0124] The computer program instructions for performing the operation of the present application can be assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions can be executed completely on a user's computer, partially on a user's computer, executed as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet). In some embodiments, by using the state information of a computer-readable program instruction to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA) or a programmable logic array (PLA), the electronic circuit can execute a computer-readable program instruction, thereby realizing various aspects of the present application.

[0125] Various aspects of the present application are described herein with reference to flowcharts and / or block diagrams according to embodiments of the present application. It should be understood that each block of the flowcharts and / or block diagrams and the combination of each block in the flowcharts and / or block diagrams can be implemented by computer-readable program instructions.

[0126] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0127] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0128] Each square frame in the flow chart or block diagram can represent a part of a module, a program segment or an instruction, and a part of the module, program segment or an instruction comprises one or more executable instructions for realizing the logical function of the regulation. In some implementations as replacement, the function marked in the square frame can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square frames can actually be executed substantially in parallel, and they can also be executed in the opposite order sometimes, depending on the function involved. It should also be noted that each square frame in the block diagram and / or the flow chart, and the combination of the square frames in the block diagram and / or the flow chart can be realized by a dedicated hardware-based system that performs the function or action of the regulation, or can be realized by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that it is equivalent to realize by hardware, realize by software, and realize by the combination of software and hardware.

[0129] The encryption method, device, equipment, storage medium and product of a communication module provided by the present application have the following beneficial effects: by connecting an external memory with encrypted firmware to the communication module, the communication module can load the encrypted firmware from the external memory to the running memory for operation, so as to realize the expansion of the security encryption function of the communication module, so that the communication module has the basic communication function and realizes the security encryption of data at the same time, and there is no need to allocate a part of the storage memory inside the communication module for storing the integrated SDK, which reduces the requirements of the security encryption function on the internal storage space of the communication module, and also reduces the hardware cost of the communication module to realize the security encryption function; in addition, by making index information according to the upgraded firmware package, writing the index information into the external memory, and then writing the encrypted firmware into the external memory according to the index information, and finally completing the communication module upgrade, the conventional communication module can be expanded with the security encryption function to obtain a secure communication module, or the security encryption function of the secure communication module can be upgraded, which improves the scalability of the security encryption function. The present application can be applied to portable and mobile products, and can flexibly provide corresponding secure encryption communication functions for different usage scenarios, with low cost, high flexibility and strong scalability.

[0130] The above is a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications are also considered to be within the scope of protection of the present application.

Claims

1. An encryption method for a communication module, characterized in that: include: Confirm the data to be encrypted; Copying the encrypted firmware in the external memory to the running memory of the communication module; wherein the encrypted firmware includes a program written according to the encryption algorithm; The data to be encrypted is encrypted using the encryption firmware.

2. The encryption method of the communication module according to claim 1, characterized in that: The step of copying the encrypted firmware in the external memory to the running memory of the communication module includes: Obtaining the target encryption firmware type required for the data to be encrypted; Obtaining target address information corresponding to the target encrypted firmware type from index information of the external memory; the index information includes the type of the encrypted firmware and its address information in the external memory; The encrypted firmware corresponding to the target address information is copied from the external memory to the running memory of the communication module.

3. The encryption method of the communication module according to claim 1, characterized in that: At least one temporary storage area of ​​a preset size is provided in the running memory, and the temporary storage area is used to temporarily store the encrypted firmware; The encrypting the data to be encrypted by using the encryption firmware includes: querying and jumping to the starting address of the encryption firmware in the temporary storage area, starting to run the encryption firmware, so as to encrypt the data to be encrypted by using the encryption firmware; The encryption method of the communication module also includes: after the execution of the encryption firmware ends, deleting the encryption firmware from the temporary storage area.

4. The encryption method of the communication module according to claim 1, characterized in that: The encryption method of the communication module further includes: Obtain an upgrade firmware package; the upgrade firmware package includes: an encrypted upgrade firmware package and a main upgrade firmware package; Based on the encrypted upgrade firmware package, index information is generated and written into the external memory; the index information includes the type of encrypted firmware and its address information in the external memory; Based on the current encrypted firmware of the external memory, the encrypted upgrade firmware package is used to upgrade the current encrypted firmware, and the upgraded encrypted firmware is written into the address corresponding to the external memory according to the index information; Set the upgrade flag; After the communication module is restarted, if the upgrade flag is detected, the communication module is upgraded according to the main upgrade firmware package, so that the communication module has the function of obtaining the encrypted firmware from the external memory and performing data encryption.

5. The encryption method of the communication module according to claim 1, characterized in that: The encryption method of the communication module further includes: Obtaining verification information of the external memory; If it is determined according to the verification information that the external memory is an authorized memory, the encrypted firmware is obtained from the external memory.

6. The encryption method of the communication module according to claim 2, characterized in that: The address information includes at least two of the starting address of the encrypted firmware in the external memory, the ending address of the encrypted firmware in the external memory, and the data length of the encrypted firmware.

7. An encryption device for a communication module, characterized in that: include: An encryption detection module, used to confirm the data to be encrypted; A firmware acquisition module, used to copy the encrypted firmware in the external memory to the running memory of the communication module; wherein the encrypted firmware includes a program written according to the encryption algorithm; A data encryption module is used to encrypt the data to be encrypted using the encryption firmware.

8. An encryption device for a communication module, characterized in that: It includes a processor and a memory, wherein a computer program is stored in the memory, and the computer program is configured to be executed by the processor, and when the processor executes the computer program, the encryption method of the communication module as described in any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the device where the computer-readable storage medium is located executes the computer program, the encryption method of the communication module according to any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the encryption method of the communication module as described in any one of claims 1 to 6 is implemented.