Equipment upgrading method and device, storage medium and electronic equipment
By dynamically adjusting the channel, transmission rate and transmission power, and segmenting and updating the upgrade packet, the problem of a single and fixed device upgrade mode cannot adapt to the variable network environment, improving the upgrade efficiency and success rate.
Patent Information
- Application Number
- CN202411191804.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-12-17
AI Technical Summary
The existing technology has failed to effectively adapt to the changing network environment during the equipment upgrade process, resulting in low upgrade efficiency.
By dynamically adjusting the target channel, transmission rate and transmission power, the data packet is divided into multiple data blocks, and the data block size, channel model and transmission rate are updated according to the received confirmation results to adapt to network changes.
It improves the success rate and efficiency of equipment upgrades, ensuring that it can still be upgraded stably and efficiently in a changing network environment.
Smart Images

Figure CN119149069A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a method and apparatus for upgrading a device, a storage medium, and an electronic device. Background Art
[0002] At present, when using OTA (over-the-air upgrade technology) to upgrade devices, a designated channel and a fixed transmission speed are usually used to transmit the upgrade data packet to the device to be upgraded. In other words, in the process of transmitting the upgrade data packet, the channel changes caused by network fluctuations and the variation of the transmission speed are not taken into account, resulting in poor stability and reliability of the device upgrade. In summary, there is a technical problem in the related technology that the device upgrade mode is single and fixed and cannot adapt to the changing network environment, resulting in low equipment upgrade efficiency.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide a device upgrade method and apparatus, a storage medium, and an electronic device to at least solve the technical problem that the device upgrade efficiency is low because the device upgrade mode is single and fixed and cannot adapt to a changing network environment.
[0005] According to one aspect of an embodiment of the present application, a device upgrade method is provided, comprising: in response to a device upgrade request, obtaining an upgrade data packet, wherein the device upgrade request is used to request an upgrade of the device to be upgraded, and the upgrade data packet is used to upgrade the device to be upgraded; determining a target channel model from at least one channel model, and determining a target transmission rate from at least one transmission rate, wherein the target channel model is used to specify a target channel for transmitting the upgrade data packet, and the target transmission rate represents a transmission rate of the upgrade data packet in the target channel; performing a partitioning operation on the upgrade data packet to obtain a group of first data blocks, wherein the size of the first data block and the target channel parameters of the target channel and the target transmission rate of the target channel are The method is related to the target transmission rate; sending the group of first data blocks to the device to be upgraded in sequence according to the block sequence number, and determining a first transmission confirmation result returned by the device to be upgraded, wherein the first transmission confirmation result is used to indicate whether the device to be upgraded has received each of the first data blocks in the group of first data blocks; when the first transmission confirmation result indicates that the number of times the first data blocks in the group of first data blocks that have not been received by the device to be upgraded meets a preset threshold, updating at least one of the size of the first data block, the target channel model and the target transmission rate, and sending the upgrade data packet according to the updated size of the first data block, the target channel model and the target transmission rate.
[0006] According to another aspect of an embodiment of the present application, there is also provided an upgrade device for a device, comprising: an acquisition module, for acquiring an upgrade data packet in response to a device upgrade request, wherein the device upgrade request is used to request an upgrade of the device to be upgraded, and the upgrade data packet is used to upgrade the device to be upgraded; a determination module, for determining a target channel model from at least one channel model, and determining a target transmission rate from at least one transmission rate, wherein the target channel model is used to specify a target channel for transmitting the upgrade data packet, and the target transmission rate represents a transmission rate of the upgrade data packet in the target channel; a division module, for performing a division operation on the upgrade data packet to obtain a set of first data blocks, wherein the size of the first data block and the target channel parameter of the target channel and the target transmission rate; a transmission module, used to send the group of first data blocks to the device to be upgraded in sequence according to the block sequence number, and determine the first transmission confirmation result returned by the device to be upgraded, wherein the first transmission confirmation result is used to indicate whether the device to be upgraded has received each of the first data blocks in the group of first data blocks; an update module, used to update the size of the first data block, the target channel model and at least one of the target transmission rate when the first transmission confirmation result indicates that the number of times the first data blocks in the group of first data blocks that have not been received by the device to be upgraded meets a preset threshold, and send the upgrade data packet according to the updated size of the first data block, the target channel model and the target transmission rate.
[0007] Optionally, the device is used to determine the target channel model from at least one channel model in the following manner: scanning available communication channels in the transmission environment where the device to be upgraded is located, wherein the available communication channels include the target transmission channel; determining the target channel model according to the communication status of the available communication channels, wherein the target channel parameters meet preset channel parameter conditions, and the communication status represents the channel parameters of the available communication channels.
[0008] Optionally, the device is used to determine the target transmission rate from at least one transmission rate in the following manner: sending test data to the device to be upgraded at the initial transmission rate; obtaining a transmission test result returned by the device to be upgraded, wherein the transmission test result includes a transmission bit error rate and a data reception strength of the test data; if the transmission test result meets a preset transmission condition, determining the initial transmission rate as the target transmission rate; if the transmission test result does not meet the preset transmission condition, updating the initial transmission rate and resending the test data until the transmission test result meets the preset transmission condition.
[0009] Optionally, the device is used to send the group of first data blocks to the device to be upgraded in sequence according to the block sequence number in the following manner to determine the first transmission confirmation result returned by the device to be upgraded: sending a target data block to the device to be upgraded, wherein the group of first data blocks includes the target data block; receiving a first response message sent by the device to be upgraded, wherein the first response message is used to indicate whether the target data block has been completed received; when the first response message indicates that the target data block has been completed received, determining the target block sequence number of the target data block, and adjusting a first response bitmap according to the target block sequence number, wherein the first response bitmap is used to mark whether each of the first data blocks has been completed received.
[0010] Optionally, the device is also used to: send a target data frame to the device to be upgraded, wherein the first data block is composed of at least one data frame, and the at least one data frame includes the target data frame; receive a second response message sent by the device to be upgraded, wherein the second response message is used to indicate whether the target data frame has been completed received, and the first response message includes the second response message; when the second response message indicates that the target data frame has been completed received, determine the target frame sequence number of the target data frame, and adjust the second response bitmap according to the target frame sequence number, wherein the second response bitmap is used to mark whether each data frame in the first data block has been completed received, and the first response bitmap includes the second response bitmap.
[0011] Optionally, the apparatus is used to update at least one of the size of the first data block, the target channel model and the target transmission rate, and send the upgrade data packet according to the updated size of the first data block, the target channel model and the target transmission rate in the following manner when the first transmission confirmation result indicates that the number of transmissions of the first data block in the group of first data blocks that is not received by the device to be upgraded meets a preset threshold, and send the upgrade data packet according to the updated size of the first data block, the target channel model and the target transmission rate: when the first transmission confirmation result indicates that the number of transmissions of the first data block in the group of first data blocks that is not received by the device to be upgraded meets a first preset threshold, update the size of the first data block from the first size to the second size; The upgrade data packet is divided into a second size to obtain a group of second data blocks; the group of second data blocks are sent to the device to be upgraded in sequence according to the block sequence numbers, and a second transmission confirmation result returned by the device to be upgraded is determined, wherein the second transmission confirmation result is used to indicate whether the device to be upgraded has received each of the second data blocks in the group of second data blocks; when the second transmission confirmation result indicates that the number of times that the upgrade data packet has not been received by the device to be upgraded meets a second preset threshold, at least one of the target channel model and the target transmission rate is updated, and the upgrade data packet is sent according to the updated target channel model and the target transmission rate.
[0012] Optionally, the device is used to determine the second size and update the size of the first data block from the first size to the second size, wherein the second size is smaller than the first size, when the first transmission confirmation result indicates that the number of transmission times of the data blocks in the group of first data blocks that are not received by the device to be upgraded meets a first preset threshold in the following manner: when the target channel parameter indicates that the target channel needs to meet a stability priority condition, determine the second size and update the size of the first data block from the first size to the second size, wherein the second size is larger than the first size.
[0013] Optionally, the device is also used to: obtain the upgrade data packet in response to the device upgrade request; determine the target channel model from the at least one channel model, determine the target transmission rate from the at least one transmission rate, and determine the target transmission power from at least one transmission power, wherein the target transmission power represents the transmission power of the upgrade data packet in the target channel; perform a division operation on the upgrade data packet to obtain a group of first data blocks, wherein the size of the first data block is related to the target transmission power; send the group of first data blocks to the device to be upgraded in sequence according to the block sequence number, and determine the first transmission confirmation result returned by the device to be upgraded; when the first transmission confirmation result indicates that the number of times the first data block in the group of first data blocks is not received by the device to be upgraded meets a preset threshold, update at least one of the size of the first data block, the target channel model, the target transmission rate and the target transmission power, and send the upgrade data packet according to the updated size of the first data block, the target channel model, the target transmission rate and the target transmission power.
[0014] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the upgrade method of the above-mentioned device when running.
[0015] According to another aspect of the embodiment of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the upgrade method of the above device.
[0016] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the device upgrade method through the computer program.
[0017] In an embodiment of the present application, an upgrade data packet is obtained in response to a device upgrade request, wherein the device upgrade request is used to request an upgrade of the device to be upgraded, and the upgrade data packet is used to upgrade the device to be upgraded; a target channel model is determined from at least one channel model, and a target transmission rate is determined from at least one transmission rate, wherein the target channel model is used to specify a target channel for transmitting the upgrade data packet, and the target transmission rate represents the transmission rate of the upgrade data packet in the target channel; a partitioning operation is performed on the upgrade data packet to obtain a group of first data blocks, wherein the size of the first data block is related to the target channel parameter of the target channel and the target transmission rate; a group of first data blocks are sent to the device to be upgraded in sequence according to the block sequence number, and a first transmission confirmation result returned by the device to be upgraded is determined, wherein the first transmission confirmation result is The confirmation result is used to indicate whether the device to be upgraded has received each first data block in a group of first data blocks; when the first transmission confirmation result indicates that the number of transmission times of the first data blocks in a group of first data blocks that have not been received by the device to be upgraded meets the preset threshold, at least one of the size of the first data block, the target channel model and the target transmission rate is updated, and the upgrade data packet is sent according to the updated size of the first data block, the target channel model and the target transmission rate. By dynamically adjusting the target channel, transmission rate and transmission power in the device upgrade process, the technical effect of adapting to a changing network environment and improving the success rate of the device upgrade is achieved, thereby solving the technical problem of low device upgrade efficiency due to the single and fixed device upgrade mode that cannot adapt to a changing network environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0019] Figure 1 is a schematic diagram of an application environment of an optional device upgrade method according to an embodiment of the present application;
[0020] Figure 2 is a flow chart of an optional device upgrade method according to an embodiment of the present application;
[0021] Figure 3 is a schematic diagram of an optional device upgrade method according to an embodiment of the present application;
[0022] Figure 4 is a schematic diagram of another optional device upgrade method according to an embodiment of the present application;
[0023] Figure 5 is a schematic structural diagram of an optional device upgrade apparatus according to an embodiment of the present application;
[0024] Figure 6 is a schematic structural diagram of an optional device upgrade product according to an embodiment of the present application;
[0025] Figure 7 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] The present application is described below in conjunction with embodiments:
[0029] According to one aspect of an embodiment of the present application, a method for upgrading a device is provided. Optionally, in this embodiment, the method for upgrading the device can be applied to: Figure 1 In the hardware environment composed of the server 101 and the terminal device 103 shown in FIG. Figure 1As shown, the server 101 is connected to the terminal 103 via a network, and can be used to provide services for the terminal device or the application installed on the terminal device. The application can be a video application, an instant messaging application, a browser application, an educational application, a game application, etc. A database 105 may be set up on the server or independently of the server to provide data storage services for the server 101, for example, a game data storage server. The above-mentioned network may include, but is not limited to, a wired network and a wireless network, wherein the wired network includes, for example, a local area network, a metropolitan area network, and a wide area network; the wireless network includes, for example, Bluetooth, WIFI, and other networks that implement wireless communication; the terminal device 103 may be a terminal configured with an application program, and may include, but is not limited to, at least one of the following: a mobile phone (such as an Android phone, an iOS phone, etc.), a laptop computer, a tablet computer, a PDA, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart TV, an intelligent voice interaction device, a smart home appliance, a vehicle-mounted terminal, an aircraft, a virtual reality (VR) terminal, an augmented reality (AR) terminal, a mixed reality (MR) terminal, and other computer devices; the above-mentioned server may be a single server, a server cluster consisting of multiple servers, or a cloud server.
[0030] Combination Figure 1 As shown, the upgrade method of the above-mentioned device can be executed by an electronic device, which can be a terminal device or a server. The upgrade method of the above-mentioned device can be implemented by the terminal device or the server respectively, or by the terminal device and the server together.
[0031] The above is only an example and is not specifically limited in this embodiment.
[0032] Optionally, as an optional implementation, as Figure 2 As shown, the upgrade method of the above device includes:
[0033] S202, in response to a device upgrade request, obtaining an upgrade data packet, wherein the device upgrade request is used to request an upgrade of the device to be upgraded, and the upgrade data packet is used to upgrade the device to be upgraded;
[0034] Optionally, in an embodiment of the present application, the above-mentioned device upgrade request includes but is not limited to requesting software updates, hardware improvements or security patches, etc., specifically, it may include the serial number or identifier of the device, current software and hardware version information, user preferences or specific upgrade requirements, etc. The above-mentioned upgrade data packet may include but is not limited to a new version of software or firmware for the device to be upgraded, security patches or vulnerability fixes, new configuration files or setting options, hardware upgrade guidance or instructions, and the above-mentioned device to be upgraded may include but is not limited to personal computers, laptops, tablets, smart phones, smart watches, other wearable devices, home automation equipment, smart appliances, industrial control systems, etc.
[0035] In an exemplary embodiment, it is assumed that there is a gateway for obtaining a device upgrade request initiated by an upgrade initiator, and then sending the device upgrade request to the device to be upgraded. If the device to be upgraded determines that the device can currently perform the upgrade operation and receive the upgrade data packet, it informs the gateway. The gateway then sends a response message to the upgrade initiator that the device to be upgraded can receive the upgrade data packet. The upgrade initiator sends the upgrade data packet to the gateway, and then the gateway forwards the upgrade data packet to the device to be upgraded.
[0036] S204, determining a target channel model from at least one channel model, and determining a target transmission rate from at least one transmission rate, wherein the target channel model is used to specify a target channel for transmitting the upgrade data packet, and the target transmission rate represents a transmission rate of the upgrade data packet in the target channel;
[0037] Optionally, in an embodiment of the present application, the above-mentioned channel model is used to express the anti-interference ability of the channel, and can also be understood as the interference model of the channel, including but not limited to a continuous strong interference model, an occasional interference model, a bottom noise lift model, an idle model, etc. The above-mentioned transmission rate can be flexibly set, including but not limited to determining by sending a test data packet in advance, for example, it refers to the amount of data transmitted per unit time, usually in bits per second (bps). The determination of the transmission rate is usually based on the following factors: channel bandwidth, the maximum frequency range that the channel can support; signal-to-noise ratio (SNR): the ratio of signal strength to background noise intensity; modulation mode, different modulation modes (such as QPSK, 16QAM, 64QAM, etc.), the above-mentioned target channel may include but is not limited to additive white Gaussian noise (AWGN) channel, Rayleigh channel, Rician channel, etc., and different channels correspond to different above-mentioned channel models.
[0038] In an exemplary embodiment, there are two channels, among which the interference situation of channel A can be expressed as a continuous strong interference model, and the interference situation of channel B can be expressed as an occasional interference model. Since the anti-interference ability of channel B is stronger than that of channel A, channel B is selected as the target channel model. Then, the target transmission rate is determined by sending a test data packet. It is assumed that the channel bandwidth B is preferably 20MHz and the signal-to-noise ratio SNR is preferably 30dB. In this case, the 64QAM modulation method is also used. According to the Shannon formula, the above-mentioned target transmission rate C=B\log_2(1+SNR) is obtained.
[0039] S206, performing a division operation on the upgrade data packet to obtain a group of first data blocks, wherein the size of the first data block is related to the target channel parameter and the target transmission rate of the target channel;
[0040] Optionally, in an embodiment of the present application, the above-mentioned target channel parameters may include but are not limited to channel bandwidth, signal-to-noise ratio, delay, etc.
[0041] In an exemplary embodiment, it is assumed that the size of the first data block is 10 data frames, and the upgrade data packet includes 100 data frames. Therefore, after receiving the upgrade data packet, the gateway may divide the upgrade data packet into 10 first data blocks.
[0042] It can be understood that when the channel anti-interference ability is strong and the target transmission rate is fast, the size of the first data block can be dynamically expanded. Conversely, if the channel anti-interference ability is weak and the target transmission rate is slow, the size of the first data block can be dynamically reduced to ensure that the integrity and consistency of the data are not destroyed, so as to improve the efficiency and reliability of the upgrade data packet transmission.
[0043] S208, sending a group of first data blocks to the device to be upgraded in sequence according to the block sequence numbers, and determining a first transmission confirmation result returned by the device to be upgraded, wherein the first transmission confirmation result is used to indicate whether the device to be upgraded has received each first data block in the group of first data blocks;
[0044] Optionally, in an embodiment of the present application, the block numbers of different first data blocks are different, and the first transmission confirmation result may include but is not limited to whether the data block is successfully received, the integrity check result of the data block, possible error codes or descriptions, etc.
[0045] In an exemplary embodiment, the above-mentioned first data blocks are sent to the device to be upgraded in sequence. After the device to be upgraded receives each first data block, it will check each data frame in the first data block and provide real-time feedback on the first transmission confirmation result corresponding to each first data block. The first transmission confirmation results corresponding to different first data blocks may be the same or different.
[0046] S210, when the first transmission confirmation result indicates that the number of transmission times of a first data block in a group of first data blocks that has not been received by the device to be upgraded meets a preset threshold, updates at least one of the size of the first data block, the target channel model and the target transmission rate, and sends the upgrade data packet according to the updated size of the first data block, the target channel model and the target transmission rate.
[0047] Exemplarily, in the process of sending the above-mentioned first data blocks in sequence according to the above-mentioned block sequence numbers, after the device to be upgraded receives each first data block, it will check each data frame in the first data block to determine whether there are any lost data frames. For example, if each first data block includes 10 consecutive data frames, if it is found that the 4th first data block is missing the 5th frame sequence number, the device to be upgraded will return the above-mentioned first transmission confirmation result corresponding to the first data block to the gateway in real time, including "the data frame with frame number 5 in the first data block with block number 4 is lost, requesting retransmission".
[0048] In an exemplary embodiment, Figure 3 is a schematic diagram of an optional device upgrade method according to an embodiment of the present application. The device upgrade method proposed in the present application can be applied to the OTA upgrade process of the device firmware of the vehicle system, etc. Figure 3 As shown, including but not limited to:
[0049] S302, collecting and analyzing channel interference models (the above-mentioned channel models): scanning the communication status of each communication channel, and analyzing each channel interference model, for example: continuous strong interference channel model, sporadic interference model, bottom noise lifting model, idle model and other channel model information.
[0050] S304, channel selection: based on the comparison and evaluation of all available channel interference models, the optimal communication model is selected. The upgrade initiator interacts with the device to be upgraded through a preset channel and switches to the target channel corresponding to the target channel model for subsequent OTA upgrade interaction.
[0051] S306, transmission rate and power matching: the upgrade initiator controls the gateway to negotiate with the device to be upgraded to initiate rate sniffing, and combines different interactive feedback to match the current optimal transmission rate and transmission power under the premise of meeting communication reliability.
[0052] S308, generate OTA upgrade strategy, model feature evaluation: determine the transmission effect and interference evaluation according to different transmission rates, different transmit powers, and different channels, classify the upgrade strategy according to different expected upgrade effects, and use the target channel, target transmit power, and target transmission rate as the final OTA upgrade strategy.
[0053] S310, according to the upgrade strategy tendency, adjust the data transmission strategy: divide the upgrade data packet into data blocks to obtain the above-mentioned group of first data blocks, wherein each first data block will contain multiple frames of data according to the block size, confirm the transmission result in blocks, and perform accurate retransmission based on the bitmap based on the transmission confirmation result. When the data transmission of a certain interval frame group fails, the gateway sets the frame sequence number lost in the interval frame group in the above-mentioned first response bitmap, and the device to be upgraded re-uploads the frame data that failed to be transmitted according to the set first response bitmap frame sequence number. Figure 4 It is a schematic diagram of another optional device upgrade method according to an embodiment of the present application. The bitmap representation is shown in Figure 4. Further, the size of the first data block is adjusted according to the current upgrade strategy tendency. When the upgrade strategy evaluates performance first, large data blocks are used to improve transmission performance. When the upgrade strategy evaluates stability first, small data blocks are used to improve transmission robustness.
[0054] S312, dynamic adjustment of OTA upgrade strategy: When the frequency of retransmission or failure during OTA upgrade under the current upgrade strategy reaches the set threshold, the upgrade strategy adjustment process is initiated to improve the communication stability of OTA upgrade. When the transmission is stable and reliable, the transmission strategy is adjusted to improve the model transmission efficiency. The upgrade strategy is based on the optimization of upgrade efficiency or transmission stability, and it conducts limited self-adjustment based on multiple dimensional parameters and data indicators. It takes into account the efficiency and reliability of OTA upgrades of the device to be upgraded.
[0055] Through the embodiments of the present application, it is ensured that when the OTA upgrade environment of the device to be upgraded is good, the upgrade process can be completed with higher communication efficiency, thereby improving the upgrade speed; when the OTA upgrade conditions of the device to be upgraded are not good, the stable upgrade strategy can be preferentially selected to complete the device upgrade; the upgrade strategy switching process is automatically completed, and the optimal upgrade strategy is automatically and dynamically adjusted to adapt. The OTA upgrade strategy can be adaptively adjusted through multiple dimensions such as channel, rate, interaction mechanism, and transmission power, so that the device to be upgraded has both higher upgrade efficiency and improved reliability of OTA upgrades in complex environments.
[0056] In another exemplary embodiment, the upgrade process of the above-mentioned device to be upgraded may include but is not limited to:
[0057] S1, the upgrade initiator initiates an OTA upgrade request for the device firmware to the device to be upgraded through the gateway;
[0058] S2: The gateway forwards the OTA upgrade request to device firmware A, and the gateway collects and analyzes the available channel models;
[0059] S3, the gateway and the device to be upgraded negotiate to determine the target channel model between the gateway and the device to be upgraded;
[0060] S4, the gateway and the device to be upgraded negotiate, using the test packet data to match the current optimal transmission rate (target transmission rate) and transmission power between the gateway and the device to be upgraded;
[0061] S5, the gateway determines the upgrade strategy based on the target channel, the current optimal transmission rate and the transmission power;
[0062] S6, the gateway first determines the size of each data block according to the target channel, the current optimal transmission rate and the transmission power, and divides the upgrade data packet according to the size of the data block;
[0063] S7, the gateway sends data blocks to the device to be upgraded in sequence, each data block has a data block sequence number;
[0064] S8, the device to be upgraded feeds back the transmission result (including the frame number of the lost data frame) to the gateway in real time, the gateway determines the data frame to be retransmitted according to the frame number, and queries whether there is data to be retransmitted in the local cache of the gateway last time, if so, the data to be retransmitted is directly retransmitted to the device to be upgraded, if not, the response bitmap (the flag bit of the frame number of the data to be retransmitted is set to 1) is sent to the upgrade initiator, the upgrade initiator sends the data to be retransmitted to the gateway based on the response bitmap, and the gateway retransmits the data to be retransmitted to the device to be upgraded;
[0065] S9, during the transmission process, the gateway adjusts the size of the data block in real time according to the data block reception quality (bit error rate, data loss rate, etc.) in the transmission confirmation result fed back by the device to be upgraded and the interference of the channel (signal-to-noise ratio). For example, at the first moment, it is determined that each data block contains 8 frames. At the second moment, due to the large channel interference and poor data block reception quality, the size of the remaining data blocks that have not been sent will be adjusted. For example, the data frames contained in the remaining data blocks are adjusted to 6 frames, thereby reducing the size of each data block and increasing the number of data blocks.
[0066] S10, the gateway presets a data block retransmission count threshold for each data block and an upgrade package retransmission count threshold for the entire upgrade package. If the data block retransmission count exceeds the data block retransmission count threshold, or the entire upgrade package retransmission count exceeds the upgrade package retransmission count threshold, execute the above S3 to S5 (redetermine the upgrade strategy).
[0067] Through the embodiment of the present application, an upgrade data packet is obtained in response to a device upgrade request, wherein the device upgrade request is used to request an upgrade of the device to be upgraded, and the upgrade data packet is used to upgrade the device to be upgraded; a target channel model is determined from at least one channel model, and a target transmission rate is determined from at least one transmission rate, wherein the target channel model is used to specify a target channel for transmitting the upgrade data packet, and the target transmission rate represents the transmission rate of the upgrade data packet in the target channel; a partitioning operation is performed on the upgrade data packet to obtain a group of first data blocks, wherein the size of the first data block is related to the target channel parameter of the target channel and the target transmission rate; a group of first data blocks are sent to the device to be upgraded in sequence according to the block sequence number, and a first transmission confirmation result returned by the device to be upgraded is determined, wherein the first transmission confirmation result is used to indicate the device to be upgraded. Whether the upgrade device has received each first data block in a group of first data blocks; when the first transmission confirmation result indicates that the number of transmission times of the first data blocks in a group of first data blocks that have not been received by the device to be upgraded meets the preset threshold, at least one of the size of the first data block, the target channel model and the target transmission rate is updated, and the upgrade data packet is sent according to the updated size of the first data block, the target channel model and the target transmission rate. By dynamically adjusting the target channel, transmission rate and transmission power in the device upgrade process, the purpose of optimizing the upgrade data transmission efficiency is achieved, thereby achieving the technical effect of adapting to a changing network environment and improving the success rate of device upgrades, and further solving the technical problem of low device upgrade efficiency due to the single and fixed device upgrade mode and the inability to adapt to a changing network environment.
[0068] As an optional scheme, the above-mentioned determination of the target channel model from at least one channel model includes: scanning the available communication channels in the transmission environment where the above-mentioned device to be upgraded is located, wherein the above-mentioned available communication channels include the above-mentioned target transmission channel; determining the above-mentioned target channel model according to the communication status of the above-mentioned available communication channels, wherein the above-mentioned target channel parameters meet preset channel parameter conditions, and the above-mentioned communication status represents the channel parameters of the above-mentioned available communication channels.
[0069] Optionally, in an embodiment of the present application, it may include but is not limited to scanning the above-mentioned available communication channels, collecting channel information, and obtaining channel parameters of the available communication channels, such as signal strength, channel width, channel occupancy, etc. The above-mentioned communication status refers to the anti-interference ability, signal stability, etc. of the available communication channels. The above-mentioned preset channel parameter conditions may include but are not limited to selecting the channel with the best anti-interference performance from the above-mentioned available communication channels as the target channel, etc.
[0070] In an exemplary embodiment, first, the gateway needs to scan all available communication channels in the transmission environment where the device to be upgraded is located. During the scanning process, the channel parameters of each available communication channel are collected, and the communication status of each channel is evaluated based on the collected channel parameters. Based on the evaluation results, a channel that meets the preset channel parameter conditions is selected as the target channel.
[0071] As an optional scheme, the above-mentioned determination of the target transmission rate from at least one transmission rate includes: sending test data to the above-mentioned device to be upgraded according to the initial transmission rate; obtaining the transmission test result returned by the above-mentioned device to be upgraded, wherein the above-mentioned transmission test result includes the transmission bit error rate and data reception strength of the above-mentioned test data; if the above-mentioned transmission test result meets the preset transmission condition, determining the above-mentioned initial transmission rate as the above-mentioned target transmission rate; if the above-mentioned transmission test result does not meet the above-mentioned preset transmission condition, updating the above-mentioned initial transmission rate and resending the above-mentioned test data until the above-mentioned transmission test result meets the above-mentioned preset transmission condition.
[0072] Optionally, in an embodiment of the present application, the test data may include but is not limited to 01 binary data, the transmission bit error rate indicates the proportion of data errors during the transmission process, and the data reception strength indicates the strength of the data signal received by the device to be upgraded.
[0073] In an exemplary embodiment, first, an initial transmission rate is set, and test data is sent to the device to be upgraded according to the initial transmission rate. The test data is used to evaluate the performance of the device at the current transmission rate. After receiving the test data, the device to be upgraded returns a transmission test result. The gateway compares the transmission test result with the preset transmission conditions. The preset transmission conditions may include an upper limit of the bit error rate and a lower limit of the data reception strength. If the transmission test result meets the preset transmission conditions, the current initial transmission rate is determined as the target transmission rate, indicating that the device to be upgraded can stably operate at this rate under the current conditions. If the transmission test result does not meet the preset transmission conditions, the initial transmission rate needs to be updated, indicating that the transmission rate needs to be reduced to reduce the bit error rate, or the transmission rate needs to be increased to enhance the data reception strength. Then, the test data is resent and a new transmission test result is obtained.
[0074] As an optional scheme, the above-mentioned group of first data blocks are sent to the above-mentioned device to be upgraded in sequence according to the block sequence number, and the first transmission confirmation result returned by the above-mentioned device to be upgraded is determined, including: sending the target data block to the above-mentioned device to be upgraded, wherein the above-mentioned group of first data blocks includes the above-mentioned target data block; receiving the first response message sent by the above-mentioned device to be upgraded, wherein the above-mentioned first response message is used to indicate whether the above-mentioned target data block has been completed received; when the above-mentioned first response message indicates that the above-mentioned target data block has been completed received, determining the target block sequence number of the above-mentioned target data block, and adjusting the first response bitmap according to the above-mentioned target block sequence number, wherein the above-mentioned first response bitmap is used to mark whether each of the above-mentioned first data blocks has been completed received.
[0075] Optionally, in an embodiment of the present application, the first response bitmap is a data structure used to mark whether each first data block has been received.
[0076] In an exemplary embodiment, first, a bitmap is created for each data block, and each bit in the bitmap corresponds to a frame in the data block. If the data frame is successfully transmitted, the corresponding bit is set to 0; if the data frame fails to be transmitted, the corresponding bit in the first response bitmap is set to 1.
[0077] As an optional scheme, the above method also includes: sending a target data frame to the above-mentioned device to be upgraded, wherein the above-mentioned first data block is composed of at least one data frame, and the above-mentioned at least one data frame includes the above-mentioned target data frame; receiving a second response message sent by the above-mentioned device to be upgraded, wherein the above-mentioned second response message is used to indicate whether the above-mentioned target data frame has been completed received, and the above-mentioned first response message includes the above-mentioned second response message; when the above-mentioned second response message indicates that the above-mentioned target data frame has been completed received, determining the target frame sequence number of the above-mentioned target data frame, and adjusting the second response bitmap according to the above-mentioned target frame sequence number, wherein the above-mentioned second response bitmap is used to mark whether each data frame in the above-mentioned first data block has been completed received, and the above-mentioned first response bitmap includes the above-mentioned second response bitmap.
[0078] Specifically, the data frames in the data block are sent to the device to be upgraded in sequence; after receiving each data block, the device to be upgraded checks the integrity and correctness of the data frame. If a data frame is found to have failed to be transmitted, the sequence number of the frame is recorded; according to the sequence number of the frame that failed to be transmitted recorded by the device to be upgraded, the corresponding bit in the first response bitmap is set to 1, and the second response bitmap is sent to the gateway; the gateway only retransmits the data frames that failed to be transmitted according to the frame sequence number set in the second response bitmap.
[0079] As an optional scheme, when the first transmission confirmation result indicates that the number of transmission times of the data blocks in the group of first data blocks that have not been received by the device to be upgraded meets a preset threshold, the size of the first data block, the target channel model and at least one of the target transmission rate are updated, and the upgrade data packet is sent according to the updated size of the first data block, the target channel model and the target transmission rate, including: when the first transmission confirmation result indicates that the number of transmission times of the first data blocks in the group of first data blocks that have not been received by the device to be upgraded meets a first preset threshold, the size of the first data block is updated from the first size to the second size; The method comprises the steps of: performing a division operation on the upgrade data packet according to the second size to obtain a group of second data blocks; sending the group of second data blocks to the device to be upgraded in sequence according to the block sequence numbers, and determining a second transmission confirmation result returned by the device to be upgraded, wherein the second transmission confirmation result is used to indicate whether the device to be upgraded has received each of the second data blocks in the group of second data blocks; when the second transmission confirmation result indicates that the number of times that the upgrade data packet has not been received by the device to be upgraded meets a second preset threshold, updating at least one of the target channel model and the target transmission rate, and sending the upgrade data packet according to the updated target channel model and the target transmission rate.
[0080] Optionally, in an embodiment of the present application, the first size is different from the second size.
[0081] In an exemplary embodiment, first, a group of data blocks (first data blocks) are sent to the device to be upgraded. After receiving the data blocks, the device to be upgraded will return a transmission confirmation result in real time. The transmission confirmation result indicates which data blocks in the first data blocks have not been successfully received. If the number of times the unreceived data blocks are sent reaches or exceeds a preset threshold (first preset threshold), the size of the first data block needs to be updated from the first size to the second size to improve the reliability of data transmission.
[0082] Furthermore, the upgrade data packet is re-divided according to the new size (second size) to obtain a group of new data blocks (second data blocks). Then, the second data blocks are sent to the device to be upgraded in the order of their block numbers, and the device is waited for to return a second transmission confirmation result. If the second transmission confirmation result indicates that the number of times the upgrade data packet has not been successfully received reaches or exceeds another preset threshold (second preset threshold), further adjustments are required. The target channel model and / or target transmission rate can also be updated, and the upgrade data packet is resent according to the updated channel model and transmission rate to adapt to changes in network conditions and improve the efficiency and reliability of data transmission.
[0083] Through the embodiments of the present application, the data transmission process is optimized by dynamically adjusting the size of the data block, the channel model and the transmission rate, ensuring that the data can be reliably transmitted to the device to be upgraded. The use of this adaptive upgrade strategy can improve the success rate of data transmission.
[0084] As an optional scheme, when the first transmission confirmation result indicates that the number of transmission times of the data blocks in the group of first data blocks that have not been received by the device to be upgraded meets the first preset threshold, the method includes: when the target channel parameter indicates that the target channel needs to meet the stability priority condition, determining the second size, and updating the size of the first data block from the first size to the second size, wherein the second size is smaller than the first size; when the target channel parameter indicates that the target channel needs to meet the performance priority condition, determining the second size, and updating the size of the first data block from the first size to the second size, wherein the second size is larger than the first size.
[0085] Optionally, in an embodiment of the present application, the above stability priority condition may include but is not limited to the target channel being in a high interference state, and the above stability priority condition may include but is not limited to the target channel being in a low interference state.
[0086] In an exemplary embodiment, the device to be upgraded confirms the data block sent by the gateway and returns the first transmission confirmation result to the gateway. If the number of times the unreceived data block is sent reaches this threshold, subsequent operations will be triggered, that is, when the target channel parameters indicate that the channel is in a high interference state, a new data block size (second size) is determined, which is smaller than the original size (first size), and the amount of data transmitted each time is reduced to reduce the probability of transmission failure due to interference. Conversely, when the target channel parameters indicate that the channel is in a low interference state, the system will increase the size of the data block (second size), which is larger than the original size (first size), to utilize the good conditions of the target channel and increase the amount of data transmitted each time to improve transmission efficiency.
[0087] As an optional solution, the method further includes: in response to the device upgrade request, obtaining the upgrade data packet; determining the target channel model from the at least one channel model, determining the target transmission rate from the at least one transmission rate, and determining the target transmission power from at least one transmission power, wherein the target transmission power represents the transmission power of the upgrade data packet in the target channel; performing a division operation on the upgrade data packet to obtain a group of first data blocks, wherein the size of the first data blocks is related to the target transmission power; sending the group of first data blocks to the device to be upgraded in sequence according to the block sequence number, and determining the first transmission confirmation result returned by the device to be upgraded; when the first transmission confirmation result indicates that the number of times the first data blocks in the group of first data blocks that have not been received by the device to be upgraded meet a preset threshold, updating at least one of the size of the first data block, the target channel model, the target transmission rate and the target transmission power, and sending the upgrade data packet according to the updated size of the first data block, the target channel model, the target transmission rate and the target transmission power.
[0088] Optionally, in an embodiment of the present application, the target transmission power may include but is not limited to the transmission power of a gateway, the transmission power of a device to be upgraded, etc.
[0089] In an exemplary embodiment, the upgrade initiator initiates an OTA upgrade request for the device firmware to the device to be upgraded via the gateway; the gateway forwards the OTA upgrade request to the device firmware A, and the gateway collects and analyzes the available channel models; the gateway and the device to be upgraded negotiate to determine the target channel model between the gateway and the device to be upgraded; the gateway and the device to be upgraded negotiate to use the test package data to match the current optimal transmission rate (target transmission rate) and transmission power between the gateway and the device to be upgraded; the gateway determines the upgrade strategy according to the target channel, the current optimal transmission rate and the transmission power; the gateway first determines the size of each data block according to the target channel, the current optimal transmission rate and the transmission power, and divides the upgrade data packet according to the data block size; the gateway sends data blocks to the device to be upgraded in sequence, and each data block has a data block sequence number.
[0090] Furthermore, the device to be upgraded feeds back the transmission result (including the frame number of the lost data frame) to the gateway in real time, and the gateway determines the data frame to be retransmitted according to the frame number, and queries whether there is data to be retransmitted in the local cache of the gateway last time. If so, the data to be retransmitted is directly retransmitted to the device to be upgraded. If not, the response bitmap (the flag bit of the frame number of the data to be retransmitted is set to 1) is sent to the upgrade initiator, and the upgrade initiator sends the data to be retransmitted to the gateway based on the response bitmap, and the gateway retransmits the data to be retransmitted to the device to be upgraded; during the transmission process, the gateway adjusts the size of the data block in real time according to the data block reception quality (bit error rate, data loss rate, etc.) in the transmission confirmation result fed back by the device to be upgraded and the interference situation (signal-to-noise ratio) of the channel; the gateway presets a data block retransmission number threshold for each data block and an upgrade package retransmission number threshold for the entire upgrade package. If the data block retransmission number exceeds the data block retransmission number threshold, or the entire upgrade package retransmission number exceeds the upgrade package retransmission number threshold, the above S3 to S5 (redetermine the upgrade strategy).
[0091] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0092] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0093] According to another aspect of the embodiments of the present application, there is also provided a device for upgrading a device for implementing the device upgrading method described above. Figure 5 As shown, the device comprises:
[0094] An acquisition module 502 is used to acquire an upgrade data packet in response to a device upgrade request, wherein the device upgrade request is used to request an upgrade of the device to be upgraded, and the upgrade data packet is used to upgrade the device to be upgraded;
[0095] A determination module 504 is used to determine a target channel model from at least one channel model, and to determine a target transmission rate from at least one transmission rate, wherein the target channel model is used to specify a target channel for transmitting the upgrade data packet, and the target transmission rate indicates a transmission rate of the upgrade data packet in the target channel;
[0096] A division module 506 is used to perform a division operation on the upgrade data packet to obtain a group of first data blocks, wherein the size of the first data block is related to the target channel parameter and the target transmission rate of the target channel;
[0097] A transmission module 508, configured to send a group of first data blocks to the device to be upgraded in sequence according to the block sequence number, and determine a first transmission confirmation result returned by the device to be upgraded, wherein the first transmission confirmation result is used to indicate whether the device to be upgraded has received each first data block in the group of first data blocks;
[0098] The update module 510 is used to update at least one of the size, target channel model and target transmission rate of the first data block when the first transmission confirmation result indicates that the number of transmission times of the first data block in a group of first data blocks that has not been received by the device to be upgraded meets a preset threshold, and send the upgrade data packet according to the updated size, target channel model and target transmission rate of the first data block.
[0099] As an optional scheme, the above-mentioned device is used to determine the target channel model from at least one channel model in the following manner: scanning the available communication channels in the transmission environment where the device to be upgraded is located, wherein the available communication channels include the target transmission channels; determining the target channel model according to the communication status of the available communication channels, wherein the target channel parameters meet the preset channel parameter conditions, and the communication status represents the channel parameters of the available communication channels.
[0100] As an optional scheme, the above-mentioned device is used to determine the target transmission rate from at least one transmission rate in the following manner: sending test data to the device to be upgraded according to the initial transmission rate; obtaining the transmission test result returned by the device to be upgraded, wherein the transmission test result includes the transmission bit error rate and data reception strength of the test data; when the transmission test result meets the preset transmission condition, determining the initial transmission rate as the target transmission rate; when the transmission test result does not meet the preset transmission condition, updating the initial transmission rate and resending the test data until the transmission test result meets the preset transmission condition.
[0101] As an optional scheme, the above-mentioned device is used to send a group of first data blocks to the device to be upgraded in sequence according to the block sequence number in the following manner, and determine the first transmission confirmation result returned by the device to be upgraded: send a target data block to the device to be upgraded, wherein a group of first data blocks includes the target data block; receive a first response message sent by the device to be upgraded, wherein the first response message is used to indicate whether the target data block has been completed received; when the first response message indicates that the target data block has been completed received, determine the target block sequence number of the target data block, and adjust the first response bitmap according to the target block sequence number, wherein the first response bitmap is used to mark whether each first data block has been completed received.
[0102] As an optional scheme, the above-mentioned device is also used to: send a target data frame to the device to be upgraded, wherein the first data block is composed of at least one data frame, and at least one data frame includes the target data frame; receive a second response message sent by the device to be upgraded, wherein the second response message is used to indicate whether the target data frame has been completed received, and the first response message includes the second response message; when the second response message indicates that the target data frame has been completed received, determine the target frame sequence number of the target data frame, and adjust the second response bitmap according to the target frame sequence number, wherein the second response bitmap is used to mark whether each data frame in the first data block has been completed received, and the first response bitmap includes the second response bitmap.
[0103] As an optional solution, the above-mentioned device is used to update at least one of the size of the first data block, the target channel model and the target transmission rate when the first transmission confirmation result indicates that the number of transmissions of the data block in a group of first data blocks that is not received by the device to be upgraded meets a preset threshold value, and send the upgrade data packet according to the updated size of the first data block, the target channel model and the target transmission rate in the following manner: when the first transmission confirmation result indicates that the number of transmissions of the first data block in a group of first data blocks that is not received by the device to be upgraded meets a first preset threshold value, update the size of the first data block from the first size to the second size; perform a division operation on the upgrade data packet according to the second size to obtain a group of second data blocks; send the group of second data blocks to the device to be upgraded in sequence according to the block sequence number, and determine the second transmission confirmation result returned by the device to be upgraded, wherein the second transmission confirmation result is used to indicate whether the device to be upgraded has received each second data block in the group of second data blocks; when the second transmission confirmation result indicates that the number of times the upgrade data packet is not received by the device to be upgraded meets a second preset threshold value, update at least one of the target channel model and the target transmission rate, and send the upgrade data packet according to the updated target channel model and the target transmission rate.
[0104] As an optional solution, the above-mentioned device is used to determine the second size and update the size of the first data block from the first size to the second size, wherein the second size is smaller than the first size, when the first transmission confirmation result indicates that the number of transmission times of a data block in a group of first data blocks that is not received by the device to be upgraded meets a first preset threshold value, in the following manner: when the target channel parameter indicates that the target channel needs to meet a stability priority condition, determine the second size and update the size of the first data block from the first size to the second size, wherein the second size is larger than the first size. When the target channel parameter indicates that the target channel needs to meet a performance priority condition, determine the second size and update the size of the first data block from the first size to the second size, wherein the second size is larger than the first size.
[0105] As an optional solution, the above-mentioned device is also used to: obtain an upgrade data packet in response to a device upgrade request; determine a target channel model from at least one channel model, determine a target transmission rate from at least one transmission rate, and determine a target transmission power from at least one transmission power, wherein the target transmission power represents the transmission power of the upgrade data packet in the target channel; perform a division operation on the upgrade data packet to obtain a group of first data blocks, wherein the size of the first data block is related to the target transmission power; send a group of first data blocks to the device to be upgraded in sequence according to the block sequence number, and determine a first transmission confirmation result returned by the device to be upgraded; when the first transmission confirmation result indicates that the number of transmissions of a first data block in a group of first data blocks that has not been received by the device to be upgraded meets a preset threshold, update at least one of the size of the first data block, the target channel model, the target transmission rate and the target transmission power, and send the upgrade data packet according to the updated size of the first data block, the target channel model, the target transmission rate and the target transmission power.
[0106] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0107] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0108] According to one aspect of the present application, a computer program product is provided. The computer program product includes a computer program.
[0109] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0110] Figure 6 The structure block diagram of a computer system for implementing an electronic device according to an embodiment of the present application is schematically shown.
[0111] It should be noted that Figure 6 The computer system 600 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0112] like Figure 6As shown, the computer system 600 includes a central processing unit 601 (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory 602 (ROM) or the program loaded from the storage part 608 to the random access memory 603 (RAM). Various programs and data required for system operation are also stored in the random access memory 603. The central processing unit 601, the read-only memory 602 and the random access memory 603 are connected to each other through a bus 604. An input / output interface 605 (Input / Output interface, i.e., I / O interface) is also connected to the bus 604.
[0113] The following components are connected to the input / output interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a local area network card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the input / output interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read therefrom is installed into the storage section 608 as needed.
[0114] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processor 601, various functions defined in the system of the present application are executed.
[0115] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processor 601, various functions provided by the embodiment of the present application are performed.
[0116] According to another aspect of the embodiment of the present application, an electronic device for implementing the upgrade method of the above device is also provided. The electronic device may be Figure 1 The terminal device or server shown in the figure. This embodiment is described by taking the electronic device as a terminal device as an example. Figure 7 As shown, the electronic device includes a memory 702 and a processor 704. The memory 702 stores a computer program, and the processor 704 is configured to execute the steps in any of the above method embodiments through the computer program.
[0117] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0118] Optionally, in this embodiment, the above-mentioned processor can be configured to execute the methods in each embodiment of the present application through a computer program.
[0119] Alternatively, a person skilled in the art may understand that: Figure 7 The structure shown is for illustration only. Figure 7 The structure of the electronic device is not limited. Figure 7 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 7 Different configurations shown.
[0120] Among them, the memory 702 can be used to store software programs and modules, such as the program instructions / modules corresponding to the device upgrade method and device in the embodiment of the present application. The processor 704 executes various functional applications and data processing by running the software programs and modules stored in the memory 702, that is, realizing the above-mentioned device upgrade method. The memory 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 702 may further include a memory remotely located relative to the processor 704, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 702 can be specifically, but not limited to, used to store information such as upgrade data packets. As an example, such as Figure 7 As shown, the memory 702 may include, but is not limited to, the acquisition module 502, determination module 504, division module 506, transmission module 508, and update module 510 in the upgrade device of the device. In addition, other module units in the upgrade device of the device may also be included but are not limited to, which will not be repeated in this example.
[0121] Optionally, the transmission device 706 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 706 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 706 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0122] In addition, the electronic device further comprises: a display 708 for displaying the first transmission confirmation result; and a connection bus 710 for connecting various module components in the electronic device.
[0123] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. The nodes may form a peer-to-peer network, and any form of computing device, such as a server, terminal or other electronic device, may become a node in the blockchain system by joining the peer-to-peer network.
[0124] According to one aspect of the present application, a computer-readable storage medium is provided, and a processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the device upgrade method provided in various optional implementations of the upgrade aspects of the above-mentioned device.
[0125] Optionally, in this embodiment, the above-mentioned computer-readable storage medium can be configured to store data for executing the methods in various embodiments of the present application.
[0126] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0127] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0128] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for one or more electronic devices to execute all or part of the steps of the methods described in each embodiment of the present application.
[0129] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0130] In the several embodiments provided in the present application, it should be understood that the disclosed application can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0131] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0132] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0133] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for upgrading a device, characterized in that: include: In response to a device upgrade request, acquiring an upgrade data packet, wherein the device upgrade request is used to request an upgrade of the device to be upgraded, and the upgrade data packet is used to upgrade the device to be upgraded; Determine a target channel model from at least one channel model, and determine a target transmission rate from at least one transmission rate, wherein the target channel model is used to specify a target channel for transmitting the upgrade data packet, and the target transmission rate represents a transmission rate of the upgrade data packet in the target channel; Performing a division operation on the upgrade data packet to obtain a group of first data blocks, wherein the size of the first data block is related to the target channel parameter of the target channel and the target transmission rate; Sending the group of first data blocks to the device to be upgraded in sequence according to the block sequence numbers, and determining a first transmission confirmation result returned by the device to be upgraded, wherein the first transmission confirmation result is used to indicate whether the device to be upgraded has received each of the first data blocks in the group of first data blocks; When the first transmission confirmation result indicates that the number of times the first data blocks in the group of first data blocks are sent but not received by the device to be upgraded meets a preset threshold, at least one of the size of the first data block, the target channel model and the target transmission rate is updated, and the upgrade data packet is sent according to the updated size of the first data block, the target channel model and the target transmission rate.
2. The method according to claim 1, characterized in that The determining of the target channel model from at least one channel model comprises: Scanning available communication channels in a transmission environment where the device to be upgraded is located, wherein the available communication channels include the target transmission channel; The target channel model is determined according to a communication state of the available communication channel, wherein the target channel parameter satisfies a preset channel parameter condition, and the communication state represents a channel parameter of the available communication channel.
3. The method according to claim 1, characterized in that Determining the target transmission rate from at least one transmission rate includes: Sending test data to the device to be upgraded at an initial transmission rate; Acquire a transmission test result returned by the device to be upgraded, wherein the transmission test result includes a transmission bit error rate and data reception strength of the test data; In the case where the transmission test result meets the preset transmission condition, determining the initial transmission rate as the target transmission rate; In the case that the transmission test result does not meet the preset transmission condition, the initial transmission rate is updated, and the test data is resent until the transmission test result meets the preset transmission condition.
4. The method according to claim 1, characterized in that The sending the group of first data blocks to the device to be upgraded in sequence according to the block sequence numbers, and determining a first transmission confirmation result returned by the device to be upgraded, comprises: Sending a target data block to the device to be upgraded, wherein the group of first data blocks includes the target data block; Receiving a first response message sent by the device to be upgraded, wherein the first response message is used to indicate whether the target data block has been received; When the first response message indicates that the target data block has been received, the target block sequence number of the target data block is determined, and the first response bitmap is adjusted according to the target block sequence number, wherein the first response bitmap is used to mark whether each of the first data blocks has been received.
5. The method according to claim 4, characterized in that The method further comprises: Sending a target data frame to the device to be upgraded, wherein the first data block is composed of at least one data frame, and the at least one data frame includes the target data frame; Receiving a second response message sent by the device to be upgraded, wherein the second response message is used to indicate whether the target data frame has been received, and the first response message includes the second response message; When the second response message indicates that the target data frame has been received, the target frame sequence number of the target data frame is determined, and the second answer bitmap is adjusted according to the target frame sequence number, wherein the second answer bitmap is used to mark whether each data frame in the first data block has been received, and the first answer bitmap includes the second answer bitmap.
6. The method according to claim 1, characterized in that The method of updating at least one of the size of the first data block, the target channel model, and the target transmission rate, and sending the upgrade data packet according to the updated size of the first data block, the target channel model, and the target transmission rate, when the first transmission confirmation result indicates that the number of transmission times of the data block in the group of first data blocks that is not received by the device to be upgraded meets a preset threshold, comprises: If the first transmission confirmation result indicates that the number of times the first data blocks in the group of first data blocks are sent but not received by the device to be upgraded meets a first preset threshold, updating the size of the first data blocks from the first size to the second size; Performing a division operation on the upgrade data packet according to a second size to obtain a group of second data blocks; Sending the group of second data blocks to the device to be upgraded in sequence according to the block sequence numbers, and determining a second transmission confirmation result returned by the device to be upgraded, wherein the second transmission confirmation result is used to indicate whether the device to be upgraded has received each of the second data blocks in the group of second data blocks; When the second transmission confirmation result indicates that the number of times the upgrade data packet has not been received by the device to be upgraded meets a second preset threshold, at least one of the target channel model and the target transmission rate is updated, and the upgrade data packet is sent according to the updated target channel model and the target transmission rate.
7. The method according to claim 6, characterized in that The method further comprises: when the first transmission confirmation result indicates that the number of times that the data blocks in the group of first data blocks that are not received by the device to be upgraded meet a first preset threshold value, comprising: When the target channel parameter indicates that the target channel needs to satisfy a stability priority condition, determining the second size, and updating the size of the first data block from the first size to the second size, wherein the second size is smaller than the first size; When the target channel parameter indicates that the target channel needs to meet a performance priority condition, the second size is determined, and the size of the first data block is updated from the first size to the second size, wherein the second size is larger than the first size.
8. The method according to claim 1, characterized in that: The method further comprises: In response to the device upgrade request, obtaining the upgrade data packet; Determining the target channel model from the at least one channel model, determining the target transmission rate from the at least one transmission rate, and determining the target transmission power from at least one transmission power, wherein the target transmission power represents the transmission power of the upgrade data packet in the target channel; Performing a division operation on the upgrade data packet to obtain a group of first data blocks, wherein the size of the first data blocks is related to the target transmit power; Sending the group of first data blocks to the device to be upgraded in sequence according to the block sequence numbers, and determining the first transmission confirmation result returned by the device to be upgraded; When the first transmission confirmation result indicates that the number of times the first data block in the group of first data blocks is sent but not received by the device to be upgraded meets a preset threshold, at least one of the size of the first data block, the target channel model, the target transmission rate and the target transmission power is updated, and the upgrade data packet is sent according to the updated size of the first data block, the target channel model, the target transmission rate and the target transmission power.
9. An equipment upgrade device, characterized in that: include: An acquisition module, configured to acquire an upgrade data packet in response to a device upgrade request, wherein the device upgrade request is used to request an upgrade of the device to be upgraded, and the upgrade data packet is used to upgrade the device to be upgraded; a determination module, configured to determine a target channel model from at least one channel model, and to determine a target transmission rate from at least one transmission rate, wherein the target channel model is used to specify a target channel for transmitting the upgrade data packet, and the target transmission rate represents a transmission rate of the upgrade data packet in the target channel; a partitioning module, configured to perform a partitioning operation on the upgrade data packet to obtain a group of first data blocks, wherein the size of the first data blocks is related to a target channel parameter of the target channel and the target transmission rate; a transmission module, configured to send the group of first data blocks to the device to be upgraded in sequence according to the block sequence numbers, and determine a first transmission confirmation result returned by the device to be upgraded, wherein the first transmission confirmation result is used to indicate whether the device to be upgraded has received each of the first data blocks in the group of first data blocks; An update module is used to update at least one of the size of the first data block, the target channel model and the target transmission rate when the first transmission confirmation result indicates that the number of transmission times of the first data block in the group of first data blocks that has not been received by the device to be upgraded meets a preset threshold, and send the upgrade data packet according to the updated size of the first data block, the target channel model and the target transmission rate.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein the computer program can be executed by an electronic device to perform the method described in any one of claims 1 to 8.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 8 are implemented.
12. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 8 through the computer program.
Citation Information
Cited By
Remote OTA upgrading method and system based on distributed networking verification
CN119402351A
Remote OTA upgrade method and system based on distributed networking verification
CN119402351B
Equipment batch upgrading method and system based on carousel, upgrader and medium
CN119806600A
Carousel-based Device Batch Upgrade Method, System, Upgrader and Medium
CN119806600B
