Firmware upgrading method, device, equipment and system

By receiving user instructions from cloud servers to generate and verify the CPLD firmware upgrade package, the problem of customized CPLD firmware upgrade is solved, and fast and reliable firmware upgrade and remote debugging is achieved, which improves system stability and reduces development costs.

CN119512587APending Publication Date: 2025-02-25SHENZHEN FENGRUNDA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411122141.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

It is difficult for the existing technology to achieve customized upgrades of CPLD firmware, especially in remote application scenarios, resulting in low system stability, high development costs and low remote debugging efficiency.

Method used

By receiving user instructions sent by the cloud server, a firmware upgrade package is generated. The package is generated by the CPLD function selected by the user or uploaded code, and is checked and debugged to ensure the correctness and stability of the firmware, and finally install the upgrade package in the CPLD device.

Benefits of technology

It realizes the rapid, reliable and customized upgrade of CPLD firmware, improves system stability, reduces development costs and time, and enhances the efficiency and security of remote debugging.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512587A_ABST
    Figure CN119512587A_ABST
Patent Text Reader

Abstract

The invention discloses a firmware upgrading method, device, equipment and system, and relates to the field of embedded technology, the firmware upgrading method comprises the steps that a user instruction sent by a cloud server is received, a firmware upgrading package is obtained according to the user instruction, and the firmware upgrading package is generated by a CPLD function selected by a user or an uploaded code; checking and debugging the firmware upgrade package to obtain a debugging result; and when the debugging result is successful, installing the firmware upgrade package to complete firmware upgrade. According to the method and the device, the upgrading operation is simplified, the upgrading efficiency is improved, customized upgrading of the CPLD firmware is realized, the safety of the system is enhanced through isolation debugging of the container system, and it is ensured that the verified firmware can be applied to the equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of embedded technology, and in particular to a firmware upgrade method, device, equipment and system. Background Art

[0002] In modern electronic system design, complex programmable logic devices (CPLDs) are widely used in various embedded systems due to their flexibility and efficiency. With the complexity and diversification of system functions, the need for CPLD firmware upgrades has become increasingly frequent, especially in remote application scenarios. How to achieve customized upgrades of CPLD firmware has become a key technical requirement. For end users and developers, being able to quickly and reliably customize and upgrade CPLDs can not only improve system stability, but also reduce development costs and time.

[0003] At present, the upgrade of CPLD firmware is usually done by developers writing new firmware versions and uploading the firmware to the CPLD chip through online upgrade. A common method is to use the Joint Test Action Group (JTAG) software to update the CPLD firmware online through a dedicated hardware interface. During this process, developers need to manually operate to ensure the correct upload of the firmware and the normal operation of the system.

[0004] Although the existing online upgrade method can meet the basic firmware update needs, it still has obvious shortcomings. First, when there are serious errors in the uploaded firmware version, the system may be out of control, causing the entire device to be paralyzed. Secondly, if further optimization or customized modification of the CPLD function is required in the future, the entire development cycle will be lengthened and the development cost will increase accordingly. In addition, the current technology cannot meet the needs of remote customized debugging. Users can only upgrade by sending out firmware upgrade packages and downloading specific software, which is cumbersome and inefficient. Therefore, how to customize the upgrade of CPLD firmware has become an urgent problem to be solved.

[0005] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0006] The purpose of this application is to provide a firmware upgrade method, device, equipment and system, aiming to solve the technical problem of how to customize the upgrade of CPLD firmware.

[0007] To achieve the above object, the present application proposes a firmware upgrade method, the method comprising:

[0008] Receiving a user instruction sent by a cloud server, and obtaining a firmware upgrade package according to the user instruction, wherein the firmware upgrade package is generated by a CPLD function selected by the user or a code uploaded;

[0009] Testing and debugging the firmware upgrade package to obtain a debugging result;

[0010] When the debugging result is passed, the firmware upgrade package is installed to complete the firmware upgrade.

[0011] In one embodiment, the user instruction includes user selection information;

[0012] The step of receiving a user instruction sent by a cloud server and obtaining a firmware upgrade package according to the user instruction, wherein the firmware upgrade package is generated by a CPLD function selected by a user comprises:

[0013] When the user selection information is to automatically generate a CPLD firmware package, receiving the firmware upgrade package sent by the cloud server;

[0014] When the user selection information is to upload the CPLD firmware code, the CPLD firmware code is compiled to obtain a firmware upgrade package.

[0015] In one embodiment, the step of inspecting and debugging the firmware upgrade package to obtain a debugging result includes:

[0016] Saving the firmware upgrade package to the system image;

[0017] Testing the firmware upgrade package in the system image to obtain a test result;

[0018] When the inspection result is normal, installing the firmware upgrade package in the container system;

[0019] The firmware upgrade package is debugged in the container system to obtain a debugging result.

[0020] In one embodiment, after the step of debugging the firmware upgrade package in the container system to obtain a debugging result, the step further includes:

[0021] When the inspection result is abnormal or the debugging result is not passed, the firmware upgrade package is discarded and the inspection result is sent to the cloud server.

[0022] In one embodiment, the step of debugging the firmware upgrade package in the container system to obtain a debugging result includes:

[0023] Obtaining register data of each module of the firmware upgrade package;

[0024] Sending the register data to the cloud server so that the cloud server feeds back a debugging information string;

[0025] The firmware upgrade package is debugged in the container system according to the debugging information string to obtain a debugging result.

[0026] In one embodiment, the method is applied to a cloud server, and the method includes:

[0027] Generate a user instruction according to the user operation, wherein the user instruction includes user selection information;

[0028] When the user selection information is to automatically generate a CPLD firmware package, determining the CPLD function according to the user instruction;

[0029] Generate a firmware upgrade package according to the CPLD function, and perform compilation verification to obtain a verification result;

[0030] When the verification result is correct, the firmware upgrade package is sent to the switch system.

[0031] In one embodiment, after the step of generating a user instruction according to the user operation, the method further includes:

[0032] Sending the user instruction to the switch system, so that the switch system obtains a firmware upgrade package according to the user instruction, and checks and debugs the firmware upgrade package;

[0033] Receiving register data of each module of the firmware upgrade package sent by the switch system;

[0034] Generate a debugging information string according to the register data;

[0035] Sending the debugging information string to the switch system so that the switch system debugs the firmware upgrade package according to the debugging information string;

[0036] Receive the inspection result or debugging result sent by the switch system, and display the inspection result or the debugging result to the user.

[0037] In addition, to achieve the above purpose, the present application also proposes a firmware upgrade device, the device comprising:

[0038] An acquisition module, used for receiving a user instruction sent by a cloud server, and obtaining a firmware upgrade package according to the user instruction, wherein the firmware upgrade package is generated by a CPLD function selected by a user or an uploaded code;

[0039] A debugging module, used to test and debug the firmware upgrade package to obtain a debugging result;

[0040] The upgrade module is used to install the firmware upgrade package and complete the firmware upgrade when the debugging result is passed.

[0041] In addition, to achieve the above objectives, the present application also proposes a firmware upgrade device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the firmware upgrade method described above.

[0042] In addition, to achieve the above objectives, the present application also proposes a firmware upgrade system, which includes the switch system and cloud server as described above.

[0043] One or more technical solutions proposed in this application have at least the following technical effects:

[0044] Receive user instructions sent by the cloud server, and obtain a firmware upgrade package according to the user instructions, and the firmware upgrade package is generated by the CPLD function selected by the user or the uploaded code; the firmware upgrade package is inspected and debugged to obtain the debugging result; when the debugging result is passed, the firmware upgrade package is installed to complete the firmware upgrade. The system first receives user instructions from the cloud server, and generates a firmware upgrade package according to these instructions. The firmware upgrade package can be generated based on the CPLD function module selected by the user or the code uploaded by the user, so as to meet the user's customized needs; then, the system inspects and debugs the generated firmware upgrade package, first performs basic inspection in the system image, and then performs in-depth debugging in the container system. Through these steps, the correctness and stability of the firmware are ensured, and errors and potential risks are reduced; if the debugging result passes, the system will install the firmware upgrade package into the CPLD device to complete the actual firmware upgrade. This application not only simplifies the upgrade operation, improves the upgrade efficiency, realizes customized upgrades for the CPLD firmware, but also enhances the security of the system through isolated debugging of the container system, ensuring that only verified firmware can be applied to the device. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

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

[0047] Figure 1A flowchart of a first embodiment of a firmware upgrade method for a switch system provided by the present application;

[0048] Figure 2 A flowchart of a second embodiment of a firmware upgrade method for a cloud server provided by the present application;

[0049] Figure 3 A brief flowchart of the firmware upgrade method implemented by the firmware upgrade system of this application;

[0050] Figure 4 This is a schematic diagram of the module structure of the firmware upgrade device according to an embodiment of the present application;

[0051] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the firmware upgrade method in the embodiment of the present application.

[0052] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0053] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0054] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0055] In modern electronic system design, CPLD is widely used in embedded systems due to its flexibility and efficiency. With the continuous expansion of system functions, customized upgrades of CPLD firmware have become increasingly important, especially in remote application scenarios. However, traditional CPLD firmware upgrade methods, such as online updates using JTAG software, although they can meet basic needs, have problems such as complex operation, low efficiency, and difficulty in control when firmware errors occur. This not only increases the development cycle and cost, but also limits the implementation of remote customized debugging. Therefore, developing a fast, reliable, and user-friendly CPLD firmware upgrade technology is of great significance for improving system stability and reducing development costs.

[0056] The main solution of the embodiment of the present application is: first receive user instructions from the cloud server to generate a customized firmware upgrade package, and then perform a series of checks and debugging on the upgrade package to ensure its correctness and stability. If the debugging is successful, the system will automatically install the firmware upgrade package to the CPLD device to complete the upgrade, thereby achieving efficient and reliable remote firmware updates.

[0057] It should be noted that the execution subject of the embodiment of the present application can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a switch system, a cloud server, a firmware upgrade system, etc. The following takes the switch system and the cloud server as examples to illustrate this embodiment and the following embodiments.

[0058] Based on this, the present application embodiment provides a firmware upgrade method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the firmware upgrade method applied to a switch system in the present application.

[0059] In this embodiment, the firmware upgrade method applied to the switch system includes steps S10 to S30:

[0060] Step S10, receiving a user instruction sent by the cloud server, and obtaining a firmware upgrade package according to the user instruction, wherein the firmware upgrade package is generated by a CPLD function selected by the user or an uploaded code;

[0061] It should be noted that the cloud server refers to a computing and storage platform deployed remotely, and users can access and use the resources of the platform through the Internet. In this embodiment, the cloud server is mainly responsible for receiving the user's operation instructions, processing the function options selected by the user, and generating the corresponding CPLD firmware upgrade package. The server is also responsible for communicating with the user terminal device to ensure the smooth progress of the firmware generation and debugging process. User instructions refer to operation commands issued by the user on the system interface. These commands include but are not limited to selecting a specific CPLD function module, uploading custom code, requesting to generate a firmware package, starting remote debugging, etc. The user sends these instructions to the cloud server through the HTTP interface or other control interface, and the server performs corresponding operations according to the content of the instructions. The firmware upgrade package refers to a program code package generated for the CPLD and containing specific functions. It is used to upgrade or update the internal logical configuration of the CPLD. The upgrade package can be generated based on the predefined function module selected by the user on the interface, or it can be generated after compiling the custom code uploaded by the user. After the firmware upgrade package is generated, it will be transmitted to the target device through the network to complete the upgrade operation of the CPLD. CPLD function refers to a specific logic or computing function module implemented inside the CPLD device. In this embodiment, users can select different function modules according to their needs. These modules may include but are not limited to logic operations, signal processing, interface control, etc. The cloud server will generate corresponding firmware codes according to the function modules selected by the user, and finally form a firmware upgrade package. The uploaded code refers to the program code customized by the user for implementing specific logic functions. These codes are usually written in hardware description languages ​​(such as VHDL or Verilog). Users upload them to the switch system through the system interface. After receiving these codes, the switch system compiles them to generate a CPLD firmware upgrade package for users to upgrade their devices.

[0062] It can be understood that the system receives user instructions sent by the cloud server and generates corresponding firmware upgrade packages based on these instructions. The generation of the firmware upgrade package is based on the user's selection information or uploaded code to ensure that the CPLD device can achieve the required functions or logical configurations.

[0063] As an example, the user instruction includes user selection information; the step of receiving the user instruction sent by the cloud server and obtaining a firmware upgrade package according to the user instruction, wherein the firmware upgrade package is generated by the CPLD function selected by the user or the uploaded code includes: when the user selection information is to automatically generate a CPLD firmware package, receiving the firmware upgrade package sent by the cloud server; when the user selection information is to upload the CPLD firmware code, compiling the CPLD firmware code to obtain the firmware upgrade package.

[0064] User selection information refers to the selection made by the user on the system interface, which is used to determine the method of generating the CPLD firmware upgrade package. Specifically, these selection information include two situations: one is that the user chooses to let the system automatically generate the CPLD firmware package, and the other is that the user chooses to upload the CPLD firmware code by himself. These selection information will directly affect the subsequent operation process, and determine whether the system receives the automatically generated firmware upgrade package from the cloud server, or compiles the CPLD firmware code uploaded by the user to generate the upgrade package.

[0065] In this step, the system receives user instructions, which contain the selection information made by the user on the system interface, including two specific situations: the first situation is that the user chooses to automatically generate a CPLD firmware package. At this time, the system will receive the firmware upgrade package generated by the server from the cloud server according to the selection, and prepare for subsequent upgrade operations; the second situation is that the user chooses to upload the CPLD firmware code by himself, and the system will receive the code and compile it to generate the corresponding firmware upgrade package. Through this process, whether the user chooses to automatically generate or manually upload the code, the system can generate and obtain the appropriate CPLD firmware upgrade package to ensure that the device can be correctly upgraded or updated according to the user's needs.

[0066] Step S20, inspecting and debugging the firmware upgrade package to obtain a debugging result;

[0067] It should be noted that the debugging results refer to the output information obtained after the system conducts comprehensive tests on the functionality, stability and compatibility of the generated CPLD firmware upgrade package during the debugging process. These results may include whether the firmware has successfully passed all tests, whether there are functional errors, whether the hardware compatibility meets expectations, and the performance of the system under different operating conditions. The debugging results are used to determine whether the firmware upgrade package can be safely and stably used for the final upgrade of the CPLD device.

[0068] It is understandable that in this step, the system first verifies the generated firmware upgrade package, which includes preliminary verification of the basic functions and stability of the firmware package to ensure that it can support the basic normal operation of the CPLD. Subsequently, the system enters the debugging phase, that is, in the Docker (container) debugging mode, the firmware package is tested more deeply to verify whether each functional module works as expected, and the real-time data collected during the debugging process is fed back to the customer cloud through the Message Queuing Telemetry Transport (MQTT) protocol. Through this series of inspections and debugging, the system finally obtains the debugging results, including detailed information on the firmware's operating status, functional integrity, and whether there are potential problems, which are used to determine whether the firmware can be safely applied to the actual upgrade of the CPLD device.

[0069] As an example, the steps of inspecting and debugging the firmware upgrade package and obtaining the debugging result include: saving the firmware upgrade package to a system image; inspecting the firmware upgrade package in the system image to obtain the inspection result; when the inspection result is normal, installing the firmware upgrade package in a container system; and debugging the firmware upgrade package in the container system to obtain the debugging result.

[0070] The system image refers to a lightweight independent operating environment running on the device. It is usually a copy or simplified version of the main system. In this embodiment, the system image is used to initially store and run the firmware upgrade package so as to perform basic inspections in a controlled environment to avoid affecting the main system. The inspection result refers to the feedback information obtained after the preliminary test of the firmware upgrade package in the system image, which includes whether the firmware package can be loaded normally, whether the various registers of the CPLD can be correctly accessed, and whether there are basic functional abnormalities. The inspection result is used to determine whether the firmware has the conditions for further debugging. The container system (Docker) refers to a virtualized environment running in the device, which is isolated from the main system, allowing users to perform more in-depth firmware debugging in it without affecting the normal operation of the main system. In this embodiment, the container system is used to perform detailed debugging of the firmware upgrade package that has passed the preliminary inspection, including testing the functional logic, stability and performance of the firmware, to ensure that the firmware can run safely in actual applications.

[0071] In this step, the system first saves the generated firmware upgrade package to the system image, which is an independent operating environment for safely storing and running firmware packages. Then, the firmware upgrade package is preliminarily inspected in the system image, including checking whether the basic functions of the firmware are running normally and whether the various registers of the CPLD can be correctly accessed. The inspection results are used to determine whether the firmware package meets the basic requirements. If the inspection results show that it is normal, the system will install the firmware upgrade package into the container system (i.e., the Docker environment). The container system is a virtualized environment isolated from the main system, allowing for more in-depth debugging. Finally, the system debugs the firmware upgrade package in detail in the container system to verify its functional logic, stability, and performance, and finally obtains the debugging results to confirm whether the firmware package can be safely applied in actual devices.

[0072] As an example, the firmware upgrade package is debugged in the container system, and the steps of obtaining the debugging result include: obtaining register data of each module of the firmware upgrade package; sending the register data to the cloud server so that the cloud server feeds back a debugging information string; and debugging the firmware upgrade package according to the debugging information string in the container system to obtain the debugging result.

[0073] Register data refers to the status information stored in the registers of each functional module inside the CPLD during the operation of the firmware upgrade package. These register data contain the current firmware's configuration and operation status of hardware resources, such as the status of input and output signals, the value of the counter, the setting of the logic unit, etc. The purpose of obtaining this data is to understand the behavior of the firmware in actual operation and provide a basis for further debugging. The debug information string refers to the feedback information generated by the cloud server after receiving the register data by analyzing this data. The debug information string contains the interpretation and suggestions of the register data, such as whether there is a misconfiguration, performance problem or logic conflict, and specific suggestions on how to adjust or optimize the firmware. In the container system, the debug information string is used to guide subsequent debugging work and help the system optimize the firmware upgrade package to ensure that its functions and performance meet expectations.

[0074] In this step, the system first runs the firmware upgrade package in the container system and obtains the register data of each functional module in the firmware package, which reflects the status and configuration of the firmware in actual operation. Then, the system sends these register data to the cloud server, which generates a debugging information string by analyzing these data. The debugging information string contains the analysis results and optimization suggestions for the firmware running status. Subsequently, the system further debugs and adjusts the firmware upgrade package in the container system based on the debugging information string fed back by the cloud server to correct any possible errors or optimize its performance. Finally, through this series of operations, the system obtains detailed debugging results to verify whether the firmware package can be safely and stably applied to actual devices.

[0075] As an example, after debugging the firmware upgrade package in the container system and obtaining the debugging result, it also includes: when the inspection result is abnormal or the debugging result is failed, discarding the firmware upgrade package and sending the inspection result to the cloud server.

[0076] If the system detects an anomaly in the previous system image inspection phase or finds that the debugging result of the firmware upgrade package fails after completing the debugging of the firmware upgrade package in the container system, the system will immediately discard the firmware upgrade package to ensure that it will not be applied to the actual device. Subsequently, the system will send the corresponding inspection results or debugging results to the cloud server, detailing the reasons for the anomaly or debugging failure. This feedback information will be used for further analysis and optimization to help users correct the problem and generate a more stable and reliable firmware upgrade package. In this process, the system uses strict inspection and debugging steps to ensure that qualified firmware upgrade packages can be finally used for device updates.

[0077] Step S30: When the debugging result is passed, the firmware upgrade package is installed to complete the firmware upgrade.

[0078] It is understandable that when the debugging results of the system in the container system show that the firmware upgrade package has passed all tests, indicating that the firmware's functions, stability and compatibility have reached the expected standards, the system will install this firmware upgrade package into the CPLD device for the final firmware upgrade operation. This process ensures that the firmware upgrade package can replace the old version and start running on the actual device to achieve the functional improvements or new features specified by the user. After the installation is completed, the device will use the new firmware configuration to ensure its performance optimization and correct implementation of functions.

[0079] This embodiment provides a firmware upgrade method, receiving a user instruction sent by a cloud server, and obtaining a firmware upgrade package according to the user instruction, wherein the firmware upgrade package is generated by the CPLD function selected by the user or the uploaded code; the firmware upgrade package is inspected and debugged to obtain a debugging result; when the debugging result is passed, the firmware upgrade package is installed to complete the firmware upgrade. The system first receives user instructions from the cloud server, and generates a firmware upgrade package according to these instructions. The firmware upgrade package can be generated based on the CPLD function module selected by the user or the code uploaded by the user, thereby meeting the user's customized needs; then, the system inspects and debugs the generated firmware upgrade package, first performs a basic inspection in the system image, and then performs in-depth debugging in the container system. These steps ensure the correctness and stability of the firmware, reduce errors and potential risks; if the debugging result passes, the system will install the firmware upgrade package into the CPLD device to complete the actual firmware upgrade. This embodiment not only simplifies the upgrade operation, improves the upgrade efficiency, realizes customized upgrades for the CPLD firmware, but also enhances the security of the system through isolated debugging of the container system, ensuring that only verified firmware can be applied to the device.

[0080] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 2 , Figure 2 This is a flow chart of a second embodiment of a firmware upgrade method for a cloud server of the present application. The firmware upgrade method for a cloud server includes steps S40 to S70:

[0081] Step S40, generating a user instruction according to the user operation, wherein the user instruction includes user selection information;

[0082] It should be noted that user operations refer to the specific interactive behaviors performed by users on the system interface, which may include selecting CPLD function modules, configuring options, clicking buttons, uploading code files, selecting the option to automatically generate firmware packages, etc. Users express their needs and preferences through these operations, and the system generates corresponding user instructions based on these operations for further processing and generation of corresponding firmware upgrade packages.

[0083] It is understandable that the cloud server generates corresponding user instructions by monitoring and recording the user's operations on the interface, such as selecting a specific CPLD function module, configuring parameters, clicking a button to generate a firmware package, or other interactive behaviors. The user instructions specifically include the user's selection information, which reflects the user's preferences and needs and instructs the cloud server on how to generate the firmware upgrade package. Through these user instructions, the cloud server can accurately understand and execute the user's operation intentions, ensuring that the subsequent firmware package generation process meets the user's customization requirements.

[0084] As an example, after the step of generating user instructions according to user operations, the method further includes: sending the user instructions to the switch system, so that the switch system obtains a firmware upgrade package according to the user instructions, and verifies and debugs the firmware upgrade package; receiving register data of each module of the firmware upgrade package sent by the switch system; generating a debugging information string according to the register data; sending the debugging information string to the switch system, so that the switch system debugs the firmware upgrade package according to the debugging information string; receiving the inspection result or debugging result sent by the switch system, and displaying the inspection result or the debugging result to the user.

[0085] The switch system refers to the hardware platform or device that handles the generation, inspection and debugging of the CPLD firmware upgrade package. This system is responsible for generating the firmware upgrade package according to the user's instructions and performing preliminary inspection and debugging on it. The switch system is also responsible for obtaining the register data of the firmware upgrade package and transmitting this data to the cloud server to further generate the debugging information string. After that, the switch system will perform more in-depth debugging of the firmware upgrade package based on the debugging information string, and finally obtain the inspection or debugging results, and feedback these results to the user. This system is the core execution unit of the entire firmware upgrade process, ensuring the correctness and reliability of the firmware.

[0086] The cloud server first generates corresponding user instructions according to the user's operation on the interface, and sends these instructions to the switch system. When the user selection information in the user instruction is to automatically generate a CPLD firmware package, the cloud server generates a CPLD firmware package according to the CPLD function module selected by the user in the user instruction, and then sends it to the switch system; when the user selection information in the user instruction is to upload the CPLD firmware code, after receiving the user instruction, the switch system will compile and generate the corresponding firmware upgrade package according to the code uploaded by the user. Then, the switch system performs a preliminary inspection on the generated or received firmware upgrade package to ensure that it can run normally and enter the debugging stage. During the debugging process, the switch system obtains the register data of each functional module and sends this data to the cloud server. The cloud server generates a debugging information string based on the received register data, and then sends the debugging information string back to the switch system to guide it to perform more in-depth debugging. Finally, the switch system will feedback the inspection results or debugging results to the cloud server, and the cloud server will display these results to the user, so that the user can understand the status of the firmware upgrade package, the function implementation, and whether it meets the expected requirements.

[0087] Step S50, when the user selection information is to automatically generate a CPLD firmware package, determining the CPLD function according to the user instruction;

[0088] It should be noted that CPLD function refers to the specific logic function or module configuration implemented inside the CPLD. These functions may include logical operations, signal processing, interface control, timing management, etc., depending on the user's needs and design goals. When the user chooses to automatically generate a CPLD firmware package, the cloud server will determine these specific functions that need to be implemented in the CPLD based on the selection information in the user's instructions, and generate the corresponding firmware package so that the CPLD can work according to the logic and functional configuration specified by the user.

[0089] It is understandable that when the user chooses to automatically generate a CPLD firmware package, the cloud server will determine the specific functions that need to be implemented in the CPLD based on the instruction information provided by the user. These user instructions contain the various configurations selected by the user on the system interface, such as the selected logic operation module, signal processing function, interface control options or other specific functional modules. The cloud server parses these instructions to determine which functions the user wants the CPLD to perform, and then combines these functions as the basis for firmware generation. Finally, the cloud server generates a complete firmware package based on these determined CPLD functions, enabling the CPLD to work normally according to the logic and functional configuration specified by the user.

[0090] Step S60, generating a firmware upgrade package according to the CPLD function, and performing compile verification to obtain a verification result;

[0091] It should be noted that the verification result refers to the output information during the compilation and verification process after the firmware upgrade package is generated. Specifically, the verification result includes whether there are errors in the compilation process of the firmware package, whether the generated firmware meets the expected logical configuration, whether the code is correct, and whether the firmware package can be loaded and run correctly. It is used to judge the integrity and reliability of the firmware upgrade package to ensure that it can work normally on the CPLD device.

[0092] It is understandable that the cloud server generates the corresponding firmware upgrade package based on the previously determined CPLD functions. This process involves compiling the user-specified logic functions, signal processing modules, and other configurations into executable code suitable for the CPLD. After the firmware upgrade package is generated, the cloud server will compile and verify it, which includes checking whether the code is compiled correctly, whether the functional logic is as expected, and whether the firmware package is complete and correct. The purpose of the verification is to ensure that the firmware can work properly when it is actually deployed, and to avoid operational problems caused by compilation errors or functional defects.

[0093] Step S70: When the verification result is correct, the firmware upgrade package is sent to the switch system.

[0094] When the results of the compilation and verification process show that the firmware upgrade package does not have any errors or problems, the cloud server will send the firmware upgrade package to the switch system. This step ensures that only verified and fully functional firmware packages are transmitted to the switch system for further inspection, debugging and final device upgrades. The execution of this step means that the firmware upgrade package has passed all preliminary tests and has the conditions for normal operation in the CPLD device. It will then be received and processed by the switch system for more in-depth debugging and application.

[0095] In this embodiment, a user instruction is generated according to the user operation, and the user instruction includes user selection information; when the user selection information is to automatically generate a CPLD firmware package, the CPLD function is determined according to the user instruction; a firmware upgrade package is generated according to the CPLD function, and a compilation verification is performed to obtain a verification result; when the verification result is correct, the firmware upgrade package is sent to the switch system. First, the corresponding user instructions are generated according to the user operation on the interface. These instructions include the information selected by the user and are used to guide the firmware generation process. This step ensures that user needs can be accurately captured and the customization capability is improved. When the user chooses to automatically generate a CPLD firmware package, the cloud server determines the specific CPLD function module, such as logical operation, signal processing, etc., according to the user instruction, which enables the cloud server to flexibly adapt to the needs of different users. Subsequently, the cloud server generates a firmware upgrade package according to the determined CPLD function, and compiles and verifies it to ensure the correctness and functional integrity of the firmware package. This process helps to eliminate potential errors in advance and ensure the reliability of the firmware. Finally, when the verification result is correct, the cloud server sends the firmware upgrade package to the switch system for further processing. This link ensures that only verified firmware packages can enter actual applications, enhancing the security and stability of the system.

[0096] For example, in order to help understand the implementation process of the firmware upgrade method obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Figure 3 , Figure 3 A brief flowchart of a firmware upgrade method is provided, specifically:

[0097] The figure shows a CPLD firmware customization upgrade process, covering the key steps from hardware function confirmation, self-test, network configuration, remote debugging to the final firmware upgrade. The user first confirms the required hardware function through the HTTP interface, and then the system can reconstruct the CPLD firmware version based on the debugging information. After confirming that the debugging mode is turned on, the CPLD hardware will perform a self-test to verify the functions of each module. Next, the CPU and on-chip RAM are initialized, and the network module is configured to ensure that the system can connect to the independent MQTT cloud network for remote operation. After the user logs in through the website, he can choose whether to upgrade and debug the hardware information. If you choose to upgrade, the system will self-check the firmware package to ensure that it can start normally. Once confirmed, the system starts the firmware package image for inspection and testing or starts the original firmware package to enter dockers mode. In dockers mode, the system will detect and debug the hardware-related register data information to ensure the function and stability of the firmware package. If the debugging passes, the CPLD firmware can be burned to the firmware version and the system can be guided to upgrade. After the upgrade is successful, the system will start normally, completing the entire customized upgrade process. This process not only improves the flexibility and efficiency of upgrades, but also greatly reduces development cycles and costs through remote debugging and real-time feedback, while enhancing system stability and security.

[0098] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the firmware upgrade method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0099] This application also provides a firmware upgrade device, please refer to Figure 4 , the firmware upgrade device comprises:

[0100] The acquisition module 10 is used to receive a user instruction sent by the cloud server, and obtain a firmware upgrade package according to the user instruction, wherein the firmware upgrade package is generated by a CPLD function selected by the user or an uploaded code;

[0101] The debugging module 20 is used to test and debug the firmware upgrade package to obtain a debugging result;

[0102] The upgrade module 30 is used to install the firmware upgrade package and complete the firmware upgrade when the debugging result is passed.

[0103] The firmware upgrade device provided by the present application adopts the firmware upgrade method in the above embodiment, which can solve the technical problem of how to perform customized upgrades on the CPLD firmware. Compared with the prior art, the beneficial effects of the firmware upgrade device provided by the present application are the same as the beneficial effects of the firmware upgrade method provided by the above embodiment, and other technical features in the firmware upgrade device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0104] The present application provides a firmware upgrade device, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the firmware upgrade method in the above-mentioned embodiment one.

[0105] Reference below Figure 5 , which shows a schematic diagram of the structure of a firmware upgrade device suitable for implementing the embodiments of the present application. The firmware upgrade device in the embodiments of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The firmware upgrade device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0106] like Figure 5As shown, the firmware upgrade device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the firmware upgrade device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the firmware upgrade device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a firmware upgrade device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.

[0107] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0108] The firmware upgrade device provided by the present application adopts the firmware upgrade method in the above embodiment to solve the technical problem of how to customize the upgrade of the CPLD firmware. Compared with the prior art, the beneficial effects of the firmware upgrade device provided by the present application are the same as the beneficial effects of the firmware upgrade method provided by the above embodiment, and the other technical features in the firmware upgrade device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0109] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0110] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0111] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the firmware upgrade method in the above-mentioned embodiment.

[0112] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0113] The computer-readable storage medium may be included in the firmware upgrade device; or may exist independently without being assembled into the firmware upgrade device.

[0114] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the firmware upgrade device, the firmware upgrade device: receives a user instruction sent by a cloud server, and obtains a firmware upgrade package according to the user instruction, wherein the firmware upgrade package is generated by a CPLD function selected by the user or an uploaded code; checks and debugs the firmware upgrade package to obtain a debugging result; and when the debugging result is passed, installs the firmware upgrade package to complete the firmware upgrade.

[0115] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may 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 may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0116] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0117] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0118] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned firmware upgrade method, and can solve the technical problem of how to perform customized upgrades on the CPLD firmware. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the firmware upgrade method provided by the above-mentioned embodiment, and will not be described in detail here.

[0119] The present application also provides a firmware upgrade system, which includes the switch system and cloud server as described above, and the system implements the steps of the firmware upgrade method as described above.

[0120] The firmware upgrade system provided by the present application can solve the technical problem of how to customize the upgrade of CPLD firmware. Compared with the prior art, the beneficial effects of the firmware upgrade system provided by the present application are the same as the beneficial effects of the firmware upgrade method provided by the above embodiment, which will not be repeated here.

[0121] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned firmware upgrade method when executed by a processor.

[0122] The computer program product provided by this application can solve the technical problem of how to customize and upgrade the CPLD firmware. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the firmware upgrade method provided by the above embodiment, which will not be repeated here.

[0123] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A firmware upgrade method, characterized in that: The method is applied to a switch system, and the method comprises: Receiving a user instruction sent by a cloud server, and obtaining a firmware upgrade package according to the user instruction, wherein the firmware upgrade package is generated by a CPLD function selected by the user or a code uploaded; Testing and debugging the firmware upgrade package to obtain a debugging result; When the debugging result is passed, the firmware upgrade package is installed to complete the firmware upgrade.

2. The method according to claim 1, characterized in that The user instruction includes user selection information; The step of receiving a user instruction sent by a cloud server and obtaining a firmware upgrade package according to the user instruction, wherein the firmware upgrade package is generated by a CPLD function selected by a user or an uploaded code comprises: When the user selection information is to automatically generate a CPLD firmware package, receiving the firmware upgrade package sent by the cloud server; When the user selection information is to upload the CPLD firmware code, the CPLD firmware code is compiled to obtain a firmware upgrade package.

3. The method according to claim 1, characterized in that The step of inspecting and debugging the firmware upgrade package to obtain a debugging result comprises: Saving the firmware upgrade package to the system image; Testing the firmware upgrade package in the system image to obtain a test result; When the inspection result is normal, installing the firmware upgrade package in the container system; The firmware upgrade package is debugged in the container system to obtain a debugging result.

4. The method according to claim 3, characterized in that After the step of debugging the firmware upgrade package in the container system to obtain a debugging result, the method further includes: When the inspection result is abnormal or the debugging result is not passed, the firmware upgrade package is discarded and the inspection result is sent to the cloud server.

5. The method according to claim 1, characterized in that The step of debugging the firmware upgrade package in the container system to obtain a debugging result includes: Obtaining register data of each module of the firmware upgrade package; Sending the register data to the cloud server so that the cloud server feeds back a debugging information string; The firmware upgrade package is debugged in the container system according to the debugging information string to obtain a debugging result.

6. A firmware upgrade method, characterized in that: The method is applied to a cloud server, and the method includes: Generate a user instruction according to the user operation, wherein the user instruction includes user selection information; When the user selection information is to automatically generate a CPLD firmware package, determining the CPLD function according to the user instruction; Generate a firmware upgrade package according to the CPLD function, and perform compilation verification to obtain a verification result; When the verification result is correct, the firmware upgrade package is sent to the switch system.

7. The method according to claim 6, characterized in that After the step of generating a user instruction according to the user operation, the method further includes: Sending the user instruction to the switch system, so that the switch system obtains a firmware upgrade package according to the user instruction, and checks and debugs the firmware upgrade package; Receiving register data of each module of the firmware upgrade package sent by the switch system; Generate a debugging information string according to the register data; Sending the debugging information string to the switch system so that the switch system debugs the firmware upgrade package according to the debugging information string; Receive the inspection result or debugging result sent by the switch system, and display the inspection result or the debugging result to the user.

8. A firmware upgrade device, characterized in that: The firmware upgrade device is applied to a switch system, and the device comprises: An acquisition module, used for receiving a user instruction sent by a cloud server, and obtaining a firmware upgrade package according to the user instruction, wherein the firmware upgrade package is generated by a CPLD function selected by a user or an uploaded code; A debugging module, used to test and debug the firmware upgrade package to obtain a debugging result; The upgrade module is used to install the firmware upgrade package and complete the firmware upgrade when the debugging result is passed.

9. A firmware upgrade device, characterized in that: The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program on the switch system is configured to implement the steps of the firmware upgrade method according to any one of claims 1 to 5, and the computer program on the cloud server is configured to implement the steps of the firmware upgrade method according to any one of claims 6 to 7.

10. A firmware upgrade system, characterized in that: The system comprises the switch system as described in any one of claims 1 to 5 and the cloud server as described in any one of claims 6 to 7.