WO2023151372A1 - 模块升级方法和*** - Google Patents
模块升级方法和*** Download PDFInfo
- Publication number
- WO2023151372A1 WO2023151372A1 PCT/CN2022/138272 CN2022138272W WO2023151372A1 WO 2023151372 A1 WO2023151372 A1 WO 2023151372A1 CN 2022138272 W CN2022138272 W CN 2022138272W WO 2023151372 A1 WO2023151372 A1 WO 2023151372A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- upgrade
- module
- auxiliary
- control protocol
- transmission control
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
- H04L41/0813—Configuration setting characterised by the conditions triggering a change of settings
- H04L41/082—Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/08—Error detection or correction by redundancy in data representation, e.g. by using checking codes
- G06F11/10—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
- G06F11/1004—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
Definitions
- the present application relates to the field of firmware upgrade technology, in particular to a module upgrade method and system.
- the traditional upgrade method is to rely on Download_Linux, Fh_Loader, FHLoaderErase.xml, Parameters.ini, and QSaharaServer files to upgrade the module firmware through the Download Tool tool, and there is a problem that the upgrade process is complicated. .
- a module upgrading method and system capable of simplifying the upgrading process are provided.
- the present application provides a module upgrade method, which is applied to a host computer configured with a first upgrade program in a module upgrade system; the module upgrade system also includes a module connected to the host computer, and a module connected to the host computer and already Configure the auxiliary upgrade device of the second upgrade program; the method includes:
- Execute the first upgrade command included in the first upgrade program obtain the upgrade position corresponding to the module, and output a switching instruction; the switching instruction is used to instruct the module to switch to the upgrade mode;
- a server component is created, and a connection is established with the auxiliary upgrade device through the server component and the client component of the auxiliary upgrade device, so as to transmit the firmware upgrade package from the auxiliary upgrade device to the upgrade mode
- the upgrade of the module is completed; the client component is created after the second upgrade command included in the second upgrade program is executed by the auxiliary upgrade device; the second upgrade command includes the address information of the upper computer.
- the first upgrade program and the second upgrade program belong to the same upgrade tool; the method also includes:
- the upgrade parameters include a first parameter for indicating upgrade package information
- the upgrade tool is imported to complete the configuration of the first upgrade program.
- the first upgrade command included in the first upgrade program is executed, and the step of obtaining the upgrade location corresponding to the module includes:
- the firmware upgrade port is determined as the upgrade location
- the upgrade location is found in the local device directory according to the identification of the module; the identification includes a supplier identification code and a product identification code.
- the switching instruction is used to instruct the module to switch from the normal mode to the upgrade mode;
- the address information of the upper computer includes the IP address of the upper computer;
- the server component includes a transmission control protocol server process, and the transmission control protocol server process is based on The main function of the transmission control protocol is obtained by calling the host computer to establish a server socket locally;
- the client component includes the transmission control protocol client process, and the transmission control protocol client process is based on the main function of the transmission control protocol. Create a client socket locally to get;
- the steps of establishing a connection with the assisted upgrade device include:
- connection request establish a transmission control protocol-based communication connection with the auxiliary upgrade device, and print a log for expressing the successful establishment of the connection;
- Methods also include:
- the present application also provides a module upgrade method, which is applied to the auxiliary upgrade device configured with the second upgrade program in the module upgrade system;
- the module upgrade system also includes connecting the auxiliary upgrade device and configured with the first upgrade The host computer of the program, and the module connected to the host computer; the methods include:
- the server component is the host computer that confirms that the module responds to the switch command to switch to the upgrade mode Created under the circumstances;
- the switch command is output when the upgrade position corresponding to the module is obtained after the first upgrade command contained in the first upgrade program is executed by the host computer.
- the first upgrade program and the second upgrade program belong to the same upgrade tool; the method also includes:
- the upgrade parameters include a first parameter for indicating upgrade package information
- the upgrade tool is imported to complete the configuration of the second upgrade program.
- the upgrade package information includes the upgrade package version name and the upgrade package compression format; the method also includes:
- the verification file includes MD5 files
- the address information of the upper computer includes the IP address of the upper computer;
- the server component includes a transmission control protocol server process, and the transmission control protocol server process is a main function based on transmission control protocol called by the upper computer to establish locally
- the server socket is obtained;
- the client component includes the transmission control protocol client process, and the transmission control protocol client process is obtained by calling the main function based on the transmission control protocol to establish the client socket locally through the auxiliary upgrade device;
- the steps to establish a connection with the host computer include:
- Run the transmission control protocol client process and output a connection request according to the IP address;
- the connection request is used to indicate that the upper computer that has entered the waiting state by running the transmission control protocol server process establishes a communication connection based on the transmission control protocol;
- Methods also include:
- the application also provides a module upgrade system, the system includes a module, a host computer configured with the first upgrade program, and an auxiliary upgrade device configured with the second upgrade program; the host computer is respectively connected with the auxiliary upgrade device, the module ;in:
- the host computer is used to realize the steps of the above-mentioned method
- the auxiliary upgrade device is used to implement the steps of the above method.
- the host computer includes an embedded device;
- the auxiliary upgrade device includes a computer device that the embedded device has Pinged;
- the module includes a communication module, and the communication module is connected to the embedded device.
- Fig. 1 is an application environment diagram of the module upgrading method in an embodiment
- Fig. 2 is a schematic flow diagram of a module upgrading method implemented from the perspective of a host computer in one embodiment
- FIG. 3 is a schematic flow diagram of configuring the first upgrade program steps in one embodiment
- Fig. 4 is a schematic flowchart of the steps of establishing a connection with an auxiliary upgrade device in an embodiment
- FIG. 5 is a schematic flow diagram of a module upgrading method implemented from the perspective of an auxiliary upgrading device in one embodiment
- Figure 6 is a schematic flow diagram of configuring the second upgrade program steps in one embodiment
- Fig. 7 is a structural block diagram of a module upgrading device implemented from the perspective of a host computer in an embodiment
- Fig. 8 is a structural block diagram of a module upgrading device implemented from the perspective of auxiliary upgrading equipment in one embodiment
- Fig. 9 is an internal structure diagram of the module upgrading system in one embodiment.
- connection in the following embodiments should be understood as “electrical connection”, “communication connection” and the like if there is transmission of electrical signals or data between the connected objects.
- the traditional upgrade method of the module under the Linux platform the memory space on the Host side to which the module is connected is too small to upgrade the module.
- the traditional upgrade method relies on too many files, and five files are required to perform the upgrade. In particular, some files need to be manually modified during the upgrade process, resulting in an uncontrollable upgrade process.
- This application proposes a module upgrade solution to solve the insufficient memory space of the upper computer, which can solve the firmware upgrade of the module in the scenario where the host side memory space of the connected module (module) cannot store the module firmware package.
- the upgrade tool (Upgrade_Tool) of this application can provide the -p parameter, which can complete the remote upgrade, so that the user can use the function of remote upgrade to solve the upper
- the computer device cannot store the firmware upgrade package of the module.
- the upgrade tool of the present application has a simple upgrade process, requires few files, is convenient and easy to operate, and does not need to modify any files during the upgrade process. For the user, the controllability in the upgrade process is guaranteed, and the user is prevented from making mistakes in modifying files during the upgrade process, resulting in upgrade failure.
- the first upgrade program is configured in the upper computer
- the second upgrade program is configured in the auxiliary upgrade device
- the upgrade program can provide corresponding parameters and commands to realize the transmission of the module firmware upgrade package and complete the module upgrade .
- the embodiment of the present application can deal with the situation that the memory space of the upper computer is insufficient.
- the module upgrade method provided in the embodiment of the present application can be applied to the application environment shown in FIG. 1 .
- the module 102 is connected to an auxiliary upgrading device 106 through a host computer 104 .
- the module 102 can be connected to the host computer 104 through a corresponding interface, the host computer 104 and the auxiliary upgrade device 106 can be connected to each other, and the firmware upgrade package of the module 102 can be stored on the auxiliary upgrade device 106 .
- the module 102, the host computer 104 and the auxiliary upgrade device 106 can jointly build a module upgrade system for upgrading the module 102; on the basis of supporting the basic local upgrade function, the module upgrade system can also realize remote Upgraded features.
- the module 102 in this application can refer to a communication module, for example, a wireless communication module based on Qualcomm platform; in some examples, the communication module in this application can be 5G (5th Generation Mobile Communication Technology, The fifth-generation mobile communication technology) communication module supports two network architectures of 5G independent networking (SA, Standalone) and non-independent networking (NSA, Non-Standalone).
- the host computer 104 includes, but is not limited to, an embedded device.
- Auxiliary upgrade device 106 can be but not limited to computer equipment such as various notebook computers, tablet computers, and in some examples, auxiliary upgrade device 106 can be a Linux notebook computer, for example, kernel version is 3.X/4.X/5. X Linux system laptop. Ping (Packet Internet Groper, Internet packet explorer) can be communicated between the laptop and the embedded device.
- the module 102 is connected with the auxiliary upgrading device 106, and the module 102 in the embodiment of the present application can be independent of the auxiliary upgrading device 106; taking the auxiliary upgrading device 106 as an embedded device as an example, the module 102 can pass USB (Universal Serial Bus , Universal Serial Bus) is connected to the embedded device, and the module 102 can also be connected to the embedded device through PCIe (Peripheral Component Interconnect express, high-speed serial computer expansion bus standard), and the module 102 can also be directly inserted into the embedded device;
- PCIe Peripheral Component Interconnect express, high-speed serial computer expansion bus standard
- the embodiment of the application does not limit the connection relationship between the module 102 and the auxiliary upgrade device 106 .
- the embedded device and the Linux laptop can ping each other, and the module's firmware upgrade package and MD5 (Message-Digest Algorithm 5, message digest algorithm 5) files are stored on the Linux laptop.
- MD5 Message-Digest Algorithm 5, message digest
- GSM Global System of Mobile Communication
- LTE Long Term Evolution
- FDD Frequency Division Duplex
- TDD Time Division Duplex
- LTE-Advanced LTE-A
- next-generation communications For example, 6G communication
- a module upgrade method is provided, and the method is applied to the host computer in Figure 1 as an example for illustration, the host computer has been configured with the first upgrade program;
- the module upgrade system also includes a module connected to the host computer, and an auxiliary upgrade device connected to the host computer and configured with a second upgrade program.
- the method includes the following steps:
- Step 202 execute the first upgrade command included in the first upgrade program, obtain the upgrade position corresponding to the module, and output a switching instruction;
- the switch command is used to instruct the module to switch to the upgrade mode.
- the host computer has been configured with a first upgrade program, and the upgrade program can provide corresponding parameters and commands to enable the host computer to complete a corresponding upgrade process.
- the first upgrade program includes a first upgrade command. After the host computer executes the first upgrade command, it can obtain the corresponding upgrade position of the module and output a switching command.
- the upgrade program (the first upgrade program, the second upgrade program) in this application can be that the upgrade tool is imported into the host computer or auxiliary upgrade equipment to obtain; the upgrade command (the first upgrade command, the second upgrade command) in this application can be the parameters in the tool.
- the first upgrade command can be a parameter executed on the connection side of the upgrade tool used to upgrade the module; the second upgrade command can be used in the upgrade tool to perform a parameter on the source side of the firmware upgrade package of the upgrade module to establish a connection with the module connection side .
- the upgrade command can be the -p parameter in the upgrade tool.
- the upgrade tool may be Upgrade_Tool, which can be used to upgrade modules in Linux environment and Android environment.
- the Upgrade_Tool tool in this application may have the following parameters (upgrade parameters), and the meanings represented by the parameters are shown in the following table - Table 1:
- the auxiliary upgrade device takes the auxiliary upgrade device to execute "./upgrade_tool–f./89610.1000.00.01.01.04.7z–p ip:9008" as an example.
- the "-f" parameter is used for firmware upgrade package information ( upgrade package name and/or upgrade package version name, and upgrade package compression format, etc.), for example, the "-f” parameter can be in the form of -f./x.7z, and the upgrade package name can be 89610.1000.00.01.01.04.7z ;
- "-p” parameter is used for specifying IP (Internet Protocol, Internet interconnection protocol) address and port number, ip among the application: 9008, and this ip is embedded device end IP.
- the first upgrade program and the second upgrade program belong to the same upgrade tool; as shown in Figure 3, the method also includes:
- Step 302 analyzing the parameters of the acquired upgrade tool to obtain the upgrade parameters; the upgrade parameters include the first parameter used to indicate the upgrade package information;
- Step 304 in the case that the upgrade parameter does not include the second upgrade command, import the upgrade tool to complete the configuration of the first upgrade program.
- the host computer in this application can obtain the corresponding upgrade program by importing the upgrade tool Upgrade_Tool.
- the first upgrade program and the second upgrade program in this application belong to the same upgrade tool, Upgrade_Tool, which can optimize the entire code framework, and only one executable file, Upgrade_Tool, is needed for compilation and generation, which solves the complicated upgrade process of the old upgrade tool. question.
- the upper computer can analyze the upgrade tool Upgrade_Tool to obtain the parameters (upgrade parameters) in the upgrade tool; in some examples, the parameter types and meanings of the upgrade parameters can be referred to Table 1, namely Taking Table 1 as an example to illustrate the upgrade parameters in this application, the first upgrade command in this application may refer to "-p ⁇ 9008>", and the second upgrade command may refer to "-p ⁇ ip:9008>".
- the first parameter can refer to "-f ⁇ firmware package file name>", and the second parameter can refer to "-p ⁇ dev/ttyUSBx>"; in addition, the Upgrade_Tool upgrade tool of this application can also include the first Three parameters, the upgrade method can be full wipe upgrade, that is, the third parameter can refer to "-e”.
- the basic usage of the Upgrade_Tool upgrade tool is "./upgrade_tool –f./[fireware package file name]", which supports the remote upgrade function on the basis of local upgrade. That is, no matter whether the host computer or the auxiliary upgrade device is imported into the Upgrade_Tool, the upgrade parameters in this application must include the first parameter used to indicate the upgrade package information (the Upgrade_Tool supports basic local upgrade functions).
- the host computer can import the upgrade tool to complete the configuration of the first upgrade program; If there is no second upgrade command "-p ⁇ ip:9008>" in the result (that is, the upgrade parameters), it is confirmed that the local device currently importing the upgrade tool Upgrade_Tool is a host computer, and the host computer can be based on the first parameter "-f ⁇ firmware package file name>", execute the first upgrade command "-p ⁇ 9008>".
- Another example is to analyze the parameters of the Upgrade_Tool upgrade tool.
- the second upgrade command "-p ⁇ ip:9008>” exists in the parameter analysis result (that is, the upgrade parameters)
- the auxiliary upgrade device can execute the second upgrade command "-p ⁇ ip:9008>” based on the first parameter "-f ⁇ firmware package file name>”.
- this application uses the -p parameter and different commands (Upgrade_Tool is an execution file), the upgrade process is simple, the required files are few, convenient and easy to operate, and no files need to be modified during the upgrade process. For the user, the controllability in the upgrade process is guaranteed, and the user is prevented from making mistakes in modifying files during the upgrade process, resulting in upgrade failure.
- Upgrade_Tool is an execution file
- the host computer After the host computer executes the first upgrade command, it can initialize the upgrade progress, obtain the upgrade position corresponding to the module, and send a command (switch command) to switch the module to the upgrade module mode, that is, the switch command is used to instruct the module to switch to the upgrade mode.
- switch command a command to switch the module to the upgrade module mode
- the first upgrade command included in the first upgrade program is executed, and the step of obtaining the upgrade location corresponding to the module includes:
- the firmware upgrade port is determined as the upgrade location
- the upgrade location is found in the local device directory according to the identification of the module; the identification includes a supplier identification code and a product identification code.
- the host computer can enter the local device directory /sys/bus/ Under usb/devices (system/bus/USB/device), find the location of the module according to the VID (Vendor ID, vendor identification code) and PID (Product ID, product identification code) of the module.
- VID Vehicle ID, vendor identification code
- PID Product ID, product identification code
- the upper computer is connected to the module through USB and Table 1 as an example.
- the host computer After the host computer obtains the module upgrade location, it will output a switch command; the switch command is used to instruct the module to enter the upgrade mode switch_to_edl_mode.
- the upper computer receives the switching success message fed back by the module in response to the switching command, it can create the server component. After the module enters the upgrade mode, you can also determine whether the usb2tcp_port is 9008 again.
- the switching instruction is used to instruct the module to switch from normal mode to upgrade mode. After the first upgrade command is executed, when the upgrade location of the module is found, a command can be sent to switch the module from the normal mode to the upgrade mode.
- Step 204 when it is confirmed that the module is switched to the upgrade mode, then create a server component, and establish a connection with the auxiliary upgrade device through the server component and the client component of the auxiliary upgrade device, so as to transmit the firmware upgrade package from the auxiliary upgrade device to the Modules in upgrade mode complete the upgrade;
- the client component is created after the second upgrade command included in the second upgrade program is executed by the auxiliary upgrade device; the second upgrade command includes the address information of the upper computer.
- the upper computer can create a server component to establish a connection with the auxiliary upgrade device, so as to transmit the firmware upgrade package from the auxiliary upgrade device to the module in the upgrade mode to complete the upgrade.
- the upper computer and the auxiliary upgrade device are connected by TCP (Transmission Control Protocol) as an example.
- the upper computer acts as a TCP Server and waits for the connection of the auxiliary upgrade device, and the auxiliary upgrade device acts as a TCP Client to establish a connection with the upper computer.
- this application realizes the remote upgrade function. Specifically, through the -p parameter and different commands, the connection establishment between the upper computer TCP Server and the auxiliary upgrade device TCP Client is realized.
- the address information of the upper computer includes the IP address of the upper computer;
- the server component includes a transmission control protocol server process, and the transmission control protocol server process is a main function based on transmission control protocol called by the upper computer to establish locally
- the server socket is obtained;
- the client component includes the transmission control protocol client process, and the transmission control protocol client process is obtained by calling the main function based on the transmission control protocol to establish the client socket locally through the auxiliary upgrade device;
- the steps of establishing a connection with the auxiliary upgrading device include:
- Step 402 running the transmission control protocol server process, entering a waiting state until receiving a connection request from the auxiliary upgrading device; the connection request is obtained by processing the IP address of the auxiliary upgrading device running the transmission control protocol client process;
- Step 404 according to the connection request, establish a transmission control protocol-based communication connection with the auxiliary upgrade device, and print a log for expressing the successful establishment of the connection;
- the host computer can execute usb2tcp_main (main function based on transmission control protocol), create a Tcp Server (TCP server), and wait for the Client connection (wait_client_connect).
- the upper computer can establish a server socket (Socket Server) locally.
- the host computer can print a log to indicate that the connection is established successfully.
- the method also includes:
- the application can check whether the status of the module is normal after the upgrade is completed.
- the above module upgrade method realizes the remote upgrade function on the basis of supporting the basic local upgrade function.
- the connection between the Socket Server and the Socket Client is established, and the remote transmission of the upgrade package is completed to solve the problem of insufficient memory space on the device connected to the module.
- the entire code framework is optimized, and the file required for compilation and generation is only an executable file, Upgrade_Tool (upgrade tool), which solves the problem of the complicated upgrade process of the old upgrade tool.
- the embodiment of the present application also provides a module upgrade method implemented from the perspective of an auxiliary upgrade device.
- the solution to the problem provided by this method is similar to the implementation described in the above-mentioned method implemented from the perspective of the host computer, so the specific limitations in one or more embodiments of the module upgrade method provided below can be referred to above for The limitation of the method implemented from the perspective of the host computer will not be repeated here.
- a method for upgrading a module is provided.
- the method is applied to the auxiliary upgrading device in FIG. 1 as an example.
- the second upgrading program has been configured for the auxiliary upgrading device;
- the module upgrade system to which the device belongs also includes connecting auxiliary upgrade equipment, a host computer configured with the first upgrade program, and a module connected to the host computer; the method includes the following steps:
- Step 502 execute the second upgrade command contained in the second upgrade program, and create the client component according to the address information of the upper computer contained in the second upgrade command;
- the auxiliary upgrading device has been configured with a second upgrading program, and the upgrading program can provide corresponding parameters and commands, so that the auxiliary upgrading device completes a corresponding upgrading process.
- the second upgrade program includes a second upgrade command, and after the auxiliary upgrade device executes the second upgrade command, it can create a client component according to the address information of the upper computer included in the second upgrade command.
- the first upgrade program and the second upgrade program belong to the same upgrade tool; as shown in Figure 6, the method may also include:
- Step 602 analyzing the parameters of the acquired upgrade tool to obtain upgrade parameters; the upgrade parameters include the first parameter used to indicate the upgrade package information;
- Step 604 if the upgrade parameters include the second upgrade command, import the upgrade tool to complete the configuration of the second upgrade program.
- the auxiliary upgrade device in this application can obtain the corresponding upgrade program by importing the upgrade tool Upgrade_Tool.
- the first upgrade program and the second upgrade program in this application belong to the same upgrade tool, Upgrade_Tool, which can optimize the entire code framework, and only one executable file, Upgrade_Tool, is needed for compilation and generation, which solves the complicated upgrade process of the old upgrade tool. question.
- the auxiliary upgraded device can import the upgraded tool to complete the configuration of the second upgraded program; If there is a second upgrade command "-p ⁇ ip:9008>" in the result (that is, the upgrade parameters), it is confirmed that the local device imported into the upgrade tool Upgrade_Tool is an auxiliary upgrade device, and the auxiliary upgrade device can be based on the first parameter "-f ⁇ firmware package file name>", execute the second upgrade command "-p ⁇ ip:9008>".
- the upgrade package information includes the upgrade package version name and the upgrade package compression format; the method also includes:
- the verification file includes MD5 files
- the firmware upgrade package, verification file and Upgrade_Tool of the module can be copied to the same directory on the auxiliary upgrade device.
- the verification file may refer to an MD5 (Message-Digest Algorithm 5, message digest algorithm 5) file. That is, the auxiliary upgrade device stores the firmware upgrade package and MD5 file of the module.
- the auxiliary upgrade device can execute "-f./x.7z -p ip:9008", specifically "./upgrade_tool –f./89610.1000.00.01.01.04.7z –p ip:9008".
- the "-f” parameter is used to specify the firmware upgrade package version name, here the upgrade package name is 89610.1000.00.01.01.04.7z;
- the "-p” parameter is used to specify the IP address and port number, here is ip: 9008, ip can be the ip of the upper computer (for example, embedded device).
- the auxiliary upgrade device After executing the above upgrade command, the auxiliary upgrade device checks the upgrade path based on the upgrade package version name, and checks the MD5 file (file signature of message digest algorithm 5, used to ensure the correctness of the file), and checks whether the upgrade file is a 7z compressed package ; Among them, the auxiliary upgrade device can print the corresponding log, start the MD5 file verification, and decompress the 7z compressed package. Further, after the above process, proceed to the Tcp_Connect (TCP connection) stage to establish a connection with the host computer.
- Tcp_Connect TCP connection
- Step 504 establish a connection with the host computer through the client component and the server component of the host computer, so as to transmit the firmware upgrade package to the module in the upgrade mode to complete the upgrade; the server component is the host computer. Created in the upgrade mode; the switching command is output when the upgrade position corresponding to the module is obtained after the first upgrade command included in the first upgrade program is executed by the host computer.
- the auxiliary upgrade device can establish a client socket (Socket Client) locally.
- the address information of the upper computer includes the IP address of the upper computer;
- the server component includes a transmission control protocol server process, and the transmission control protocol server process is a main function based on transmission control protocol called by the upper computer to establish locally
- the server socket is obtained;
- the client component includes the transmission control protocol client process, and the transmission control protocol client process is obtained by calling the auxiliary upgrade device to establish the client socket locally through the main function of the transmission control protocol;
- the steps to establish a connection with the host computer include:
- Run the transmission control protocol client process and output a connection request according to the IP address;
- the connection request is used to indicate that the upper computer that has entered the waiting state by running the transmission control protocol server process establishes a communication connection based on the transmission control protocol;
- Methods also include:
- auxiliary upgrade device connection After the auxiliary upgrade device connection is successfully established, you can execute read(fd,&tlv_usb,sizeof(tlv_usb)), for example, complete sahara_main, and transfer the files in the firmware package through firehose_main, for example, send each file to the module middle. After the sending is completed, the log can be printed to indicate that the upgrade is successful.
- the above module upgrade method realizes the remote upgrade function on the basis of supporting the basic local upgrade function.
- the connection between the Socket Server and the Socket Client is established, and the remote transmission of the upgrade package is completed to solve the problem of insufficient memory space on the device connected to the module.
- the entire code framework is optimized, and the file required for compilation and generation is only an executable file, Upgrade_Tool (upgrade tool), which solves the problem of the complicated upgrade process of the old upgrade tool.
- the embodiment of the present application also provides a module upgrading method implemented from the perspective of a module upgrading system.
- the solution to the problem provided by this method is similar to the implementation described in the above-mentioned method implemented from the perspective of the host computer and auxiliary upgrade equipment, so the specific limitations in one or more embodiments of the module upgrade method provided below can be Please refer to the limitations of the method implemented from the perspective of the host computer and the auxiliary upgrade device above, and details will not be repeated here.
- a module upgrade method is provided, and the method is applied to the module upgrade system shown in FIG. 1 as an example for illustration.
- the module upgrade system includes an auxiliary upgrade device, a host computer, and a module connected to the host computer;
- the host computer has been configured with a first upgrade program, and the auxiliary upgrade device has been configured with a second upgrade program.
- the method includes the following steps:
- the upper computer executes the first upgrade command contained in the first upgrade program, obtains the corresponding upgrade position of the module, and outputs a switch command; the switch command is used to instruct the module to switch to the upgrade mode; when the host computer confirms that the module is switched to the upgrade mode, it creates a service terminal components;
- the auxiliary upgrade device executes the second upgrade command contained in the second upgrade program, and creates a client component according to the address information of the upper computer contained in the second upgrade command; the auxiliary upgrade device communicates with the upper computer through the client component and the server component of the upper computer.
- the computer establishes a connection to transmit the firmware upgrade package to the module in upgrade mode through the host computer to complete the upgrade.
- the first upgrade program and the second upgrade program belong to the same upgrade tool; the method also includes:
- the upper computer analyzes the parameters of the acquired upgrade tool to obtain the upgrade parameters; the upgrade parameters include the first parameter used to indicate the upgrade package information; when the upgrade parameters do not include the second upgrade command, the upper computer imports the upgrade tool to complete the second - the configuration of the upgrade program;
- the auxiliary upgrade device analyzes the parameters of the acquired upgrade tool to obtain the upgrade parameters; the upgrade parameters include the first parameter used to indicate the upgrade package information; when the upgrade parameters include the second upgrade command, import the upgrade tool to complete the second The configuration of the upgrade program.
- the host computer executes the first upgrade command included in the first upgrade program, and the step of obtaining the upgrade location corresponding to the module includes:
- the host computer determines the firmware upgrade port as the upgrade location; Find the location of the upgrade; the identification includes the supplier identification number and the product identification number.
- the upgrade package information includes the upgrade package version name and the upgrade package compression format; the method also includes:
- the auxiliary upgrade device checks the upgrade path based on the version name of the upgrade package, and checks the obtained verification file for verification; the verification file includes an MD5 file; if the verification is passed, the auxiliary upgrade device determines whether the obtained upgrade compressed package is The upgrade package compression format is satisfied; when the upgrade package compression format is satisfied, the upgrade compressed package is decompressed to obtain the firmware upgrade package.
- the switching instruction is used to instruct the module to switch from the normal mode to the upgrade mode;
- the address information of the upper computer includes the IP address of the upper computer;
- the server component includes a transmission control protocol server process, and the transmission control protocol server process is based on The main function of the transmission control protocol is obtained by calling the host computer to establish a server socket locally;
- the client component includes the transmission control protocol client process, and the transmission control protocol client process is based on the main function of the transmission control protocol. Create a client socket locally to get;
- the steps for establishing a connection between the host computer and the auxiliary upgrade device include:
- the upper computer runs the transmission control protocol server process and enters the waiting state
- the auxiliary upgrade device runs the transmission control protocol client process, and outputs the connection request according to the IP address
- the upper computer After receiving the connection request from the auxiliary upgrade device, the upper computer establishes a transmission control protocol-based communication connection with the auxiliary upgrade device according to the connection request, and prints a log indicating successful connection establishment.
- the method also includes:
- the auxiliary upgrade device When the communication connection is successfully established, the auxiliary upgrade device sends each file in the firmware upgrade package through the corresponding main function until it is confirmed that each file has been sent, and prints a log to express the success of the upgrade;
- the above module upgrade method can complete remote upgrade, so that users can use the remote upgrade function to solve the problem that the upper computer equipment cannot store the module firmware upgrade package.
- the upgrade process of this application is simple, requires few files, is convenient and easy to operate, and does not need to modify any files during the upgrade process. For the user, the controllability in the upgrade process is guaranteed, and the user is prevented from making mistakes in modifying files during the upgrade process, resulting in upgrade failure.
- steps in the flow charts involved in the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in the flow charts involved in the above-mentioned embodiments may include multiple steps or stages, and these steps or stages are not necessarily executed at the same time, but may be performed at different times For execution, the execution order of these steps or stages is not necessarily performed sequentially, but may be executed in turn or alternately with other steps or at least a part of steps or stages in other steps.
- the embodiment of the present application also provides a module upgrading device for implementing the above-mentioned module upgrading method from the perspective of a host computer.
- the solution to the problem provided by the device is similar to the implementation described in the above method, so the specific limitations in one or more embodiments of the module upgrade device provided below can be referred to above for the implementation from the perspective of the host computer The limitation of the module upgrade method will not be repeated here.
- a module upgrade device is provided, the device is applied to a host computer in a module upgrade system and configured with a first upgrade program; the module upgrade system also includes a module connected to the host computer, and An auxiliary upgrade device that is connected to the host computer and has been configured with the second upgrade program; the device includes:
- the server execution unit 710 is configured to execute the first upgrade command included in the first upgrade program, obtain the upgrade position corresponding to the module, and output a switch command; the switch command is used to instruct the module to switch to the upgrade mode;
- the server upgrade unit 720 is used to create a server component when the confirmation module switches to the upgrade mode, and establish a connection with the auxiliary upgrade device through the server component and the client component of the auxiliary upgrade device, so as to transfer the information from the auxiliary upgrade device
- the firmware upgrade package is transmitted to the module in the upgrade mode to complete the upgrade;
- the client component is the second upgrade command included in the second upgrade program and created after the auxiliary upgrade device executes;
- the second upgrade command includes the address information of the upper computer.
- the first upgrade program and the second upgrade program belong to the same upgrade tool; the device also includes:
- the server parsing unit is configured to analyze the parameters of the acquired upgrade tool to obtain upgrade parameters; the upgrade parameters include the first parameter used to indicate the upgrade package information;
- the server-side import unit is used to import the upgrade tool to complete the configuration of the first upgrade program when the upgrade parameters do not include the second upgrade command.
- the server execution unit 710 is configured to determine the firmware upgrade port as the upgrade location when the upgrade parameter includes the second parameter indicating the firmware upgrade port; and is configured to determine the firmware upgrade port as the upgrade location when the upgrade parameter does not include the second Parameters, in the local device directory, find the upgrade location according to the identification of the module; the identification includes the supplier identification code and the product identification code.
- the switching instruction is used to instruct the module to switch from the normal mode to the upgrade mode;
- the address information of the upper computer includes the IP address of the upper computer;
- the server component includes a transmission control protocol server process, and the transmission control protocol server process is based on The main function of the transmission control protocol is obtained by calling the host computer to establish a server socket locally;
- the client component includes the transmission control protocol client process, and the transmission control protocol client process is based on the main function of the transmission control protocol. Create a client socket locally to get;
- the server upgrade unit 720 is used to run the transmission control protocol server process, and enters the waiting state until receiving the connection request of the auxiliary upgrade device;
- the connection request is that the IP address is processed by the auxiliary upgrade device running the transmission control protocol client process; and according to Connection request, establishing a transmission control protocol-based communication connection with the auxiliary upgrade device, and printing a log for expressing the successful establishment of the connection;
- the device also includes:
- the server checking unit is used to confirm whether the module is converted from the upgrade mode to the normal mode when the upgrade is completed.
- the embodiment of the present application also provides a module upgrading device for implementing the above-mentioned module upgrading method from the perspective of auxiliary upgrading equipment.
- the solution to the problem provided by this device is similar to the implementation described in the above method, so the specific limitations in one or more embodiments of the module upgrade device provided below can be referred to above for implementation from the perspective of auxiliary upgrade equipment The limitations of the module upgrade method will not be repeated here.
- a module upgrade device which is applied to an auxiliary upgrade device configured with a second upgrade program in a module upgrade system; the module upgrade system further includes connecting the auxiliary upgrade device, and The upper computer configured with the first upgrade program, and the module connected to the upper computer; the device includes:
- the client execution unit 810 is configured to execute the first upgrade command contained in the first upgrade program, obtain the upgrade position corresponding to the module, and output a switching instruction; the switching instruction is used to instruct the module to switch to the upgrade mode;
- the client transmission unit 820 is used to create a server component when the confirmation module switches to the upgrade mode, and establish a connection with the auxiliary upgrade device through the server component and the client component of the auxiliary upgrade device, so as to transfer the information from the auxiliary upgrade device
- the firmware upgrade package is transmitted to the module in the upgrade mode to complete the upgrade; the client component is the second upgrade command included in the second upgrade program and created after the auxiliary upgrade device executes; the second upgrade command includes the address information of the upper computer.
- the first upgrade program and the second upgrade program belong to the same upgrade tool; the device also includes:
- the client parsing unit is configured to perform parameter parsing on the acquired upgrade tool to obtain upgrade parameters;
- the upgrade parameters include a first parameter used to indicate upgrade package information;
- the client importing unit is configured to import the upgrade tool to complete the configuration of the second upgrade program when the upgrade parameter includes the second upgrade command.
- the upgrade package information includes the upgrade package version name and the upgrade package compression format; the device also includes:
- the client verification unit checks the upgrade path based on the upgrade package version name, and checks the obtained verification file for verification; the verification file includes an MD5 file;
- the client decompression unit determines whether the obtained upgrade compressed package meets the upgrade package compression format; if it meets the upgrade package compression format, then decompresses the upgrade compressed package to obtain the firmware upgrade package.
- the address information of the upper computer includes the IP address of the upper computer;
- the server component includes a transmission control protocol server process, and the transmission control protocol server process is a main function based on transmission control protocol called by the upper computer to establish locally
- the server socket is obtained;
- the client component includes the transmission control protocol client process, and the transmission control protocol client process is obtained by calling the main function based on the transmission control protocol to establish the client socket locally through the auxiliary upgrade device;
- the client transmission unit 820 is used to run the transmission control protocol client process, and output the connection request according to the IP address; the connection request is used to indicate that the upper computer that has entered the waiting state by running the transmission control protocol server process establishes a communication connection based on the transmission control protocol ; and when the communication connection is successfully established, send each file in the firmware upgrade package through the corresponding main function, until it is determined that each file is sent, and print a log for expressing the upgrade success.
- Each unit in the above-mentioned module upgrade device can be fully or partially realized by software, hardware and a combination thereof.
- Each of the above units may be embedded in or independent of the processor in the auxiliary upgrade device in the form of hardware, and may also be stored in the memory of the auxiliary upgrade device in the form of software, so that the processor can call and execute the corresponding operations of the above units.
- a component may be, but is not limited to being, a process running on a processor, a processor, an object, an executable, a thread of execution, a program, and or a computer.
- a component may be, but is not limited to being, a process running on a processor, a processor, an object, an executable, a thread of execution, a program, and or a computer.
- an application running on a server and a server can be a component.
- One or more components can reside within a process and or thread of execution, and a component can be localized on one computer and or distributed between two or more computers.
- the present application also provides a module upgrade system, the system includes a module, a host computer configured with the first upgrade program, and an auxiliary upgrade device configured with the second upgrade program; the host computer is respectively connected to the auxiliary upgrade device , module;
- the host computer is used to realize the steps of the above-mentioned module upgrading method implemented from the perspective of the host computer;
- the auxiliary upgrade device is used to realize the above steps of the module upgrade method implemented from the perspective of the auxiliary upgrade device.
- the upper computer is an embedded device
- the auxiliary upgrade device includes a computer device that the embedded device has Pinged
- the module includes a communication module, and the communication module is connected to the embedded device.
- the embedded device in the embodiment of the present application may refer to a device used to connect a module (for example, a client terminal device connected to a module); wherein, the embedded device may have a device form that can meet different customer needs; in some
- the embedded device may be a CPE (Customer Premise Equipment, customer terminal equipment); in other examples, the embedded device may be a TV box or a robot-shaped device.
- the auxiliary upgrading equipment may refer to computer equipment.
- the communication module includes a 5G module; the auxiliary upgrade device may include a laptop running a Linux system.
- the preset conditions of the module upgrade system may include: 1 a Linux system notebook whose kernel version is 3.X/4.X/5.X; 2 a module that can be a communication module ( module); 3 the embedded device that can be connected to the module; 4 the USB cable; 5 Ping between the notebook and the embedded device.
- the module is connected to the embedded device via USB, the embedded device and the Linux laptop can ping each other, and the module firmware upgrade package and MD5 files are stored on the Linux laptop.
- the Upgrade_Tool tool For embedded devices, after setting up the environment according to the above operations, import the Upgrade_Tool tool into the embedded device. Execute the "/upgrade_tool –p 9008" command. After executing the command, the tool will search for the location of the module under /sys/bus/usb/devices according to the VID and PID of the module. After finding the module, it will send a command to switch the module from normal mode to upgrade module mode. After the switch is completed, it will Execute usb2tcp_main, create Tcp Server, and wait for Client to connect.
- the embedded device will print a log to indicate that the connection is established successfully.
- the laptop completes sahara_main, transfers the files in the firmware package through firehose_main, and sends each file to the module.
- the log can be printed to indicate that the upgrade is successful.
- This application realizes the remote upgrade function on the basis of supporting the basic local upgrade function.
- the connection between the Socket Server and the Socket Client is established, and the remote transmission of the upgrade package is realized to solve the problem of insufficient memory space on the device connected to the module.
- the entire code framework is optimized, and only one executable file, Upgrade_Tool, is required for compilation and generation, which solves the problem of complicated upgrade process of the old upgrade tool.
- the Upgrade_Tool tool of this application provides the -p parameter to complete the remote upgrade, so that the user can use the remote upgrade function to solve the problem that the upper computer device cannot store the module firmware upgrade package problem.
- _Tool upgrade tool has a simple upgrade process, requires few files, is convenient and easy to operate, and does not need to modify any files during the upgrade process. For the user, the controllability in the upgrade process is guaranteed, and the user is prevented from making mistakes in modifying files during the upgrade process, resulting in upgrade failure.
- a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned module upgrading method are implemented.
- a computer program product including a computer program, and when the computer program is executed by a processor, the steps of the above module upgrading method are realized.
- any reference to storage, database or other media used in the various embodiments provided in the present application may include at least one of non-volatile and volatile storage.
- Non-volatile memory can include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive variable memory (ReRAM), magnetic variable memory (Magnetoresistive Random Access Memory, MRAM), Ferroelectric Random Access Memory (FRAM), Phase Change Memory (Phase Change Memory, PCM), graphene memory, etc.
- the volatile memory may include random access memory (Random Access Memory, RAM) or external cache memory, etc.
- RAM Random Access Memory
- RAM Random Access Memory
- RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
- the databases involved in the various embodiments provided in this application may include at least one of a relational database and a non-relational database.
- the non-relational database may include a blockchain-based distributed database, etc., but is not limited thereto.
- the processors involved in the various embodiments provided by this application can be general-purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, data processing logic devices based on quantum computing, etc., and are not limited to this.
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Quality & Reliability (AREA)
- Stored Programmes (AREA)
- Information Transfer Between Computers (AREA)
Abstract
本申请涉及一种模块升级方法和***。方法应用于模块升级***中、已配置第一升级程序的上位机;模块升级***还包括连接上位机的模块,以及连接上位机、且已配置第二升级程序的辅助升级设备;方法包括:执行第一升级程序包含的第一升级命令,获取模块对应的升级位置,并输出切换指令(S202);当确认模块切换至升级模式,则创建服务端组件,并通过服务端组件和辅助升级设备的客户端组件,与辅助升级设备建立连接,以将来自辅助升级设备的固件升级包传输给处于升级模式的模块完成升级(S204);客户端组件为第二升级程序包含的第二升级命令经辅助升级设备执行后创建得到;第二升级命令包含上位机的地址信息。
Description
相关申请的交叉引用
本申请要求于2022年2月14日提交中国专利局、申请号为2022101354031、发明名称为“模块升级方法和***”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及固件升级技术领域,特别是涉及一种模块升级方法和***。
Linux平台下的模块升级,传统升级方式是通过Download Tool工具依赖Download_Linux、Fh_Loader、FHLoaderErase.xml、Parameters.ini以及QSaharaServer文件进行模块固件升级,存在着升级流程复杂的问题。。
发明内容
根据本申请的各种实施例,提供一种能够简化升级流程的模块升级方法和***。
第一方面,本申请提供了一种模块升级方法,方法应用于模块升级***中、已配置第一升级程序的上位机;模块升级***还包括连接上位机的模块,以及连接上位机、且已配置第二升级程序的辅助升级设备;方法包括:
执行第一升级程序包含的第一升级命令,获取模块对应的升级位置,并输出切换指令;切换指令用于指示模块切换至升级模式;
当确认模块切换至升级模式,则创建服务端组件,并通过服务端组件和辅助升级设备的客户端组件,与辅助升级设备建立连接,以将来自辅助升级设备的固件升级包传输给处于升级模式的模块完成升级;客户端组件为第二升级程序包含的第二升级命令经辅助升级设备执行后创建得到;第二升级命令包含上位机的地址信息。
在其中一个实施例中,第一升级程序和第二升级程序属于同一个升级工具;方法还包括:
对获取的升级工具进行参数解析,得到升级参数;升级参数包含用于指示升级包信息的第一参数;
在升级参数不包含第二升级命令的情况下,导入升级工具以完成第一升级程序的配置。
在其中一个实施例中,执行第一升级程序包含的第一升级命令,获取模块对应的升级位置的步骤包括:
当升级参数包含用于指示固件升级端口的第二参数,则将固件升级端口确定为升级位置;
当升级参数不包含第二参数,则在本地设备目录下,根据模块的识别标识寻找升级位置;识别标识包括供应商识别码和产品识别码。
在其中一个实施例中,切换指令用于指示模块从正常模式切换为升级模式;上位机的地址信息包括上位机的IP地址;服务端组件包括传输控制协议服务器进程,传输控制协议服务器进程为基于传输控制协议的main函数经上位机调用以在本地建立服务端套接字得到;客户端组件包括传输控制协议客户进程,传输控制协议客户进程为基于传输控制协议的main函数经辅助升级设备调用以在本地建立客户端套接字得到;
通过服务端组件和辅助升级设备的客户端组件,与辅助升级设备建立连接的步骤包括:
运行传输控制协议服务器进程,进入等待状态,直至接收到辅助升级设备的连接请求;连接请求为IP地址经运行传输控制协议客户进程的辅助升级设备处理得到;
根据连接请求,与辅助升级设备建立基于传输控制协议的通信连接,并打印用于表达成功建立连接的日志;
方法还包括:
在完成升级的情况下,确认模块是否由升级模式转换为正常模式。
第二方面,本申请还提供了一种模块升级方法,方法应用于模块升级***中、已配置第二升级程序的辅助升级设备;模块升级***还包括连接辅助升级设备、且已配置第一升级程序的上位机,以及连接上位机的模块;方法包括:
执行第二升级程序包含的第二升级命令,根据第二升级命令包含的上位机的地址信息,创建客户端组件;
通过客户端组件和上位机的服务端组件,与上位机建立连接,以将固件升级包传输给处于升级模式的模块完成升级;服务端组件为上位机在确认模块响应切换指令切换至升级模式的情况下创建的;切换指令为第一升级程序包含的第一升级命令经上位机执行后,获取到模块对应的升级位置的情况下输出的。
在其中一个实施例中,第一升级程序和第二升级程序属于同一个升级工具;方法还包括:
对获取的升级工具进行参数解析,得到升级参数;升级参数包含用于指示升级包信息的第一参数;
在升级参数中包含第二升级命令的情况下,导入升级工具以完成第二升级程序的配置。
在其中一个实施例中,升级包信息包括升级包版本名称和升级包压缩格式;方法还包括:
基于升级包版本名称,检查升级路径,并检查获取的校验文件以进行校验;校验文件包括MD5文件;
在校验通过的情况下,确定获取的升级压缩包是否满足升级包压缩格式;当满足升级包压缩格式,则解压升级压缩包得到固件升级包。
在其中一个实施例中,上位机的地址信息包括上位机的IP地址;服务端组件包括传输控制协议服务器进程,传输控制协议服务器进程为基于传输控制协议的main函数经上位机调用以在本地建立服务端套接字得到;客户端组件包括传输控制协议客户进程,传输控制协议客户进程为基于传输控制协议的main函数经辅助升级设备调用以在本地建立客户端套接字得到;
通过客户端组件和上位机的服务端组件,与上位机建立连接的步骤包括:
运行传输控制协议客户进程,根据IP地址输出连接请求;连接请求用于指示通过运行传输控制协议服务器进程已进入等待状态的上位机,建立基于传输控制协议的通信连接;
方法还包括:
在通信连接建立成功的情况下,通过相应的main函数发送固件升级包中的各文件,直至确定各文件发送完成,打印用于表达升级成功的日志。
第三方面,本申请还提供了一种模块升级***,***包括模块,已配置第一升级程序的上位机,以及已配置第二升级程序的辅助升级设备;上位机分别连接辅助升级设备、模块;其中:
上位机用于实现上述的方法的步骤;
辅助升级设备用于实现上述的方法的步骤。
在其中一个实施例中,上位机包括嵌入式设备;辅助升级设备包括嵌入式设备已经Ping通的计算机设备;
模块包括通信模组,通信模组连接嵌入式设备。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征、目的和优点将从说明书、附图以及权利要求书变得明显。
为了更好地描述和说明这里公开的那些发明的实施例和/或示例,可以参考一幅或多幅附图。用于描述附图的附加细书或示例不应当被认为是对所公开的发明、目前描述的实施例和/或示例以及目前理解的这些发明的最佳模式中的任何一者的范围的限制。
图1为一个实施例中模块升级方法的应用环境图;
图2为一个实施例中从上位机角度实施的模块升级方法的流程示意图;
图3为一个实施例中配置第一升级程序步骤的流程示意图;
图4为一个实施例中与辅助升级设备建立连接步骤的流程示意图;
图5为一个实施例中从辅助升级设备角度实施的模块升级方法的流程示意图;
图6为一个实施例中配置第二升级程序步骤的流程示意图;
图7为一个实施例中从上位机角度实施的模块升级装置的结构框图;
图8为一个实施例中从辅助升级设备角度实施的模块升级装置的结构框图;
图9为一个实施例中模块升级***的内部结构图。
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
可以理解,本申请所使用的术语“第一”、“第二”等可在本文中用于描述各种元件,但这些元件不受这些术语限制。这些术语仅用于将一个元件与另一个元件区分。此外,当一个元件被认为是“连接”另一个元件时,它可以是直接连接到另一个元件,或者通过居中元件连接另一个元件。此外,以下实施例中的“连接”,如果被连接的对象之间具有电信号或数据的传递,则应理解为“电连接”、“通信连接”等。
模块在Linux平台下的传统升级方式,在模块所连接的Host侧内存空间太小时,无法对模块升级。同时,传统升级方式依赖文件过多,需要五个文件才可以进行升级,特别是升级过程中还需要手动修改部分文件,造成升级过程的不可控。
本申请则提出一种解决上位机内存空间不足的模块升级方案,可以解决在连接模块(module)的Host侧内存空间不能够存储模块固件包的场景下,模块的固件升级。具体的,上位机设备内存空间不足,无法存储下模块固件升级包版本时,本申请的升级工具(Upgrade_Tool)可以提供-p参数,能够完成远程升级,使用户可以利用远程升级的功能,解决上位机设备无法存储模块固件升级包的问题。进一步的,本申请的升级工具升级流程简单,所需文件少,方便易操作,升级过程中不需要修改任何文件。对于用户来说保证了升级过程中的可控性,避免用户在升级过程中修改文件出错,导致升级失败。
进一步地,本申请实施例在上位机中配置第一升级程序,在辅助升级设备中配置第二升级程序,进而升级程序可以提供相应的参数和命令,实现模块固件升级包的传输,完成模块升级。本申请实施例能够应对上位机的内存空间不足的情况。
本申请实施例提供的模块升级方法,可以应用于如图1所示的应用环境中。其中,模块102通过上位机104连接辅助升级设备106。具体的,模块102可以通过相应的接口连接到上位机104,上位机104和辅助升级设备106能够相互连接,模块102的固件升级包可以存储在辅助升级设备106上。此外,模块102、上位机104和辅助升级设备106可以共同搭建出一种模块升级***,用于对模块102进行升级;该模块升级***在支持基本的本地升级功能的基础上,还可以实现远程升级的功能。
在一些示例中,本申请中的模块102可以指通信模组,例如,基于高通平台的无线通信模组;在一些示例中,本申请中的通信模组可以为5G(5th Generation Mobile Communication Technology,第五代移动通信技术)通信模组,支持5G独立组网(SA,Standalone)和非独立组网(NSA,Non-Standalone)两种网络架构。上位机104包括但不限于是嵌入式设备。辅助升级设备106可以但不限于是各种笔记本电脑、平板电脑等计算机设备,在一些示例中,辅助升级设备106可以是Linux笔记本电脑,例如,内核版本为3.X/4.X/5.X的Linux***笔记本电脑。笔记本电脑和嵌入式设备之间可以Ping(Packet Internet Groper,因特网包探索器)通。
进一步的,模块102与辅助升级设备106相连接,本申请实施例中的模块102可以独立于辅助升级设备106;以辅助升级设备106为嵌入式设备为例,模块102可以通过USB(Universal Serial Bus,通用串行总线)连接到嵌入式设备上,模块102也可以通过PCIe(Peripheral Component Interconnect express,高速串行计算机扩展总线标准)连接嵌入设设备,模块102还可以直接***嵌入式设备中;本申请实施例对模块102与辅助升级设备106之间的连接关系并无限定。此外,嵌入式设备和Linux笔记本电脑互相Ping通,模块的固件升级包和MD5(Message-Digest Algorithm 5,消息摘要算法5) 文件存储在Linux笔记本电脑上。
需要说明的是,本申请可以应用在Linux环境以及Android环境给模块升级;本申请实施例中提及的通信制式包括但不限于:全球移动通信(Global System of Mobile Communication,GSM)、长期演进(Long Term Evolution,LTE)频分双工(Frequency Division Duplex,FDD)、LTE时分双工(Time Division Duplex,TDD)、LTE、先进的长期演进(LTE-Advanced,LTE-A)或下一代通信(例如,6G通信)等。
在一个实施例中,如图2所示,提供了一种模块升级方法,以该方法应用于图1中的上位机为例进行说明,该上位机已配置第一升级程序;上位机所属的模块升级***还包括连接上位机的模块,以及连接上位机、且已配置第二升级程序的辅助升级设备。该方法包括以下步骤:
步骤202,执行第一升级程序包含的第一升级命令,获取模块对应的升级位置,并输出切换指令;
其中,切换指令用于指示模块切换至升级模式。
具体地,上位机已配置第一升级程序,进而该升级程序可以提供相应的参数和命令,以使上位机完成相应的升级流程。该第一升级程序包含第一升级命令,上位机执行第一升级命令后,可以获取模块对应的升级位置,并输出切换指令。
本申请中升级程序(第一升级程序、第二升级程序)可以是升级工具经导入上位机或辅助升级设备得到;本申请中的升级命令(第一升级命令、第二升级命令)可以是升级工具中的参数。例如,第一升级命令可以是升级工具中用于升级模块的连接侧执行的参数;第二升级命令可以是升级工具中用于升级模块的固件升级包来源侧执行与模块连接侧建立连接的参数。在一些示例中,升级命令可以是升级工具中的-p参数。需要说明的是,升级工具可以是Upgrade_Tool,该工具可以在Linux环境以及Android环境用来给模块升级。
在另一些示例中,本申请中的Upgrade_Tool工具可以拥有如下参数(升级参数),参数所代表的含义如下表-表1所示:
表1 Upgrade_Tool参数类型及含义
进一步的,以辅助升级设备执行“./upgrade_tool–f./89610.1000.00.01.01.04.7z–p ip:9008”为例,在Upgrade_Tool升级工具中,“-f”参数用于固件升级包信息(升级包名称和/或升级包版本名称,以及升级包压缩格式等),例如,“-f”参数可以采用-f./x.7z的形式,升级包名称可以为89610.1000.00.01.01.04.7z;“-p”参数用于指定IP(Internet Protocol,网际互连协议)地址和端口号,本申请中的ip:9008,该ip为嵌入式设备端IP。
在其中一个实施例中,第一升级程序和第二升级程序属于同一个升级工具;如图3所示,方法还包括:
步骤302,对获取的升级工具进行参数解析,得到升级参数;升级参数包含用于指示升级包信息的第一参数;
步骤304,在升级参数不包含第二升级命令的情况下,导入升级工具以完成第一升级程序的配置。
具体而言,在进行模块升级之前,本申请中的上位机可通过导入升级工具Upgrade_Tool以获取相应的升级程序。本申请中的第一升级程序和第二升级程序属于同一个升级工具Upgrade_Tool,进而可以优化整个代码框架,编译生成所需要的文件只有Upgrade_Tool一个可执行文件,解决了旧的升级工具升级过程繁杂的问题。
其中,上位机在获取到升级工具Upgrade_Tool后,可以对升级工具Upgrade_Tool进行解析,获取升级工具中的参数(升级参数);在一些示例中,该升级参数的参数类型及含义可以参阅表1,即以表1为例阐释本申请中的升级参数,本申请中的第一升级命令可以指“-p<9008>”,第二升级命令可以指“-p<ip:9008>”。同时,第一参数可以指“-f<firmware package file name>”,第二参数可以指“-p<dev/ttyUSBx>”;此外,本申请Upgrade_Tool升级工具还可以包含用于指示升级方式的第三参数,该升级方式可以为全擦升级,即第三参数可以指“-e”。
进一步的,Upgrade_Tool升级工具的基本的用法为“./upgrade_tool –f./[fireware package file name]”,在本地升级的基础上支持了远程升级功能。即无论导入Upgrade_Tool升级工具的是上位机还是辅助升级设备,本申请中的升级参数必包含用于指示升级包信息的第一参数(Upgrade_Tool升级工具支持基本的本地升级功能)。
而在解析得到的升级参数中,当升级参数不包含第二升级命令,则上位机可以导入该升级工具以完成第一升级程序的配置;例如,对Upgrade_Tool升级工具进行参数解析,当参数解析的结果(即升级参数)中不存在第二升级命令“-p<ip:9008>”,则确认当前导入升级工具Upgrade_Tool的本端设备是上位机,则该上位机可以基于第一参数“-f<firmware package file name>”,执行第一升级命令“-p<9008>”。
又如,对Upgrade_Tool升级工具进行参数解析,当参数解析的结果(即升级参数)中存在第二升级命令“-p<ip:9008>”,则确认导入升级工具Upgrade_Tool的本端设备是辅助升级设备,则该辅助升级设备可以基于第一参数“-f<firmware package file name>”,执行第二升级命令“-p<ip:9008>”。
以上,本申请通过-p参数和不同的命令(Upgrade_Tool一个执行文件),升级流程简单,所需文件少,方便易操作,升级过程中不需要修改任何文件。对于用户来说保证了升级过程中的可控性,避免用户在升级过程中修改文件出错,导致升级失败。
上位机在执行第一升级命令后,可以初始化升级进度,并获取模块对应的升级位置,并发送命令(切换指令)让模块切换到升级模块式,即切换指令用于指示模块切换至升级模式。
在其中一个实施例中,执行第一升级程序包含的第一升级命令,获取模块对应的升级位置的步骤包括:
当升级参数包含用于指示固件升级端口的第二参数,则将固件升级端口确定为升级位置;
当升级参数不包含第二参数,则在本地设备目录下,根据模块的识别标识寻找升级位置;识别标识包括供应商识别码和产品识别码。
具体而言,上位机基于工具在执行第一升级命令“/upgrade_tool–p 9008”后,当升级参数中没有指示固件升级端口的第二参数,则上位机可以在本地设备目录/sys/bus/usb/devices(***/总线/USB/设备)下,根据模块的VID(Vendor ID,供应商识别码)和PID(Product ID,产品识别码)寻找模块的位置。当升级参数中有第二参数,则可以将第二参数指定的固件升级端口作为模块的升级位置。
以上位机通过USB连接模块以及表1为例,基于Upgrade_Tool升级工具,上位机执行第一升级命令(-p 9008)后,当-u参数存在则保存usbmon log,并初始化升级进度,进一步的,获取usb2tcp_port,例如通过寻找模块升级位置(如不指定则自动寻找),确定usb2tcp_port=9008;当usb2tcp_port不等于9008,Upgrade_Tool升级工具可以获取module_port_name,确认module_port_name是否为9008。此外,上位机在获取到模块升级位置后,会输出切换指令;切换指令用于指示模块进入升级模式switch_to_edl_mode。此后,上位机当接收到模块响应切换指令反馈的切换成功消息,则可以创建服务端组件。在模块进入升级模式后,还可以再次确定usb2tcp_port是否为9008。
在其中一个实施例中,切换指令用于指示模块从正常模式切换为升级模式。执行第一升级命令后,当找到模块的升级位置,则可以发送命令让模块从正常模式切换到升级模式。
步骤204,当确认模块切换至升级模式,则创建服务端组件,并通过服务端组件和辅助升级设备的客户端组件,与辅助升级设备建立连接,以将来自辅助升级设备的固件升级包传输给处于升级模式的模块完成升级;
其中,客户端组件为第二升级程序包含的第二升级命令经辅助升级设备执行后创建得到;第二升 级命令包含上位机的地址信息。
具体而言,上位机在确定模块切换至升级模式后,可以创建服务端组件,以与辅助升级设备建立连接,从而将来自辅助升级设备的固件升级包传输给处于升级模式的模块完成升级。以上位机与辅助升级设备以TCP(Transmission Control Protocol,传输控制协议)方式建立连接为例,上位机作为TCP Server等待辅助升级设备的连接,辅助升级设备作为TCP Client和上位机建立连接。
本申请在支持基本的本地升级功能的基础上,实现了远程升级的功能,具体通过-p参数跟不同的命令实现上位机TCP Server与辅助升级设备TCP Client的连接建立。
在其中一个实施例中,上位机的地址信息包括上位机的IP地址;服务端组件包括传输控制协议服务器进程,传输控制协议服务器进程为基于传输控制协议的main函数经上位机调用以在本地建立服务端套接字得到;客户端组件包括传输控制协议客户进程,传输控制协议客户进程为基于传输控制协议的main函数经辅助升级设备调用以在本地建立客户端套接字得到;
如图4所示,通过服务端组件和辅助升级设备的客户端组件,与辅助升级设备建立连接的步骤包括:
步骤402,运行传输控制协议服务器进程,进入等待状态,直至接收到辅助升级设备的连接请求;连接请求为IP地址经运行传输控制协议客户进程的辅助升级设备处理得到;
步骤404,根据连接请求,与辅助升级设备建立基于传输控制协议的通信连接,并打印用于表达成功建立连接的日志;
具体而言,在模块切换至升级模式的切换完成后,上位机可以执行usb2tcp_main(基于传输控制协议的main函数),创建Tcp Server(TCP服务端),并等待Client连接(wait_client_connect)。其中,上位机可以在本地建立服务端套接字(Socket Server)。此外,上位机可以打印log代表连接建立成功。
在其中一个实施例中,方法还包括:
在完成升级的情况下,确认模块是否由升级模式转换为正常模式。
具体而言,本申请可以查看升级完成后模块状态是否正常。
上述模块升级方法,在支持基本的本地升级功能的基础上,实现了远程升级的功能。通过-p参数跟不同的命令实现Socket Server与Socket Client的连接建立,完成升级包远程传输,以解决模块所连接设备端内存空间不足的问题。同时优化整个代码框架,编译生成所需要的文件只有Upgrade_Tool(升级工具)一个可执行文件,解决了旧的升级工具升级过程繁杂的问题。
基于同样的发明构思,本申请实施例还提供了一种从辅助升级设备角度实施的模块升级方法。该方法所提供的解决问题的实现方案与上述从上位机角度实施的方法中所记载的实现方案相似,故下面所提供的一个或多个模块升级方法实施例中的具体限定可以参见上文中对于从上位机角度实施的方法的限定,在此不再赘述。
在一个实施例中,如图5所示,提供了一种模块升级方法,以该方法应用于图1中的辅助升级设备为例进行说明,该辅助升级设备已配置第二升级程序;辅助升级设备所属的模块升级***还包括连接辅助升级设备、已配置第一升级程序的上位机,以及连接上位机的模块;该方法包括以下步骤:
步骤502,执行第二升级程序包含的第二升级命令,根据第二升级命令包含的上位机的地址信息,创建客户端组件;
具体而言,辅助升级设备已配置第二升级程序,进而该升级程序可以提供相应的参数和命令,以使辅助升级设备完成相应的升级流程。该第二升级程序包含第二升级命令,辅助升级设备执行第二升级命令后,可以根据第二升级命令包含的上位机的地址信息,创建客户端组件。
在配置第二升级程序前,可以将模块的固件升级包和Upgrade_Tool工具拷贝到辅助升级设备的上同一目录下。
在其中一个实施例中,第一升级程序和第二升级程序属于同一个升级工具;如图6所示,方法还可以包括:
步骤602,对获取的升级工具进行参数解析,得到升级参数;升级参数包含用于指示升级包信息的第一参数;
步骤604,在升级参数中包含第二升级命令的情况下,导入升级工具以完成第二升级程序的配置。
具体而言,在进行模块升级之前,本申请中的辅助升级设备可通过导入升级工具Upgrade_Tool以获取相应的升级程序。本申请中的第一升级程序和第二升级程序属于同一个升级工具Upgrade_Tool,进而可以优化整个代码框架,编译生成所需要的文件只有Upgrade_Tool一个可执行文件,解决了旧的升级工具升级过程繁杂的问题。
而在解析得到的升级参数中,当升级参数包含第二升级命令,则辅助升级设备可以导入该升级工具以完成第二升级程序的配置;例如,对Upgrade_Tool升级工具进行参数解析,当参数解析的结果(即升级参数)中存在第二升级命令“-p<ip:9008>”,则确认导入升级工具Upgrade_Tool的本端设备是辅助升级设备,则该辅助升级设备可以基于第一参数“-f<firmware package file name>”,执行第二升级命令“-p<ip:9008>”。
在其中一个实施例中,升级包信息包括升级包版本名称和升级包压缩格式;方法还包括:
基于升级包版本名称,检查升级路径,并检查获取的校验文件以进行校验;校验文件包括MD5文件;
在校验通过的情况下,确定获取的升级压缩包是否满足升级包压缩格式;当满足升级包压缩格式,则解压升级压缩包得到固件升级包。
具体而言,在升级前,可以将模块的固件升级包、校验文件和Upgrade_Tool工具拷贝到辅助升级设备上同一目录下。其中,校验文件可以指MD5(Message-Digest Algorithm 5,消息摘要算法5)文件。即辅助升级设备存储了模块的固件升级包和MD5文件。
进而,辅助升级设备可以执行“-f./x.7z -p ip:9008”,具体可以为“./upgrade_tool –f./89610.1000.00.01.01.04.7z –p ip:9008”。参考表1可知,“-f”参数用于指定固件升级包版本名称,此处升级包名称为89610.1000.00.01.01.04.7z;“-p”参数用于指定IP地址和端口号,此处为ip:9008,ip为可以为上位机(例如,嵌入式设备)端ip。
辅助升级设备在执行上述升级命令后,基于升级包版本名称,检查升级路径,并检查MD5文件(消息摘要算法5文件签名,用于保证文件的正确性),以及检查升级文件是否为7z压缩包;其中,辅助升级设备可以打印相应的log,开始进行MD5文件校验,解压7z压缩包。进一步的,在上述过程后,接着可以进行到Tcp_Connect(TCP连接)阶段,和上位机建立连接。
步骤504,通过客户端组件和上位机的服务端组件,与上位机建立连接,以将固件升级包传输给处于升级模式的模块完成升级;服务端组件为上位机在确认模块响应切换指令切换至升级模式的情况下创建的;切换指令为第一升级程序包含的第一升级命令经上位机执行后,获取到模块对应的升级位置的情况下输出的。
具体而言,辅助升级设备可以通过与上位机建立连接(tcp_connect_port_name=192.168.84.130:9008),将固件升级包传输给处于升级模式的模块完成升级。其中,辅助升级设备可以在本地建立客户端套接字(Socket Client)。
在其中一个实施例中,上位机的地址信息包括上位机的IP地址;服务端组件包括传输控制协议服务器进程,传输控制协议服务器进程为基于传输控制协议的main函数经上位机调用以在本地建立服务端套接字得到;客户端组件包括传输控制协议客户进程,传输控制协议客户进程为基于传输控制协议的main函数经辅助升级设备调用以在本地建立客户端套接字得到;
通过客户端组件和上位机的服务端组件,与上位机建立连接的步骤包括:
运行传输控制协议客户进程,根据IP地址输出连接请求;连接请求用于指示通过运行传输控制协议服务器进程已进入等待状态的上位机,建立基于传输控制协议的通信连接;
方法还包括:
在通信连接建立成功的情况下,通过相应的main函数发送固件升级包中的各文件,直至确定各文件发送完成,打印用于表达升级成功的日志。
具体而言,辅助升级设备连接建立成功后,可以执行read(fd,&tlv_usb,sizeof(tlv_usb)),例如,完成sahara_main,通过firehose_main对固件包中的文件进行传输,例如将每一个文件send到模块中。 发送完成后,可以打印log表示升级成功。
上述模块升级方法,在支持基本的本地升级功能的基础上,实现了远程升级的功能。通过-p参数跟不同的命令实现Socket Server与Socket Client的连接建立,完成升级包远程传输,以解决模块所连接设备端内存空间不足的问题。同时优化整个代码框架,编译生成所需要的文件只有Upgrade_Tool(升级工具)一个可执行文件,解决了旧的升级工具升级过程繁杂的问题。
基于同样的发明构思,本申请实施例还提供了一种从模块升级***角度实施的模块升级方法。该方法所提供的解决问题的实现方案与上述从上位机、辅助升级设备角度实施的方法中所记载的实现方案相似,故下面所提供的一个或多个模块升级方法实施例中的具体限定可以参见上文中对于从上位机、辅助升级设备角度实施的方法的限定,在此不再赘述。
在一个实施例中,提供了一种模块升级方法,以该方法应用于图1所示的模块升级***为例进行说明,该模块升级***包括辅助升级设备、上位机和连接上位机的模块;该上位机已配置第一升级程序、且该辅助升级设备已配置第二升级程序。该方法包括以下步骤:
上位机执行第一升级程序包含的第一升级命令,获取模块对应的升级位置,并输出切换指令;切换指令用于指示模块切换至升级模式;上位机当确认模块切换至升级模式,则创建服务端组件;
辅助升级设备执行第二升级程序包含的第二升级命令,根据第二升级命令包含的上位机的地址信息,创建客户端组件;辅助升级设备通过客户端组件和上位机的服务端组件,与上位机建立连接,以通过上位机将固件升级包传输给处于升级模式的模块完成升级。
在其中一个实施例中,第一升级程序和第二升级程序属于同一个升级工具;方法还包括:
上位机对获取的升级工具进行参数解析,得到升级参数;升级参数包含用于指示升级包信息的第一参数;在升级参数不包含第二升级命令的情况下,上位机导入升级工具以完成第一升级程序的配置;
辅助升级设备对获取的升级工具进行参数解析,得到升级参数;升级参数包含用于指示升级包信息的第一参数;在升级参数中包含第二升级命令的情况下,导入升级工具以完成第二升级程序的配置。
在其中一个实施例中,上位机执行第一升级程序包含的第一升级命令,获取模块对应的升级位置的步骤包括:
当升级参数包含用于指示固件升级端口的第二参数,则上位机将固件升级端口确定为升级位置;当升级参数不包含第二参数,则上位机在本地设备目录下,根据模块的识别标识寻找升级位置;识别标识包括供应商识别码和产品识别码。
在其中一个实施例中,升级包信息包括升级包版本名称和升级包压缩格式;方法还包括:
辅助升级设备基于升级包版本名称,检查升级路径,并检查获取的校验文件以进行校验;校验文件包括MD5文件;辅助升级设备在校验通过的情况下,确定获取的升级压缩包是否满足升级包压缩格式;当满足升级包压缩格式,则解压升级压缩包得到固件升级包。
在其中一个实施例中,切换指令用于指示模块从正常模式切换为升级模式;上位机的地址信息包括上位机的IP地址;服务端组件包括传输控制协议服务器进程,传输控制协议服务器进程为基于传输控制协议的main函数经上位机调用以在本地建立服务端套接字得到;客户端组件包括传输控制协议客户进程,传输控制协议客户进程为基于传输控制协议的main函数经辅助升级设备调用以在本地建立客户端套接字得到;
上位机与辅助升级设备建立连接的步骤包括:
上位机运行传输控制协议服务器进程,进入等待状态;
辅助升级设备运行传输控制协议客户进程,根据IP地址输出连接请求
上位机接收到辅助升级设备的连接请求,则根据连接请求与辅助升级设备建立基于传输控制协议的通信连接,并打印用于表达成功建立连接的日志。
在其中一个实施例中,方法还包括:
辅助升级设备在通信连接建立成功的情况下,通过相应的main函数发送固件升级包中的各文件,直至确定各文件发送完成,打印用于表达升级成功的日志;
上位机在完成升级的情况下,确认模块是否由升级模式转换为正常模式。
上述模块升级方法,能够完成远程升级,使用户可以利用远程升级的功能,解决上位机设备无法存储模块固件升级包的问题。此外,本申请升级流程简单,所需文件少,方便易操作,升级过程中不需要修改任何文件。对于用户来说保证了升级过程中的可控性,避免用户在升级过程中修改文件出错,导致升级失败。
应该理解的是,虽然如上所述的各实施例所涉及的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,如上所述的各实施例所涉及的流程图中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。
基于同样的发明构思,本申请实施例还提供了一种用于实现上述所涉及的从上位机角度实施的模块升级方法的模块升级装置。该装置所提供的解决问题的实现方案与上述方法中所记载的实现方案相似,故下面所提供的一个或多个模块升级装置实施例中的具体限定可以参见上文中对于从上位机角度实施的模块升级方法的限定,在此不再赘述。
在一个实施例中,如图7所示,提供了一种模块升级装置,装置应用于模块升级***中、已配置第一升级程序的上位机;模块升级***还包括连接上位机的模块,以及连接上位机、且已配置第二升级程序的辅助升级设备;装置包括:
服务端执行单元710,用于执行第一升级程序包含的第一升级命令,获取模块对应的升级位置,并输出切换指令;切换指令用于指示模块切换至升级模式;
服务端升级单元720,用于当确认模块切换至升级模式,则创建服务端组件,并通过服务端组件和辅助升级设备的客户端组件,与辅助升级设备建立连接,以将来自辅助升级设备的固件升级包传输给处于升级模式的模块完成升级;客户端组件为第二升级程序包含的第二升级命令经辅助升级设备执行后创建得到;第二升级命令包含上位机的地址信息。
在其中一个实施例中,第一升级程序和第二升级程序属于同一个升级工具;装置还包括:
服务端解析单元,用于对获取的升级工具进行参数解析,得到升级参数;升级参数包含用于指示升级包信息的第一参数;
服务端导入单元,用于在升级参数不包含第二升级命令的情况下,导入升级工具以完成第一升级程序的配置。
在其中一个实施例中,服务端执行单元710,用于当升级参数包含用于指示固件升级端口的第二参数,则将固件升级端口确定为升级位置;以及用于当升级参数不包含第二参数,则在本地设备目录下,根据模块的识别标识寻找升级位置;识别标识包括供应商识别码和产品识别码。
在其中一个实施例中,切换指令用于指示模块从正常模式切换为升级模式;上位机的地址信息包括上位机的IP地址;服务端组件包括传输控制协议服务器进程,传输控制协议服务器进程为基于传输控制协议的main函数经上位机调用以在本地建立服务端套接字得到;客户端组件包括传输控制协议客户进程,传输控制协议客户进程为基于传输控制协议的main函数经辅助升级设备调用以在本地建立客户端套接字得到;
服务端升级单元720,用于运行传输控制协议服务器进程,进入等待状态,直至接收到辅助升级设备的连接请求;连接请求为IP地址经运行传输控制协议客户进程的辅助升级设备处理得到;以及根据连接请求,与辅助升级设备建立基于传输控制协议的通信连接,并打印用于表达成功建立连接的日志;
装置还包括:
服务端检查单元,用于在完成升级的情况下,确认模块是否由升级模式转换为正常模式。
基于同样的发明构思,本申请实施例还提供了一种用于实现上述所涉及的从辅助升级设备角度实施的模块升级方法的模块升级装置。该装置所提供的解决问题的实现方案与上述方法中所记载的实现方案相似,故下面所提供的一个或多个模块升级装置实施例中的具体限定可以参见上文中对于从辅助 升级设备角度实施的模块升级方法的限定,在此不再赘述。
在一个实施例中,如图8所示,提供了一种模块升级装置,装置应用于模块升级***中、已配置第二升级程序的辅助升级设备;模块升级***还包括连接辅助升级设备、且已配置第一升级程序的上位机,以及连接上位机的模块;装置包括:
客户端执行单元810,用于执行第一升级程序包含的第一升级命令,获取模块对应的升级位置,并输出切换指令;切换指令用于指示模块切换至升级模式;
客户端传输单元820,用于当确认模块切换至升级模式,则创建服务端组件,并通过服务端组件和辅助升级设备的客户端组件,与辅助升级设备建立连接,以将来自辅助升级设备的固件升级包传输给处于升级模式的模块完成升级;客户端组件为第二升级程序包含的第二升级命令经辅助升级设备执行后创建得到;第二升级命令包含上位机的地址信息。
在其中一个实施例中,第一升级程序和第二升级程序属于同一个升级工具;装置还包括:
客户端解析单元,用于对获取的升级工具进行参数解析,得到升级参数;升级参数包含用于指示升级包信息的第一参数;
客户端导入单元,用于在升级参数中包含第二升级命令的情况下,导入升级工具以完成第二升级程序的配置。
在其中一个实施例中,升级包信息包括升级包版本名称和升级包压缩格式;装置还包括:
客户端校验单元,基于升级包版本名称,检查升级路径,并检查获取的校验文件以进行校验;校验文件包括MD5文件;
客户端解压单元,在校验通过的情况下,确定获取的升级压缩包是否满足升级包压缩格式;当满足升级包压缩格式,则解压升级压缩包得到固件升级包。
在其中一个实施例中,上位机的地址信息包括上位机的IP地址;服务端组件包括传输控制协议服务器进程,传输控制协议服务器进程为基于传输控制协议的main函数经上位机调用以在本地建立服务端套接字得到;客户端组件包括传输控制协议客户进程,传输控制协议客户进程为基于传输控制协议的main函数经辅助升级设备调用以在本地建立客户端套接字得到;
客户端传输单元820,用于运行传输控制协议客户进程,根据IP地址输出连接请求;连接请求用于指示通过运行传输控制协议服务器进程已进入等待状态的上位机,建立基于传输控制协议的通信连接;以及用于在通信连接建立成功的情况下,通过相应的main函数发送固件升级包中的各文件,直至确定各文件发送完成,打印用于表达升级成功的日志。
上述模块升级装置中的各个单元可全部或部分通过软件、硬件及其组合来实现。上述各单元可以硬件形式内嵌于或独立于辅助升级设备中的处理器中,也可以以软件形式存储于辅助升级设备中的存储器中,以便于处理器调用执行以上各个单元对应的操作。
如在本申请中所使用的,术语“组件”、“模块”和“***”等旨在表示计算机相关的实体,它可以是硬件、硬件和软件的组台、软件、或者执行中的软件。例如,组件可以是但不限于是,在处理器上运行的进程、处理器、对象、可执行码、执行的线程、程序和或计算机。作为说明,运行在服务器上的应用程序和服务器都可以是组件。一个或多个组件可以驻留在进程和或执行的线程中,并且组件可以位于一个计算机内和或分布在两个或更多的计算机之间。
在一个实施例中,本申请还提供了一种模块升级***,***包括模块,已配置第一升级程序的上位机,以及已配置第二升级程序的辅助升级设备;上位机分别连接辅助升级设备、模块;其中:
上位机用于实现上述从上位机角度实施的模块升级方法的步骤;
辅助升级设备用于实现上述从辅助升级设备角度实施的模块升级方法的步骤。
在其中一个实施例中,上位机为嵌入式设备;辅助升级设备包括嵌入式设备已经Ping通的计算机设备;
模块(module)包括通信模组,通信模组连接嵌入式设备。
具体而言,本申请实施例中的嵌入式设备可以指用于连接模块的设备(例如,连接模块的客户终端设备);其中,嵌入式设备可以具有能够满足不同客户需求的设备形态;在一些示例中,嵌入式设备 可以为CPE(Customer Premise Equipmen,客户终端设备);在另一些示例中,嵌入式设备可以为电视盒子或机器人形态设备。进一步的,辅助升级设备可以指计算机设备。
在其中一个实施例中,通信模组包括5G模组;辅助升级设备可以包括运行Linux***的笔记本电脑。
具体的,如图9所示,模块升级***的预置条件可以包括:①一个内核版本为3.X/4.X/5.X的Linux***笔记本;②一块可以为通信模组的模块(module);③可连接模块(module)的嵌入式设备;④USB连接线;⑤笔记本和嵌入式设备之间可以Ping通。
进一步的,模块通过USB连接到嵌入式设备上,嵌入式设备和Linux笔记本电脑互相ping通,模块固件升级包和MD5文件存储在Linux笔记本上。
对于嵌入式设备,按照上述操作搭建好环境后,将Upgrade_Tool工具导入嵌入式设备中。执行“/upgrade_tool –p 9008”命令。执行命令后,工具会在/sys/bus/usb/devices下根据模块的VID和PID寻找模块的位置,找到模块后,会发送命令让模块从正常模式切换到升级模块式,切换完成后,会执行usb2tcp_main,创建Tcp Server后,等待Client连接。
对于Linux笔记本电脑,将模块的固件升级包、MD5文件和Upgrade_Tool工具拷贝到Linux笔记本上同一目录下;执行“./upgrade_tool –f./89610.1000.00.01.01.04.7z –p ip:9008”,参考表1可知,“-f”参数用于指定固件升级包的版本名称,此处升级包名称为89610.1000.00.01.01.04.7z;“-p”参数用于指定IP地址和端口号,此处为ip:9008,ip为嵌入式设备端ip。执行上述升级命令后Linux笔记本侧打印log,开始进行MD5文件校验,解压7z压缩包。接着进行到tcp_connect阶段,和嵌入式设备端建立连接。同时嵌入式设备端会打印log代表连接建立成功。连接建立成功后,笔记本电脑完成sahara_main,通过firehose_main对固件包中的文件进行传输,将每一个文件send到模块中。发送完成后,可以打印log表示升级成功。最后,可以查看升级完成后模块状态是否正常。
本申请在支持基本的本地升级功能的基础上,实现了远程升级的功能。通过-p参数跟不同的命令实现Socket Server与Socket Client的连接建立,实现升级包远程传输解决模块所连接设备端内存空间不足的问题。同时优化整个代码框架,编译生成所需要的文件只有Upgrade_Tool一个可执行文件,解决了旧的升级工具升级过程繁杂的问题。
用户的上位机设备内存空间不足,无法存储下模块固件升级包版本时,本申请Upgrade_Tool工具提供-p参数,可以完成远程升级,使用户可以利用远程升级的功能解决上位机设备无法存储模块固件升级包的问题。本申请Upgrade
_Tool升级工具升级流程简单,所需文件少,方便易操作,升级过程中不需要修改任何文件。对于用户来说保证了升级过程中的可控性,避免用户在升级过程中修改文件出错,导致升级失败。
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述模块升级方法的步骤。
在一个实施例中,提供了一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现上述模块升级方法的步骤。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-Only Memory,ROM)、磁带、软盘、闪存、光存储器、高密度嵌入式非易失性存储器、阻变存储器(ReRAM)、磁变存储器(Magnetoresistive Random Access Memory,MRAM)、铁电存储器(Ferroelectric Random Access Memory,FRAM)、相变存储器(Phase Change Memory,PCM)、石墨烯存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器等。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic Random Access Memory,DRAM)等。本申请所提供的各实施例中所涉及的数据库可包括关系型数据库和非关系型数据库中至 少一种。非关系型数据库可包括基于区块链的分布式数据库等,不限于此。本申请所提供的各实施例中所涉及的处理器可为通用处理器、中央处理器、图形处理器、数字信号处理器、可编程逻辑器、基于量子计算的数据处理逻辑器等,不限于此。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请的保护范围应以所附权利要求为准。
Claims (10)
- 一种模块升级方法,所述方法应用于模块升级***中、已配置第一升级程序的上位机;所述模块升级***还包括连接所述上位机的模块,以及连接所述上位机、且已配置第二升级程序的辅助升级设备;所述方法包括:执行所述第一升级程序包含的第一升级命令,获取所述模块对应的升级位置,并输出切换指令;所述切换指令用于指示所述模块切换至升级模式;当确认所述模块切换至所述升级模式,则创建服务端组件,并通过所述服务端组件和所述辅助升级设备的客户端组件,与所述辅助升级设备建立连接,以将来自所述辅助升级设备的固件升级包传输给处于所述升级模式的所述模块完成升级;所述客户端组件为所述第二升级程序包含的第二升级命令经所述辅助升级设备执行后创建得到;所述第二升级命令包含所述上位机的地址信息。
- 根据权利要求1所述的方法,其特征在于,所述第一升级程序和所述第二升级程序属于同一个升级工具;所述方法还包括:对获取的所述升级工具进行参数解析,得到升级参数;所述升级参数包含用于指示升级包信息的第一参数;在所述升级参数不包含所述第二升级命令的情况下,导入所述升级工具以完成所述第一升级程序的配置。
- 根据权利要求2所述的方法,其特征在于,所述执行所述第一升级程序包含的第一升级命令,获取所述模块对应的升级位置的步骤包括:当所述升级参数包含用于指示固件升级端口的第二参数,则将所述固件升级端口确定为所述升级位置;当所述升级参数不包含所述第二参数,则在本地设备目录下,根据所述模块的识别标识寻找所述升级位置;所述识别标识包括供应商识别码和产品识别码。
- 根据权利要求1至3任意一项所述的方法,其特征在于,所述切换指令用于指示所述模块从正常模式切换为所述升级模式;所述上位机的地址信息包括所述上位机的IP地址;所述服务端组件包括传输控制协议服务器进程,所述传输控制协议服务器进程为基于传输控制协议的main函数经所述上位机调用以在本地建立服务端套接字得到;所述客户端组件包括传输控制协议客户进程,所述传输控制协议客户进程为基于传输控制协议的main函数经所述辅助升级设备调用以在本地建立客户端套接字得到;所述通过所述服务端组件和所述辅助升级设备的客户端组件,与所述辅助升级设备建立连接的步骤包括:运行所述传输控制协议服务器进程,进入等待状态,直至接收到所述辅助升级设备的连接请求;所述连接请求为所述IP地址经运行所述传输控制协议客户进程的所述辅助升级设备处理得到;根据所述连接请求,与所述辅助升级设备建立基于传输控制协议的通信连接,并打印用于表达成功建立连接的日志;所述方法还包括:在完成升级的情况下,确认所述模块是否由所述升级模式转换为所述正常模式。
- 一种模块升级方法,所述方法应用于模块升级***中、已配置第二升级程序的辅助升级设备;所述模块升级***还包括连接所述辅助升级设备、且已配置第一升级程序的上位机,以及连接所述上位机的模块;所述方法包括:执行所述第二升级程序包含的第二升级命令,根据所述第二升级命令包含的所述上位机的地址信息,创建客户端组件;通过所述客户端组件和所述上位机的服务端组件,与所述上位机建立连接,以将固件升级包传输给处于升级模式的所述模块完成升级;所述服务端组件为所述上位机在确认所述模块响应切换指令切换至所述升级模式的情况下创建的;所述切换指令为所述第一升级程序包含的第一升级命令经所述上 位机执行后,获取到所述模块对应的升级位置的情况下输出的。
- 根据权利要求5所述的方法,其特征在于,所述第一升级程序和所述第二升级程序属于同一个升级工具;所述方法还包括:对获取的所述升级工具进行参数解析,得到升级参数;所述升级参数包含用于指示升级包信息的第一参数;在所述升级参数中包含所述第二升级命令的情况下,导入所述升级工具以完成所述第二升级程序的配置。
- 根据权利要求6所述的方法,其特征在于,所述升级包信息包括升级包版本名称和升级包压缩格式;所述方法还包括:基于所述升级包版本名称,检查升级路径,并检查获取的校验文件以进行校验;所述校验文件包括MD5文件;在校验通过的情况下,确定获取的升级压缩包是否满足所述升级包压缩格式;当满足所述升级包压缩格式,则解压所述升级压缩包得到所述固件升级包。
- 根据权利要求5至7任意一项所述的方法,其特征在于,所述上位机的地址信息包括所述上位机的IP地址;所述服务端组件包括传输控制协议服务器进程,所述传输控制协议服务器进程为基于传输控制协议的main函数经所述上位机调用以在本地建立服务端套接字得到;所述客户端组件包括传输控制协议客户进程,所述传输控制协议客户进程为基于传输控制协议的main函数经所述辅助升级设备调用以在本地建立客户端套接字得到;所述通过所述客户端组件和所述上位机的服务端组件,与所述上位机建立连接的步骤包括:运行所述传输控制协议客户进程,根据所述IP地址输出连接请求;所述连接请求用于指示通过运行所述传输控制协议服务器进程已进入等待状态的所述上位机,建立基于传输控制协议的通信连接;所述方法还包括:在所述通信连接建立成功的情况下,通过相应的main函数发送所述固件升级包中的各文件,直至确定各文件发送完成,打印用于表达升级成功的日志。
- 一种模块升级***,所述***包括模块,已配置第一升级程序的上位机,以及已配置第二升级程序的辅助升级设备;所述上位机分别连接所述辅助升级设备、所述模块;其中:所述上位机用于实现权利要求1至4中任一项所述的方法的步骤;所述辅助升级设备用于实现权利要求5至8中任一项所述的方法的步骤。
- 根据权利要求9所述的***,其特征在于,所述上位机为嵌入式设备;所述辅助升级设备包括所述嵌入式设备已经Ping通的计算机设备;所述模块包括通信模组,所述通信模组连接所述嵌入式设备。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210135403.1A CN114640584B (zh) | 2022-02-14 | 2022-02-14 | 模块升级方法和*** |
CN202210135403.1 | 2022-02-14 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023151372A1 true WO2023151372A1 (zh) | 2023-08-17 |
Family
ID=81946071
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/138272 WO2023151372A1 (zh) | 2022-02-14 | 2022-12-12 | 模块升级方法和*** |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN114640584B (zh) |
WO (1) | WO2023151372A1 (zh) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114640584B (zh) * | 2022-02-14 | 2023-11-24 | 西安广和通无线软件有限公司 | 模块升级方法和*** |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050257215A1 (en) * | 1999-09-22 | 2005-11-17 | Intermec Ip Corp. | Automated software upgrade utility |
CN106020884A (zh) * | 2016-05-20 | 2016-10-12 | 江苏华辉云控科技有限公司 | 网络摄像机***在线升级方法 |
CN111930396A (zh) * | 2020-06-29 | 2020-11-13 | 广西东信易联科技有限公司 | 一种基于notify机制的4G路由器中通讯模组的升级方法 |
CN113626057A (zh) * | 2021-08-30 | 2021-11-09 | 南京邮电大学 | 一种基于GigE Vision接口的相机远程固件升级***和方法 |
CN114640584A (zh) * | 2022-02-14 | 2022-06-17 | 西安广和通无线软件有限公司 | 模块升级方法和*** |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105933150A (zh) * | 2016-04-20 | 2016-09-07 | 努比亚技术有限公司 | Ota升级方法、装置及*** |
CN106301959B (zh) * | 2016-10-10 | 2019-04-30 | 烽火通信科技股份有限公司 | 基于windows和linux平台的网关批量升级方法及*** |
CN109144554B (zh) * | 2018-06-21 | 2022-07-08 | 深圳和而泰数据资源与云技术有限公司 | 固件升级方法、相关设备、***及介质 |
CN110650169A (zh) * | 2018-06-27 | 2020-01-03 | 视联动力信息技术股份有限公司 | 一种终端设备升级方法和装置 |
CN110716733A (zh) * | 2019-09-30 | 2020-01-21 | 四川九州电子科技股份有限公司 | 一种ont产品软件互升级方法 |
CN112118137B (zh) * | 2020-09-17 | 2023-04-28 | 上海闻泰电子科技有限公司 | 固件升级方法、装置、计算机设备和可读存储介质 |
CN112416391A (zh) * | 2020-11-16 | 2021-02-26 | 深圳市有方科技股份有限公司 | ***升级方法、装置、计算机设备和存储介质 |
CN112564956A (zh) * | 2020-11-30 | 2021-03-26 | 山东亚华电子股份有限公司 | 一种客户端的远程升级方法及设备、装置、存储介质 |
-
2022
- 2022-02-14 CN CN202210135403.1A patent/CN114640584B/zh active Active
- 2022-12-12 WO PCT/CN2022/138272 patent/WO2023151372A1/zh unknown
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050257215A1 (en) * | 1999-09-22 | 2005-11-17 | Intermec Ip Corp. | Automated software upgrade utility |
CN106020884A (zh) * | 2016-05-20 | 2016-10-12 | 江苏华辉云控科技有限公司 | 网络摄像机***在线升级方法 |
CN111930396A (zh) * | 2020-06-29 | 2020-11-13 | 广西东信易联科技有限公司 | 一种基于notify机制的4G路由器中通讯模组的升级方法 |
CN113626057A (zh) * | 2021-08-30 | 2021-11-09 | 南京邮电大学 | 一种基于GigE Vision接口的相机远程固件升级***和方法 |
CN114640584A (zh) * | 2022-02-14 | 2022-06-17 | 西安广和通无线软件有限公司 | 模块升级方法和*** |
Also Published As
Publication number | Publication date |
---|---|
CN114640584A (zh) | 2022-06-17 |
CN114640584B (zh) | 2023-11-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112165532B (zh) | 节点访问方法、装置、设备及计算机可读存储介质 | |
CN105765526B (zh) | 通过网络从远程磁盘镜像进行引导 | |
WO2017088388A1 (zh) | 应用的sdk的升级方法及*** | |
US20160306616A1 (en) | Firmware update by usb cc | |
US9864606B2 (en) | Methods for configurable hardware logic device reloading and devices thereof | |
US9348564B2 (en) | Intelligent device framework | |
JP7346606B2 (ja) | 画面共有処理方法、装置、機器及び記憶媒体 | |
KR101212872B1 (ko) | 동기화 방법 및 시스템 | |
CN104615455B (zh) | 一种atca架构的ipmc程序远程升级方法及装置 | |
US7246224B2 (en) | System and method to enable platform personality migration | |
US8904131B2 (en) | Automated migration to a new copy services target storage system to manage multiple relationships simultaneously while maintaining disaster recovery consistency | |
WO2019019864A1 (zh) | 嵌入式自助终端的通信***、方法及装置 | |
WO2023151372A1 (zh) | 模块升级方法和*** | |
CN111984261A (zh) | 编译方法与编译*** | |
WO2012058880A1 (zh) | 一种通过无线局域网对终端进行升级的方法和*** | |
WO2022111277A1 (zh) | 热插拔设备信息传输方法、计算机设备和可读介质 | |
WO2018107433A1 (zh) | 信息处理方法和装置 | |
US11385905B2 (en) | Managing boot device orders for computing devices | |
CN104570967B (zh) | 基于Android***的远程控制方法及*** | |
US9141321B1 (en) | Configurable printer server device | |
US10911547B2 (en) | Systems and methods for SMB monitor dialect | |
WO2017096889A1 (zh) | ***升降级的方法和装置 | |
CN115167874A (zh) | 自动驾驶软件镜像部署方法、装置、电子设备和可读介质 | |
WO2021203384A1 (zh) | 设备升级的方法、装置及存储介质 | |
WO2016095491A1 (zh) | 一种设备升级的方法及传送网设备 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22925723 Country of ref document: EP Kind code of ref document: A1 |