Control method, device, electronic device and storage medium for single-board CPLD encrypted loading

By obtaining and comparing the version information of the CPLD file, combining the version information in the server for encryption and decryption, only files with the same version are loaded, and a unique interface is established through GPIO, which solves the insufficient identification of CPLD loading files in the existing technology and The problem of interface diversity achieves efficient and secure single-board CPLD loading.

CN113553114BActive Publication Date: 2024-11-29CHINA GREATWALL TECH GRP CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202010322118.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-22
Publication Date
2024-11-29
Estimated Expiration
2040-04-22

AI Technical Summary

Technical Problem

The existing CPLD loading method cannot identify the loaded files, resulting in system exceptions. The first load and upgrade loading require different interfaces respectively, which has security and efficiency problems.

Method used

By obtaining the expected version information of the single-board CPLD operation, combining the correspondence between the version information and the CPLD file in the server, encrypting and decrypting calculations are performed, only files with the same version are loaded, and a unique interface is established through GPIO to simulate JTAG timing for loading.

Benefits of technology

The identification of CPLD files is realized, ensuring the normal operation of the system, improving loading efficiency and security, and completing the first loading and upgrade loading through a unique interface.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113553114B_ABST
    Figure CN113553114B_ABST
Patent Text Reader

Abstract

The present application provides a control method, device, electronic device and storage medium for encrypted loading of a single-board CPLD, the method comprising: obtaining first version information, wherein the first version information is the version information of the CPLD file corresponding to the expected operation of the single-board CPLD; obtaining the encrypted CPLD file to be loaded according to the first version information in combination with the correspondence between the version information and the CPLD file in the server; comparing the first version information with the original version information corresponding to the CPLD file currently configured by the single-board CPLD; if the first version information is inconsistent with the original version information, decrypting and loading the encrypted CPLD file to be loaded, otherwise stopping loading. The method first identifies the CPLD file through encryption and decryption calculations before performing a loading operation on the single-board CPLD, thereby realizing encrypted loading control of the single-board CPLD, and only CPLD files that have passed the identification are loaded, ensuring the normal operation of the system and high loading efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer communication technology, and in particular, relates to a control method, device, electronic device and storage medium for single-board CPLD encrypted loading. Background Art

[0002] Complex Programmable Logic Device (CPLD) is a device that forms logical behavior in the form of product term structure. Users can construct large-scale digital integrated circuits with logical functions according to their own needs. It is widely used in storage control systems. The initially designed CPLD needs to be loaded for the first time before it can be used. In order to improve efficiency, reduce costs and enhance user experience, it is inevitable to upgrade and load the CPLD.

[0003] However, the existing CPLD loading method usually uses a JTAG tool to load the single-board CPLD before testing it. During the loading process of the single-board CPLD, the loaded CPLD files cannot be identified, and all files can be loaded into the CPLD, which is prone to system abnormalities caused by loading wrong files. Summary of the invention

[0004] In view of this, the embodiments of the present application provide a control method, device, electronic device and storage medium for encrypted loading of a single-board CPLD, which can identify the loaded CPLD file to ensure the normal operation of the single-board CPLD system; and / or can realize the first loading and upgrade loading of the single-board CPLD through a unique interface, with good security and high efficiency.

[0005] A first aspect of an embodiment of the present application provides a control method for encrypted loading of a single-board CPLD, the control method for encrypted loading of a single-board CPLD comprising:

[0006] Acquire first version information, wherein the first version information is version information of a CPLD file corresponding to the expected operation of the single-board CPLD;

[0007] According to the first version information, in combination with the correspondence between the version information in the server and the CPLD file, an encrypted CPLD file to be loaded is obtained;

[0008] Compare the first version information with the original version information corresponding to the CPLD file currently configured by the single-board CPLD;

[0009] If the first version information is inconsistent with the original version information, the encrypted CPLD file to be loaded is decrypted and loaded, otherwise the loading is stopped.

[0010] In combination with the first aspect, in a first possible implementation manner of the first aspect, before the step of acquiring the encrypted CPLD file to be loaded according to the first version information and the correspondence between the version information in the server and the CPLD file, the step further includes:

[0011] For a CPLD file stored in the server, encrypting and calculating the content of the CPLD file to obtain a hash value corresponding to the CPLD file, and compiling the hash value into a header of the CPLD file;

[0012] The hash value compiled in the header of the CPLD file is read, and the hash value is mapped and associated with the version information of the CPLD file to establish a corresponding relationship between the hash value and the version information of the CPLD file.

[0013] In combination with the first aspect, in a second possible implementation of the first aspect, a unique interface is established between the server and the single-board CPLD through GPIO simulating JTAG timing, and the step of decrypting and loading the CPLD file to be loaded includes:

[0014] The CPLD file to be loaded is decrypted and calculated, and the decrypted CPLD file to be loaded is loaded into the single-board CPLD through the unique interface, wherein the loading includes first loading or upgrade loading.

[0015] In combination with the first aspect or the first possible implementation manner of the first aspect or the second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, the step of obtaining the first version information includes:

[0016] A loading instruction generated by a server according to the expected operation of the single-board CPLD is received, and the first version information is obtained by parsing the loading instruction.

[0017] In combination with the third possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, the control method for encrypted loading of the single-board CPLD includes:

[0018] Controlling the encrypted loading of the board CPLD by manual loading; and / or

[0019] The encrypted loading of the board CPLD is controlled by automatic loading.

[0020] In combination with the fourth possible implementation manner of the first aspect, in a fifth possible implementation manner of the first aspect, the step of receiving a loading instruction generated by the server according to the single-board CPLD operation expectation, and obtaining the first version information by parsing the loading instruction includes:

[0021] If the encrypted loading of the single-board CPLD is controlled by manual loading, the server is triggered to generate a loading instruction based on the request information input by the user in the server to represent the expected operation of the single-board CPLD;

[0022] If the encrypted loading of the single-board CPLD is controlled by automatic loading, the server is triggered to automatically generate a loading instruction based on the loading policy preset by the server.

[0023] A second aspect of an embodiment of the present application provides a control device for encrypted loading of a single-board CPLD, the control device for encrypted loading of a single-board CPLD comprising:

[0024] A first acquisition module is used to acquire first version information, wherein the first version information is version information of a CPLD file corresponding to the expected operation of the single-board CPLD;

[0025] A second acquisition module, used for acquiring the encrypted CPLD file to be loaded according to the first version information and the corresponding relationship between the version information in the server and the CPLD file;

[0026] A comparison module, used for comparing the first version information with the original version information corresponding to the CPLD file currently configured by the single-board CPLD;

[0027] The execution module is used for decrypting and loading the encrypted CPLD file to be loaded if the first version information is inconsistent with the original version information, otherwise stopping the loading.

[0028] In conjunction with the second aspect, in a first possible implementation manner of the second aspect, the control device for encrypting and loading the single-board CPLD further includes:

[0029] The loading submodule is used to perform decryption calculation on the CPLD file to be loaded, and load the decrypted CPLD file to be loaded into the single-board CPLD through the unique interface, wherein the loading includes the first loading or the upgrade loading.

[0030] A third aspect of an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the control method for encrypted loading of a single-board CPLD as described in any one of the first aspects are implemented.

[0031] The fourth aspect of the embodiments of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of the control method for encrypted loading of a single-board CPLD as described in any one of the first aspects.

[0032] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0033] The present application obtains the first version information, wherein the first version information is the version information of the CPLD file corresponding to the expected operation of the single-board CPLD; according to the first version information, in combination with the correspondence between the version information and the CPLD file in the server, the encrypted CPLD file to be loaded is obtained; the first version information is compared with the original version information corresponding to the CPLD file currently configured by the single-board CPLD; if the first version information is inconsistent with the original version information, the encrypted CPLD file to be loaded is decrypted and loaded, otherwise the loading is stopped. The method can identify the CPLD file by encryption and decryption calculation before performing the loading operation on the single-board CPLD to obtain the correct version of the CPLD file to be loaded, thereby realizing the encrypted loading control of the single-board CPLD. In this method, only the CPLD files that have passed the screening are loaded, which ensures the normal operation of the system and high loading efficiency. The present application establishes a unique interface between the server and the single-board CPLD through GPIO simulating JTAG timing, and the first loading and upgrade loading of the single-board CPLD are completed through the unique interface, which has good security. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0035] Figure 1 A schematic diagram of a basic method flow of a control method for single-board CPLD encrypted loading provided in an embodiment of the present application;

[0036] Figure 2 A flow chart of a method for associating version information with a CPLD file based on a hash value in a control method for encrypted loading of a single-board CPLD provided in an embodiment of the present application;

[0037] Figure 3 A hardware block diagram of the connection between the server and the single-board CPLD provided in the embodiment of the present application;

[0038] Figure 4 A schematic diagram of the structure of a control device for single-board CPLD encryption loading provided in an embodiment of the present application;

[0039] Figure 5 A schematic diagram of an electronic device for a control method for single-board CPLD encrypted loading provided in an embodiment of the present application. DETAILED DESCRIPTION

[0040] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0041] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0042] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0043] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0044] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0045] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0046] In order to illustrate the technical solution described in this application, a specific embodiment is provided below for illustration.

[0047] The embodiment of the present application aims to provide a control method for encrypted loading of a single-board CPLD, by generating a hash value by encrypting and calculating a CPLD file stored in a server's built-in memory, and compiling the hash value into the header of the CPLD file as version information corresponding to the CPLD file. Further, the CPLD file is identified according to the version information, and only the CPLD file of the correct version confirmed by the identification will be decrypted and loaded. Thus, the situation where all files are loaded into the single-board CPLD is avoided, and the single-board CPLD system can be guaranteed to operate normally.

[0048] In some embodiments of this application, please refer to Figure 1 , Figure 1 A basic method flow chart of a control method for single-board CPLD encrypted loading provided in an embodiment of the present application is described in detail as follows:

[0049] In step S101, first version information is obtained, wherein the first version information is version information of a CPLD file corresponding to the expected operation of the single-board CPLD.

[0050] In the present embodiment, the function of the server can be integrated into a controller to be implemented, and this controller is called a baseboard management controller (Baseboard Manager Controller, BMC for short). In the present embodiment, the CPLD file is used to run the single-board CPLD system. The technician can create a CPLD file according to actual needs on the terminal, or obtain a plurality of different versions of the CPLD file by modifying the original CPLD file. There are functional differences and / or performance differences between these different versions of the CPLD files or between these different versions of the CPLD files and the original CPLD file when used to run the single-board CPLD system. Moreover, each version of the CPLD file has a unique version information corresponding thereto. In the present embodiment, based on the expectation of the operation of the single-board CPLD, the CPLD file of the corresponding version of the expectation of the operation of the single-board CPLD can be loaded into the single-board CPLD by BMC, thereby realizing the expectation of the operation of the single-board CPLD. It can be understood that the expectation of the operation of the single-board CPLD is the function and performance that the single-board CPLD system is expected to have when it is running.

[0051] In step S102, the encrypted CPLD file to be loaded is obtained according to the first version information and the corresponding relationship between the version information in the server and the CPLD file.

[0052] In this embodiment, different versions of CPLD files created by technicians are stored in the server's built-in memory, and each CPLD file has a corresponding version information. Therefore, the BMC can traverse the server's built-in memory based on the first version information obtained, and perform version verification on all CPLD files stored in the memory in combination with the correspondence between the version information in the server and the CPLD file, and obtain the CPLD file corresponding to the first version information. The obtained CPLD file corresponding to the first version information is the CPLD file to be loaded.

[0053] In some embodiments of this application, please refer to Figure 2 , Figure 2 A flow chart of a method for associating version information with a CPLD file based on a hash value in a control method for encrypted loading of a single-board CPLD provided in an embodiment of the present application. Details are as follows:

[0054] In step S201, for a CPLD file stored in a server, the content of the CPLD file is encrypted and calculated to obtain a hash value corresponding to the CPLD file, and the hash value is compiled into the header of the CPLD file;

[0055] In step S202, the hash value compiled in the header of the CPLD file is read, and the hash value is mapped and associated with the version information of the CPLD file to establish a corresponding relationship between the hash value and the version information of the CPLD file.

[0056] In this embodiment, when the technician creates a CPLD file loaded for the first time by a single-board CPLD or creates a CPLD file updated by iteration of a single-board CPLD, after the CPLD compilation tool completes the compilation of the CPLD file content, the CPLD file content will be encrypted by a hash algorithm to generate a hash value corresponding to the CPLD file content. And the generated hash value is compiled in the header of the CPLD file. Then, the encrypted CPLD file compiled with the hash value in the file header is stored in the built-in memory of the server to be loaded and used by the single-board CPLD. For all CPLD files stored in the server, the hash value compiled in each CPLD file header is read, and the hash value is mapped and associated with the version information of the corresponding CPLD file to establish a corresponding relationship between the hash value and the version information of the CPLD file. That is, in the memory, each CPLD file has a corresponding version information and a corresponding hash value, and its hash value is correspondingly associated with the version information. Therefore, the BMC can obtain the hash value corresponding to the first version information according to the correspondence between the hash value and the version information of the CPLD file, and then traverse the hash value of each encrypted CPLD file header in the memory according to the hash value corresponding to the first version information, so as to obtain the encrypted CPLD file consistent with the hash value corresponding to the first version information from the memory as the CPLD file to be loaded by verifying the hash value of the CPLD file header.

[0057] In step S103, the first version information is compared with the original version information corresponding to the CPLD file currently configured in the single-board CPLD.

[0058] In this embodiment, the BMC reads the original version information corresponding to the CPLD file currently configured by the single-board CPLD by querying the current operating status information of the single-board CPLD, and then compares the first version information corresponding to the CPLD file to be loaded obtained with the original version information corresponding to the CPLD file currently configured by the single-board CPLD that it has read, thereby determining whether the original version information is consistent with the first version information, and then determining whether the single-board CPLD currently needs to load the CPLD file to be loaded. It can be understood that when judging whether the original version information is consistent with the first version information, it can also be judged by checking whether the hash values ​​corresponding to the two are consistent.

[0059] In step S104, if the first version information is inconsistent with the original version information, the encrypted CPLD file to be loaded is decrypted and loaded, otherwise the loading is stopped.

[0060] In this embodiment, by comparing the first version information corresponding to the CPLD file to be loaded obtained with the original version information corresponding to the CPLD file currently configured by the read single-board CPLD, if the first version information is consistent with the original version information, it means that the single-board CPLD is already using the CPLD file to be loaded to run the system, and no further update is required at the current moment, and the loading is stopped. If the first version information is inconsistent with the original version information, it means that the current single-board CPLD is not using the CPLD file to be loaded to run the system, and the single-board CPLD needs to perform a loading operation at present, that is, the encrypted CPLD file to be loaded can be decrypted at this time to obtain the content of the corresponding CPLD file to be loaded, and then the content of the CPLD file to be loaded is loaded into the single-board CPLD.

[0061] The control method for encrypted loading of a single-board CPLD provided in the above embodiment realizes encrypted loading control of the single-board CPLD by first screening the CPLD file through encryption and decryption calculations before performing the loading operation on the single-board CPLD. Only CPLD files that have passed the screening are loaded, ensuring the normal operation of the system and high loading efficiency.

[0062] In some embodiments of this application, please refer to Figure 3 , Figure 3 The hardware block diagram of the server and the single-board CPLD connection provided in the embodiment of the present application. Figure 3As shown, the server 10 and the single-board CPLD 20 establish a unique interface 30 for connection through GPIO simulation JTAG timing. Specifically, four general-purpose input / output pins (GPIO) are configured in the server 10, and these four pins respectively simulate the test clock / programming clock input (TCK pin), test data / programming data input (TDI pin), test data / programming data output (TDO pin) and test mode selection (TMS pin) in the JTAG timing and are connected to the single-board CPLD 20, forming a unique interface between the server 10 and the single-board CPLD 20. Thus, the BMC in the server can write a running program (i.e., the first loading operation) or update the running program (i.e., the upgrade loading operation) for the single-board CPLD through the unique interface. In this embodiment, if a loading operation needs to be performed on the single-board CPLD at present, then the BMC will perform a decryption calculation on the CPLD file to be loaded obtained according to the first version information based on the hash algorithm, obtain the content of the CPLD file to be loaded, and then load the decrypted content of the CPLD file to be loaded into the single-board CPLD through a unique interface 30 established between the server 10 and the single-board CPLD 20, thereby realizing the first loading or upgrade loading of the single-board CPLD. Among them, if the content of the CPLD file to be loaded is loaded into the single-board CPLD when the current configuration of the single-board CPLD is empty, it is the first loading, and if the content of the CPLD file to be loaded is loaded into the single-board CPLD when the single-board CPLD has the currently configured CPLD file, it is the upgrade loading, which avoids the problem that the first loading and upgrade loading need to be implemented by two different interfaces respectively. From the perspective of the loading operation of the single-board CPLD, the first loading and upgrade loading of the single-board CPLD can be realized through a unique interface, which has good security and high loading efficiency.

[0063] In some embodiments of the present application, when obtaining the first version information, the server may generate a loading instruction for requesting the single-board CPLD to be loaded according to the single-board CPLD operation expectation, and the BMC receives and parses the loading instruction to obtain the first version information of the CPLD file corresponding to the single-board CPLD operation expectation. The BMC traverses the server's built-in memory according to the first version information, and then verifies all CPLD files stored in the memory in combination with the correspondence between the version information in the server and the CPLD file, so as to obtain the CPLD file to be loaded corresponding to the first version information.

[0064] In some embodiments of the present application, the single-board CPLD can be controlled to be encrypted and loaded by manual loading or automatic loading. If it is manual loading, the server is triggered to generate a loading instruction based on the request information input by the user in the server to characterize the expected operation of the single-board CPLD. For example, the user needs to upgrade the CPLD file currently configured by the single-board CPLD to a specific version, so at this time, the user can input the request information characterizing the expected operation of the single-board CPLD in the server by manual loading, so that the server generates a corresponding loading instruction based on the request information. And if it is automatic loading, the server is triggered to automatically generate a loading instruction based on the loading strategy pre-set by the server. For example, the single-board CPLD is set to always use the latest version of the CPLD file by default and automatically update, thus, when the BMC is started, the version information in the single-board CPLD is automatically read, and the built-in memory of the server is traversed according to the version information, and it is found whether there is a latest version of the CPLD file in the memory, and if there is a latest version of the CPLD file, the latest version of the CPLD file is loaded into the single-board CPLD.

[0065] It is understandable that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0066] In some embodiments of this application, please refer to Figure 4 , Figure 4 A schematic diagram of the structure of a control device for single-board CPLD encryption loading provided in an embodiment of the present application is described in detail as follows:

[0067] The control device for encrypted loading of the single-board CPLD includes: a first acquisition module 401, a second acquisition module 402, a comparison module 403 and an execution module 404. The first acquisition module 401 is used to obtain the first version information, wherein the first version information is the version information of the CPLD file corresponding to the expected operation of the single-board CPLD. The second acquisition module 402 is used to obtain the encrypted CPLD file to be loaded according to the first version information and the correspondence between the version information and the CPLD file in the server. The comparison module 403 is used to compare the first version information with the original version information corresponding to the CPLD file currently configured by the single-board CPLD. The execution module 404 is used to decrypt and load the encrypted CPLD file to be loaded if the first version information is inconsistent with the original version information, otherwise stop loading.

[0068] In some embodiments of the present application, the control device for encrypted loading of the single-board CPLD further includes: a loading submodule. The loading submodule is used to perform decryption calculation on the CPLD file to be loaded, and load the decrypted CPLD file to be loaded into the single-board CPLD through the unique interface, wherein the loading includes first loading or upgrade loading.

[0069] The control device for encrypted loading of the single-board CPLD corresponds one-to-one to the control method for encrypted loading of the single-board CPLD described above.

[0070] In some embodiments of this application, please refer to Figure 5 , Figure 5 A schematic diagram of an electronic device for a control method of single-board CPLD encryption loading provided by an embodiment of the present application. Figure 5 As shown, the electronic device 5 of this embodiment includes: a processor 51, a memory 52, and a computer program 53 stored in the memory 52 and executable on the processor 51, such as a control program for encrypted loading of a single-board CPLD. When the processor 51 executes the computer program 52, the steps in the above-mentioned control method embodiments for encrypted loading of the single-board CPLD are implemented. Alternatively, when the processor 51 executes the computer program 53, the functions of each module / unit in the above-mentioned device embodiments are implemented.

[0071] Exemplarily, the computer program 53 may be divided into one or more modules / units, which are stored in the memory 52 and executed by the processor 51 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 53 in the electronic device 5. For example, the computer program 53 may be divided into:

[0072] A first acquisition module is used to acquire first version information, wherein the first version information is version information of a CPLD file corresponding to the expected operation of the single-board CPLD;

[0073] A second acquisition module, used for acquiring the encrypted CPLD file to be loaded according to the first version information and the corresponding relationship between the version information in the server and the CPLD file;

[0074] A comparison module, used for comparing the first version information with the original version information corresponding to the CPLD file currently configured by the single-board CPLD;

[0075] The execution module is used for decrypting and loading the encrypted CPLD file to be loaded if the first version information is inconsistent with the original version information, otherwise stopping the loading.

[0076] The electronic device may include, but is not limited to, a processor 51 and a memory 52. ​​Those skilled in the art will appreciate that Figure 5 It is only an example of the electronic device 5 and does not constitute a limitation of the electronic device 5. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.

[0077] The processor 51 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.

[0078] The memory 52 may be an internal storage unit of the electronic device 5, such as a hard disk or memory of the electronic device 5. The memory 52 may also be an external storage device of the electronic device 5, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 5. Further, the memory 52 may also include both an internal storage unit and an external storage device of the electronic device 5. The memory 52 is used to store the computer program and other programs and data required by the electronic device. The memory 52 may also be used to temporarily store data that has been output or is to be output.

[0079] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0080] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0081] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0082] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0083] If the integrated module / unit 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 the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. . 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. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0084] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0085] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0086] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0087] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0088] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A control method for single-board CPLD encryption loading, It is characterized in that include: Acquire first version information, wherein the first version information is version information of a CPLD file corresponding to the expected operation of the single-board CPLD; According to the first version information, in combination with the correspondence between the version information in the server and the CPLD file, an encrypted CPLD file to be loaded is obtained; Compare the first version information with the original version information corresponding to the CPLD file currently configured by the single-board CPLD; If the first version information is inconsistent with the original version information, the encrypted CPLD file to be loaded is decrypted and loaded, otherwise the loading is stopped; Wherein, before the step of acquiring the encrypted CPLD file to be loaded according to the first version information and the corresponding relationship between the version information in the server and the CPLD file, the method further includes: For a CPLD file stored in the server, encrypting and calculating the content of the CPLD file to obtain a hash value corresponding to the CPLD file, and compiling the hash value into a header of the CPLD file; Reading a hash value compiled in the header of the CPLD file, and mapping and associating the hash value with the version information of the CPLD file to establish a corresponding relationship between the hash value and the version information of the CPLD file; The step of obtaining the encrypted CPLD file to be loaded according to the first version information and in combination with the correspondence between the version information in the server and the CPLD file includes: According to the correspondence between the hash value and the version information of the CPLD file, obtaining the hash value corresponding to the first version information; According to the hash value corresponding to the first version information, traverse the hash value of each encrypted CPLD file header in the memory; By verifying the hash value of the CPLD file header, an encrypted CPLD file consistent with the hash value corresponding to the first version information is obtained from the memory as the CPLD file to be loaded.

2. The control method for single-board CPLD encryption loading according to claim 1, It is characterized in that A unique interface is established between the server and the single-board CPLD through GPIO simulation JTAG timing, and the step of decrypting and loading the CPLD file to be loaded includes: The CPLD file to be loaded is decrypted and calculated, and the decrypted CPLD file to be loaded is loaded into the single-board CPLD through the unique interface, wherein the loading includes first loading or upgrade loading.

3. The control method for single-board CPLD encryption loading according to any one of claims 1-2, It is characterized in that The step of obtaining the first version information includes: A loading instruction generated by a server according to the expected operation of the single-board CPLD is received, and the first version information is obtained by parsing the loading instruction.

4. The control method for single-board CPLD encryption loading according to claim 3, It is characterized in that The control method for CPLD encryption loading of the single board includes: Controlling the encrypted loading of the board CPLD by manual loading; and / or The encrypted loading of the board CPLD is controlled by automatic loading.

5. The control method for single-board CPLD encryption loading according to claim 4, It is characterized in that The step of receiving a loading instruction generated by the server according to the single-board CPLD operation expectation, and obtaining the first version information by parsing the loading instruction includes: If the encrypted loading of the single-board CPLD is controlled by manual loading, the server is triggered to generate a loading instruction based on the request information input by the user in the server to represent the expected operation of the single-board CPLD; If the encrypted loading of the single-board CPLD is controlled by automatic loading, the server is triggered to automatically generate a loading instruction based on the loading policy preset by the server.

6. A control device for single-board CPLD encryption loading, It is characterized in that The control device for encrypting and loading the single-board CPLD comprises: A first acquisition module is used to acquire first version information, wherein the first version information is version information of a CPLD file corresponding to the expected operation of the single-board CPLD; A second acquisition module is used to obtain the encrypted CPLD file to be loaded according to the first version information and the corresponding relationship between the version information in the server and the CPLD file; a comparison module is used to compare the first version information with the original version information corresponding to the CPLD file currently configured in the single-board CPLD; An execution module, configured to decrypt and load the encrypted CPLD file to be loaded if the first version information is inconsistent with the original version information, and otherwise stop loading; Before the step of obtaining the encrypted CPLD file to be loaded according to the first version information and the corresponding relationship between the version information in the server and the CPLD file, the second obtaining module is further used to encrypt the content of the CPLD file stored in the server to obtain a hash value corresponding to the CPLD file, and compile the hash value into the header of the CPLD file; Reading a hash value compiled in the header of the CPLD file, and mapping and associating the hash value with the version information of the CPLD file to establish a corresponding relationship between the hash value and the version information of the CPLD file; Among them, when obtaining the encrypted CPLD file to be loaded according to the first version information and the correspondence between the version information in the server and the CPLD file, the second acquisition module is also used to obtain the hash value corresponding to the first version information according to the correspondence between the hash value and the version information of the CPLD file; according to the hash value corresponding to the first version information, traverse the hash value of each encrypted CPLD file header in the memory; by verifying the hash value of the CPLD file header, obtain the encrypted CPLD file consistent with the hash value corresponding to the first version information from the memory as the CPLD file to be loaded.

7. The control device for single-board CPLD encryption loading according to claim 6, It is characterized in that The control device for encrypting and loading the single-board CPLD also includes: The loading submodule is used to perform decryption calculation on the CPLD file to be loaded, and load the decrypted CPLD file to be loaded into the single-board CPLD through a unique interface, wherein the loading includes first loading or upgrade loading.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the control method for encrypted loading of a single-board CPLD as described in any one of claims 1 to 5 are implemented.

9. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the steps of the control method for encrypted loading of a single-board CPLD as claimed in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Complex programmable logic device updating method and system

    CN103309693A

  • Programmable logic device, starting method thereof, system and storage medium

    CN109144584A

  • A CPLD online upgrading method and device

    CN109491679A