Intelligent remote upgrading method and device, equipment and storage medium
By determining the upgrade mode based on the location information obtained by the heartbeat packet and the device status score, and introducing direct upgrade and block upgrade modes in the remote upgrade of the vending machine, the upgrade interruption problem caused by network instability is solved and the stability and efficiency of the upgrade is improved.
Patent Information
- Application Number
- CN202510317314.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-18
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2045-03-18
AI Technical Summary
During the remote upgrade process, the vending machine cannot communicate normally with the server due to unstable network signals, interruptions or insufficient network bandwidth, and cannot obtain upgrade files or instructions, hindering the upgrade process.
The target device's location information and device status score are obtained through the heartbeat packet to determine the target upgrade mode. If it is the first upgrade mode, the upgrade instructions and packets are directly sent to the device; if it is the second upgrade mode, the upgrade packets are sent to the edge server for block processing, and the upgrade instructions and block files are sent to the device through the edge server.
Improve the stability and flexibility of remote upgrades, ensure that the upgrade process meets the actual equipment needs, avoids unnecessary interruptions or failures, reduces maintenance costs and improves operational efficiency.
Smart Images

Figure CN119854286A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure belongs to the technical field of remote upgrade, and more specifically, to an intelligent remote upgrade method and device, equipment, and storage medium. Background Art
[0002] As the application scenarios of vending machines continue to expand and their functions become increasingly rich, the need for software and firmware upgrades is becoming more urgent to improve user experience and improve operational management. For example, the expansion of payment methods from single cash payment to mobile payment requires corresponding system upgrade support.
[0003] However, vending machines are usually distributed in various places with complex network environments. When preparing for upgrades, network signals may be unstable, interrupted, or the network bandwidth may be insufficient. This leads to poor stability and causes the vending machines to be unable to communicate normally with the server and obtain upgrade files or instructions, hindering the upgrade process. Summary of the invention
[0004] The purpose of the present disclosure is to provide an intelligent remote upgrade method and device, equipment, and storage medium to improve the stability of remote upgrades of vending machines.
[0005] A first aspect of the embodiments of the present disclosure provides an intelligent remote upgrade method, including: Determine the location information and device status score of the target device based on the heartbeat packet of the target device; determine the target upgrade mode based on the location information and device status score of the target device; If the target upgrade mode is the first upgrade mode, sending a first device upgrade instruction and an upgrade package to the target device; the first device upgrade instruction is used to instruct the target device to upgrade using the upgrade package; If the target upgrade mode is the second upgrade mode, the second device upgrade instruction and the upgrade package are sent to the edge server; the second device upgrade instruction is used to instruct the edge server to process the upgrade package in blocks to obtain multiple upgrade block files, and is also used to instruct the edge server to send the second device upgrade instruction and the multiple upgrade block files to the target device; the second device upgrade instruction is also used to instruct the target device to upgrade using multiple upgrade block files.
[0006] A second aspect of the embodiments of the present disclosure provides an intelligent remote upgrade device, including: An upgrade mode determination module, used to determine the location information and device status score of the target device based on the heartbeat packet of the target device; determine the target upgrade mode based on the location information and device status score of the target device; A first upgrade module, configured to send a first device upgrade instruction and an upgrade package to a target device if the target upgrade mode is a first upgrade mode; the first device upgrade instruction is used to instruct the target device to upgrade using the upgrade package; The second upgrade module is used to send the second device upgrade instruction and the upgrade package to the edge server if the target upgrade mode is the second upgrade mode; the second device upgrade instruction is used to instruct the edge server to process the upgrade package in blocks to obtain multiple upgrade block files, and is also used to instruct the edge server to send the second device upgrade instruction and the multiple upgrade block files to the target device; the second device upgrade instruction is also used to instruct the target device to upgrade using multiple upgrade block files.
[0007] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of the above-mentioned intelligent remote upgrade method when executing the computer program.
[0008] According to a fourth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned intelligent remote upgrade method are implemented.
[0009] The beneficial effects of an intelligent remote upgrade method, device, equipment, and storage medium provided by the embodiments of the present disclosure are: On the one hand, by obtaining the location information and device status score of the target device through the heartbeat packet, it is possible to accurately determine the real-time status and environment of the device, providing data support for formulating appropriate upgrade strategies. The target upgrade mode determined based on this information can ensure that the upgrade process is more in line with the actual needs of the device and avoid unnecessary upgrade interruptions or failures.
[0010] On the other hand, the introduction of two upgrade modes, namely direct upgrade and block upgrade through edge servers, enhances the flexibility of upgrade. In the first upgrade mode, the upgrade process is simple and efficient; while in the second upgrade mode, the transfer and processing of edge servers can effectively reduce the burden on remote servers, while adapting to scenarios with unstable networks or limited device performance, ensuring smooth transmission of upgrade packages and successful upgrade of devices. Considering the issue of network bandwidth, block processing of upgrade packages can effectively reduce the pressure of data transmission.
[0011] In summary, the embodiments of the present disclosure not only improve the stability of remote upgrades, but also ensure the smooth operation of equipment such as vending machines through flexible upgrade strategies, reduce maintenance costs, and improve operational efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0013] Figure 1 A flowchart of an intelligent remote upgrade method provided by an embodiment of the present disclosure; Figure 2 A structural block diagram of an intelligent remote upgrade device provided by an embodiment of the present disclosure; Figure 3 A schematic block diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0014] In the following description, specific details such as specific system structures and technologies are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present disclosure. However, it should be clear to those skilled in the art that the present disclosure may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obstructing the description of the present disclosure with unnecessary details.
[0015] In order to make the purpose, technical solutions and advantages of the present disclosure more clear, specific embodiments will be described below in conjunction with the accompanying drawings.
[0016] Please refer to Figure 1 , Figure 1 This is a flow chart of an intelligent remote upgrade method provided by an embodiment of the present disclosure. The method may include S101 to S103.
[0017] S101: Determine the location information and device status score of the target device based on the heartbeat packet of the target device. Determine the target upgrade mode based on the location information and device status score of the target device.
[0018] In this embodiment, before determining the location information and the device status score of the target device based on the heartbeat packet of the target device, the following is further included: A version check instruction is sent to all target devices in the target area based on the version upgrade instruction and the device information base.
[0019] The version check instruction is used to instruct all target devices in the target area to send a heartbeat packet to the remote server.
[0020] In this embodiment, the version upgrade instruction is initiated by the remote server and is used to trigger the target area device to perform version check and upgrade process. The version upgrade instruction may include the upgraded version number, upgrade content description, etc. The device information library is a database that stores information related to all vending machine devices in the target area, including basic information and status information of the device. The target area is a designated geographical area, including the range of devices that need to be version checked and upgraded. The target upgrade mode is a different upgrade method determined according to the location information and device status score of the target device.
[0021] After the remote server prepares the upgrade package and confirms that it is to be upgraded, it will generate a version check instruction and send it to all target devices in the target area to inform the devices to perform a version check. A heartbeat packet refers to a data packet sent by a target device to a remote server to indicate the online status of the device. The heartbeat packet can contain the device's location information, device status information, network environment information, and current version number. The device status score is used to evaluate the health status and upgrade feasibility of the device. The calculation of the device status score may involve the device's hardware performance, network stability, battery power, device idle status, etc.
[0022] In this embodiment, after receiving the version upgrade instruction, the remote server filters out all target devices in the target area from the device information library. The remote server sends a version check instruction to all target devices in the target area. After receiving the version check instruction, the target device sends a heartbeat packet to the remote server, which includes the device's location information, status information, and current version number. The remote server parses the device's location information based on the received heartbeat packet, and calculates the device status score based on the device's status information. The remote server selects an appropriate target upgrade mode based on the target device's location information and device status score. According to the target upgrade mode, the remote server sends the corresponding upgrade instruction and upgrade package to the target device or edge server to complete the device upgrade.
[0023] S102: If the target upgrade mode is the first upgrade mode, a first device upgrade instruction and an upgrade package are sent to the target device. The first device upgrade instruction is used to instruct the target device to upgrade using the upgrade package.
[0024] In this embodiment, the first upgrade mode is direct upgrade, which is suitable for situations where the device is in good condition and the network environment is stable. The first device upgrade instruction is sent by the remote server to the target device, and is an instruction for triggering the device to start the upgrade operation. The first device upgrade instruction may include the version number of the upgrade package, the specific operation steps of the upgrade, the time requirement for the upgrade, etc. The upgrade package refers to a file collection of the new version of the target device software or system, including code files, configuration files, etc. The parameters may include the size of the upgrade package, the check code, etc. The check code is used to ensure that the upgrade package is not damaged during the transmission process.
[0025] Exemplarily, the remote server determines that the first upgrade mode is suitable based on the location information and device status score of the target device. The remote server generates a first device upgrade instruction and prepares a corresponding upgrade package. The first device upgrade instruction specifies the detailed upgrade operation process of the target device. The remote server sends the first device upgrade instruction and the upgrade package to the target device. During the sending process, a suitable transmission protocol is used to ensure the integrity and accuracy of the data.
[0026] After receiving the instruction and upgrade package, the target device will verify the verification code of the upgrade package, and then use the upgrade package to upgrade itself according to the requirements in the first device upgrade instruction, such as overwriting old files, updating system configuration, etc. After the upgrade is completed, it will perform self-check and restart.
[0027] S103: If the target upgrade mode is the second upgrade mode, the second device upgrade instruction and the upgrade package are sent to the edge server. The second device upgrade instruction is used to instruct the edge server to process the upgrade package in blocks to obtain multiple upgrade block files, and is also used to instruct the edge server to send the second device upgrade instruction and the multiple upgrade block files to the target device. The second device upgrade instruction is also used to instruct the target device to upgrade using the multiple upgrade block files.
[0028] In this embodiment, sending the second device upgrade instruction and the upgrade package to the edge server includes: An edge server corresponding to the target device is determined based on the location information of the target device.
[0029] The second device upgrade instruction and the upgrade package are sent to the edge server corresponding to the target device.
[0030] In this embodiment, the second upgrade mode is an upgrade strategy adopted when the network environment is not good or the device status is unstable. The edge server performs block processing to reduce the risk of upgrade package transmission. The second device upgrade instruction may include the upgrade package version number, block size setting, unique identification of the target device, upgrade sequence and operation steps. The edge server refers to a network node deployed close to the target device, which is used to share the pressure of the remote server and optimize data transmission. The upgrade block file may include its own number, the version number of the upgrade package to which it belongs, and the data content.
[0031] In this embodiment, the remote server determines that the target device is suitable for the second upgrade mode based on the location information and device status score of the target device. The edge server closest to the target device is selected based on the location information of the target device. The remote server sends the second device upgrade instruction and the upgrade package to the edge server. After receiving the upgrade package, the edge server divides the upgrade package into blocks according to the second device upgrade instruction, generates multiple upgrade block files, and then sends the second device upgrade instruction and the multiple upgrade block files to the target device. After receiving the upgrade package, the target device uses these upgrade block files to upgrade according to the upgrade sequence and operation steps in the second device upgrade instruction.
[0032] Exemplarily, the remote server can maintain a mapping table of device locations and edge servers. When it is determined that the target device is applicable to the second upgrade mode, the corresponding edge server address is searched in the mapping table according to the target device location information. The remote server uses a network transmission protocol such as TCP to send the second device upgrade instruction and upgrade package to the selected edge server. After the edge server receives the second device upgrade instruction and upgrade package, it parses the block size parameter in the second device upgrade instruction, divides the upgrade package into multiple upgrade block files according to the block size parameter, and numbers each upgrade block file. The edge server sends the second device upgrade instruction and multiple numbered upgrade block files to the target device. After receiving it, the target device verifies and integrates the upgrade block files according to the upgrade sequence and operation steps in the second device upgrade instruction to complete the upgrade operation.
[0033] From the above, we can conclude that, on the one hand, obtaining the location information and device status score of the target device through the heartbeat packet can accurately determine the real-time status and environment of the device, providing data support for formulating appropriate upgrade strategies. The target upgrade mode determined based on this information can ensure that the upgrade process is more in line with the actual needs of the device and avoid unnecessary upgrade interruptions or failures.
[0034] On the other hand, the introduction of two upgrade modes, namely direct upgrade and block upgrade through edge servers, greatly enhances the flexibility of upgrades. In the first upgrade mode, the upgrade process is simple and efficient; while in the second upgrade mode, the transfer and processing of edge servers can effectively reduce the burden on remote servers, while adapting to scenarios with unstable networks or limited device performance, ensuring smooth transmission of upgrade packages and successful upgrades of devices. Considering the issue of network bandwidth, block processing of upgrade packages can effectively reduce the pressure of data transmission.
[0035] In summary, this embodiment not only improves the stability of remote upgrades, but also ensures the smooth operation of equipment such as vending machines through flexible upgrade strategies, reduces maintenance costs, and improves operational efficiency.
[0036] In one embodiment of the present disclosure, determining a target upgrade mode based on location information and a device status score of a target device includes: If the location information of the target device belongs to the first area, the target upgrade mode is determined to be the second upgrade mode.
[0037] If the location information of the target device belongs to the second area, and the device status score is greater than or equal to the status score threshold, the target upgrade mode is determined to be the first upgrade mode.
[0038] If the location information of the target device belongs to the second area, and the device status score is less than the status score threshold, the target upgrade mode is determined to be the second upgrade mode.
[0039] In this embodiment, the first area and the second area are different areas divided in advance. The first area represents an area with poor network conditions, complex equipment operating environment, and relatively far from the remote server, such as remote mountainous areas and places with severe signal shielding. The second area refers to an area with excellent network environment, stable equipment operating conditions, and relatively close to the remote server. The status score threshold is a critical value obtained by comprehensively calculating various performance of the device, which is used to determine whether the current status of the device meets the direct upgrade conditions.
[0040] In this embodiment, a smart remote upgrade method further includes: dividing the target area based on the location information and network signal data of all devices in the target area.
[0041] In this embodiment, the target area is divided based on the location information and network signal data of all devices in the target area, including: Generate a network signal heat map based on the network signal data of the target area.
[0042] Based on the first step, the target area is divided into multiple grids, and the device distribution density matrix is generated based on the number of devices in each grid. Each element in the device distribution density matrix corresponds to the number of devices in a grid.
[0043] The network signal heat map and device distribution density matrix are clustered based on the K-Means clustering algorithm to obtain multiple cluster sets.
[0044] Based on the network signal strength threshold and the device density threshold, multiple cluster sets are divided to obtain a first set and a second set, and the geographical location area corresponding to the first set is used as the first area, and the geographical location area corresponding to the second set is used as the second area.
[0045] In this embodiment, multiple cluster sets are divided based on a network signal strength threshold and a device density threshold, including: Calculate the network signal strength and device density of each cluster set.
[0046] If the network signal strength is greater than or equal to the network signal strength threshold, and the device density is greater than or equal to the device density threshold, the cluster set is divided into a second set, and the remaining cluster sets are divided into the first set.
[0047] In this embodiment, the network signal heat map refers to a graphic that displays the distribution of network signal strength in the target area in a visual manner, and the color depth represents the signal strength. The first step length is the side length of the grid used to divide the target area, which can be set according to the area of the target area and the desired grid fineness, for example, it can be set to 100 meters in urban areas and 500 meters in suburban areas.
[0048] The device distribution density matrix refers to a matrix that records the number of devices in each grid in the target area. The network signal strength threshold refers to the critical value for judging whether the network signal is good, which can be set according to the network signal strength required for the device to operate well. The device density threshold refers to the critical value for judging whether the device distribution is dense, which can be set according to the actual situation and business needs of the target area. Multiple cluster sets can include grid sets with strong network signals and high device density, strong network signals but low device density, weak network signals and high device density, and weak network signals and low device density.
[0049] For example, there are a large number of vending machines distributed in a certain city, and the operator uses an intelligent remote upgrade method to manage these vending machines.
[0050] By collecting the location information and network signal data of the vending machines, the network signal data is used to generate a network signal heat map, and the grid is divided according to the set first step length to generate a device distribution density matrix. After clustering using the K-Means clustering algorithm, the cluster set is divided into the first area and the second area according to the network signal strength threshold and the device density threshold. For example, in the bustling commercial street in the city center, the network signal is strong and the device density is high, which belongs to the second area; while in the remote old urban area, the network signal is weak and the device distribution is sparse, which belongs to the first area.
[0051] When a new vending machine software version is released, for vending machines located in the second area and whose device status scores are greater than or equal to the status score threshold, the first upgrade mode is adopted, that is, directly receiving upgrade instructions and upgrade packages for rapid upgrades, such as vending machines in a shopping mall in the city center, where the network is stable and the equipment is running well, and the upgrade can be completed quickly. For vending machines located in the first area, or in the second area but with a device status score lower than the threshold, such as vending machines in remote old urban areas with poor signals, the second upgrade mode is adopted, and the edge server is upgraded in blocks to ensure the stability of the upgrade process, reduce upgrade failures caused by network and device status problems, and ensure the normal operation of the vending machine.
[0052] This embodiment can adopt appropriate upgrade modes for different network and device environments to improve upgrade efficiency and success rate by accurately dividing the target area into the first area and the second area. Cluster analysis is performed using network signal heat maps and device distribution density matrices to scientifically and rationally divide regions, making regional division more accurate and in line with actual conditions. This embodiment can also flexibly respond to different device states, quickly upgrade devices in good condition, and adopt a robust upgrade strategy for devices in poor condition, effectively ensuring the normal operation of the equipment and improving overall management efficiency and user experience.
[0053] In one embodiment of the present disclosure, determining a device status score of a target device based on a heartbeat packet of the target device includes: The device resource status and device network status are determined based on the heartbeat packet of the target device.
[0054] The device status score is calculated based on the device resource status, the device network status, and the status score function.
[0055] The state score function is:
[0056] Where S represents the device status score, , Both represent weight coefficients, Indicates the device resource status determined based on the heartbeat packet received at time T. It indicates the network status of the device determined based on the heartbeat packet received at time T, and [a, b] indicates the idle time interval of the device.
[0057] In this embodiment, the device resource status is used to measure the degree of hardware resource occupancy of the device during operation, so as to reflect the usage of the device hardware resources. The device network status can reflect the quality of the device network connection, the stability of the network connection and the data transmission capacity. The parameters of the device network status can include network delay data, network packet loss rate, network bandwidth, etc. Weight coefficient , It is used to adjust the influence of device resource status and device network status on device status score in different time periods. The value is between 0 and 1. =0.6 indicates that during the device idle period, the device resource status has a greater impact on the score, and its value is determined according to the device usage scenario and key performance indicators. The device idle time interval refers to the time period when the device is in a relatively idle state. a and b are time points, such as [a=0:00, b=5:00]. The device load is reflected by calculating the device status during this period.
[0058] Exemplarily, after receiving the heartbeat packet sent by the target device, the remote server parses the device resource status (CPU, memory, disk usage) and the device network status (network delay, packet loss rate, bandwidth). Determine whether the time T of receiving the heartbeat packet is within the device idle time interval [a, b]. According to the time judgment result, select the corresponding weight coefficient and substitute it into the state score function to calculate the device status score. Taking the vending machine as an example, if a vending machine has a CPU utilization rate of 40% and a network delay of 30ms at 10-11 am (non-idle period). Obtain these data through the heartbeat packet, and the remote server determines that the time is not in the idle interval, and uses Calculate the device status score. If the device status score exceeds the preset threshold, it indicates that the device is operating well and can be upgraded directly; if the device status score is lower than the preset threshold, a more reliable upgrade strategy can be adopted to ensure the normal operation of the vending machine.
[0059] This embodiment comprehensively considers the device resource status and network status, combines the weight coefficient and the idle time interval, and accurately calculates the device status score, thereby achieving a comprehensive assessment of the target device's operating status. The upgrade strategy is flexibly adjusted according to the device status score to ensure the stability and security of the device upgrade process, thereby improving the efficiency and intelligence level of device management and maintenance.
[0060] In one embodiment of the present disclosure, the upgrade package is processed into blocks to obtain multiple upgrade block files, including: Compare the upgrade package with the historical version upgrade package.
[0061] Based on the comparison results, multiple difference blocks are determined, and each difference block is marked based on the difference type, which includes added difference, deleted difference, and modified difference.
[0062] The multiple difference blocks are processed into blocks to obtain multiple upgrade block files.
[0063] In this embodiment, multiple difference blocks are processed into blocks to obtain multiple upgrade block files, including: The difference block with a data volume greater than or equal to the first threshold is divided into blocks to obtain a plurality of sub-difference blocks.
[0064] The plurality of sub-difference blocks and the difference blocks whose data amounts are smaller than the first threshold are used as a plurality of upgraded block files.
[0065] In this embodiment, the historical version upgrade package refers to the upgrade file of the previous version of the target device. Difference comparison refers to comparing the contents of the upgrade package with the historical version upgrade package to find the differences between the two. The difference block is a different content block obtained after comparing the upgrade package with the historical version upgrade package. Parameters include the size of the difference block, the position in the original upgrade package, etc. The difference type is used to mark the nature of the change in the difference block. The added difference represents the newly added file. The deleted difference represents the file deleted from the original file. The modified difference indicates the modified part in the corresponding file content. The first threshold is a preset data volume standard, which is used to determine whether the difference block needs to be further divided into blocks. The sub-difference block includes a small block obtained by dividing the difference block with a larger data volume.
[0066] In this embodiment, by comparing the upgrade package with the historical version upgrade package, the difference parts are found and marked, so that it is clear which parts need to be updated, deleted or added. Further block division of the difference block with a large amount of data can reduce the size of a single data block, which is more efficient during network transmission and device storage processing, and reduces the transmission failure or slow processing caused by excessive data volume. Finally, the divided sub-difference blocks and small data difference blocks are used as upgrade block files for device upgrade.
[0067] Exemplarily, the latest upgrade package and the historical version upgrade package corresponding to the device are obtained. At the same time, a first threshold is set. The first threshold can be determined according to the storage capacity of the device, the stability of network transmission, and the overall size of the upgrade package. For example, it can be set to 64KB or 128KB. Using a file comparison algorithm, the upgrade package and the historical version upgrade package are compared byte by byte or according to the data structure inside the file. Through this comparison, all the different parts between the two versions are found as difference blocks.
[0068] Determine the difference type based on the specific content changes of the difference block. If the content of a difference block does not exist in the historical version, it is marked as a new difference; if it exists in the historical version but is missing in the new version, it is marked as a deleted difference; when the content has changed, it is marked as a modified difference.
[0069] Check the data size of each difference block. For difference blocks with data size greater than or equal to the first threshold, use an appropriate block partitioning strategy to process them. For example, you can divide them according to a fixed size to ensure that the data size of each sub-difference block is less than the first threshold. Arrange the sub-difference blocks obtained after the partition and the difference blocks whose original data size is less than the first threshold into multiple upgrade block files in a certain order. You can sort them according to factors such as the difference type and the position in the original file to facilitate the subsequent equipment to upgrade in sequence.
[0070] This embodiment compares the upgrade package with the historical version, accurately identifies the differences and classifies them, and effectively reduces the amount of data required for the upgrade. The large data volume difference blocks are processed in blocks, which reduces the size of a single data block, improves network transmission efficiency and device processing capabilities, and reduces transmission failures or slow processing problems caused by excessive data volume. At the same time, the method ensures the order and accuracy of the upgrade operation, improves the efficiency and success rate of device upgrades, and reduces the risks and costs during the upgrade process.
[0071] Corresponding to an intelligent remote upgrade method in the above embodiment, Figure 2 This is a structural block diagram of an intelligent remote upgrade device provided by an embodiment of the present disclosure. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown. Figure 2 The intelligent remote upgrade device 20 includes: an upgrade mode determination module 21, a first upgrade module 22 and a second upgrade module 23.
[0072] The upgrade mode determination module 21 is used to determine the location information and device status score of the target device based on the heartbeat packet of the target device, and to determine the target upgrade mode based on the location information and device status score of the target device.
[0073] The first upgrade module 22 is used to send a first device upgrade instruction and an upgrade package to the target device if the target upgrade mode is the first upgrade mode. The first device upgrade instruction is used to instruct the target device to upgrade using the upgrade package.
[0074] The second upgrade module 23 is used to send the second device upgrade instruction and the upgrade package to the edge server if the target upgrade mode is the second upgrade mode. The second device upgrade instruction is used to instruct the edge server to process the upgrade package in blocks to obtain multiple upgrade block files, and is also used to instruct the edge server to send the second device upgrade instruction and the multiple upgrade block files to the target device. The second device upgrade instruction is also used to instruct the target device to upgrade using multiple upgrade block files.
[0075] In an embodiment of the present disclosure, the upgrade mode determination module 21 is specifically configured to determine that the target upgrade mode is the second upgrade mode if the location information of the target device belongs to the first area.
[0076] If the location information of the target device belongs to the second area, and the device status score is greater than or equal to the status score threshold, the target upgrade mode is determined to be the first upgrade mode.
[0077] If the location information of the target device belongs to the second area, and the device status score is less than the status score threshold, the target upgrade mode is determined to be the second upgrade mode.
[0078] In an embodiment of the present disclosure, the upgrade mode determination module 21 is further configured to determine the device resource status and the device network status based on the heartbeat packet of the target device.
[0079] The device status score is calculated based on the device resource status, the device network status, and the status score function.
[0080] The state score function is:
[0081] Where S represents the device status score, , Both represent weight coefficients, Indicates the device resource status determined based on the heartbeat packet received at time T. It indicates the network status of the device determined based on the heartbeat packet received at time T, and [a, b] indicates the idle time interval of the device.
[0082] In one embodiment of the present disclosure, before determining the location information and device status score of the target device based on the heartbeat packet of the target device, an intelligent remote upgrade device 20 also includes: a version check module, which is used to send a version check instruction to all target devices in the target area based on the version upgrade instruction and the device information library.
[0083] The version check instruction is used to instruct all target devices in the target area to send a heartbeat packet to the remote server.
[0084] In an embodiment of the present disclosure, the second upgrading module 23 is specifically configured to determine an edge server corresponding to the target device based on the location information of the target device.
[0085] The second device upgrade instruction and the upgrade package are sent to the edge server corresponding to the target device.
[0086] In an embodiment of the present disclosure, the second upgrade module 23 is further configured to compare the upgrade package with the historical version upgrade package.
[0087] Based on the comparison results, multiple difference blocks are determined, and each difference block is marked based on the difference type, which includes added difference, deleted difference, and modified difference.
[0088] The multiple difference blocks are processed into blocks to obtain multiple upgrade block files.
[0089] In an embodiment of the present disclosure, the second upgrading module 23 is further configured to perform block processing on a difference block having a data volume greater than or equal to a first threshold to obtain a plurality of sub-difference blocks.
[0090] The plurality of sub-difference blocks and the difference blocks whose data amounts are smaller than the first threshold are used as a plurality of upgraded block files.
[0091] See also Figure 3 , Figure 3 Schematic block diagram of an electronic device provided by an embodiment of the present disclosure. Figure 3 The electronic device 300 in the embodiment shown may include: one or more processors 301, one or more input devices 302, one or more output devices 303 and one or more memories 304. The processors 301, input devices 302, output devices 303 and memories 304 communicate with each other via a communication bus 305. The memory 304 is used to store computer programs, which include program instructions. The processor 301 is used to execute the program instructions stored in the memory 304. The processor 301 is configured to call the program instructions to execute the functions of the modules in the above-mentioned device embodiments, such as Figure 2 The functions of modules 21 to 23 are shown.
[0092] It should be understood that in the embodiment of the present disclosure, the processor 301 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0093] The input device 302 may include a touch panel, a fingerprint collection sensor (for collecting the user's fingerprint information and fingerprint direction information), a microphone, etc., and the output device 303 may include a display (LCD, etc.), a speaker, etc.
[0094] The memory 304 may include a read-only memory and a random access memory, and provide instructions and data to the processor 301. A portion of the memory 304 may also include a non-volatile random access memory. For example, the memory 304 may also store information about the device type.
[0095] In a specific implementation, the processor 301, input device 302, and output device 303 described in the embodiments of the present disclosure can execute the implementation methods described in the first and second embodiments of an intelligent remote upgrade method provided in the embodiments of the present disclosure, and can also execute the implementation methods of the electronic device 300 described in the embodiments of the present disclosure, which will not be repeated here.
[0096] In another embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by the processor, all or part of the processes in the above-mentioned embodiment method are implemented, and the computer program can also be completed by instructing the relevant hardware through the computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0097] The computer-readable storage medium may be an internal storage unit of the electronic device of any of the aforementioned embodiments, such as a hard disk or memory of the electronic device. The computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Furthermore, the computer-readable storage medium may also include both an internal storage unit of the electronic device and an external storage device. The computer-readable storage medium is used to store computer programs and other programs and data required by the electronic device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
[0098] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this disclosure.
[0099] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the electronic devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0100] In the several embodiments provided in the present application, it should be understood that the disclosed electronic devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces or units, or it can be an electrical, mechanical or other form of connection.
[0101] 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 embodiments of the present disclosure.
[0102] In addition, each functional unit in each embodiment of the present disclosure 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.
[0103] The above are only specific embodiments of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present disclosure, and these modifications or replacements should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. An intelligent remote upgrade method, characterized in that: Applied to remote servers, including: Determine the location information and device status score of the target device based on the heartbeat packet of the target device; determine the target upgrade mode based on the location information and device status score of the target device; If the target upgrade mode is the first upgrade mode, sending a first device upgrade instruction and an upgrade package to the target device; the first device upgrade instruction is used to instruct the target device to upgrade using the upgrade package; If the target upgrade mode is the second upgrade mode, the second device upgrade instruction and the upgrade package are sent to the edge server; the second device upgrade instruction is used to instruct the edge server to process the upgrade package in blocks to obtain multiple upgrade block files, and is also used to instruct the edge server to send the second device upgrade instruction and the multiple upgrade block files to the target device; the second device upgrade instruction is also used to instruct the target device to upgrade using multiple upgrade block files.
2. The intelligent remote upgrade method according to claim 1, characterized in that: The determining of the target upgrade mode based on the location information and the device status score of the target device includes: If the location information of the target device belongs to the first area, determining the target upgrade mode to be the second upgrade mode; If the location information of the target device belongs to the second area, and the device status score is greater than or equal to the status score threshold, determining that the target upgrade mode is the first upgrade mode; If the location information of the target device belongs to the second area, and the device status score is less than the status score threshold, the target upgrade mode is determined to be the second upgrade mode.
3. The intelligent remote upgrade method according to claim 1, characterized in that: The determining the device status score of the target device based on the heartbeat packet of the target device includes: Determine the device resource status and device network status based on the heartbeat packet of the target device; Calculate a device status score based on the device resource status, the device network status and a status score function; The state score function is: Among them, S represents the device status score, , Both represent weight coefficients, Indicates the device resource status determined based on the heartbeat packet received at time T. It indicates the network status of the device determined based on the heartbeat packet received at time T, and [a, b] indicates the idle time interval of the device.
4. The intelligent remote upgrade method according to claim 1, characterized in that: Before determining the location information and device status score of the target device based on the heartbeat packet of the target device, the method further includes: Sending a version check instruction to all target devices in the target area based on the version upgrade instruction and the device information library; The version check instruction is used to instruct all target devices in the target area to send a heartbeat packet to the remote server.
5. The intelligent remote upgrade method according to claim 1, characterized in that: The sending the second device upgrade instruction and the upgrade package to the edge server includes: Determine an edge server corresponding to the target device based on location information of the target device; The second device upgrade instruction and the upgrade package are sent to the edge server corresponding to the target device.
6. The intelligent remote upgrade method according to claim 1, characterized in that: The upgrade package is processed into blocks to obtain multiple upgrade block files, including: Compare the upgrade package with the historical version upgrade package; Determine multiple difference blocks based on the comparison results, and mark each difference block based on a difference type; the difference type includes a new difference, a deleted difference, and a modified difference; The multiple difference blocks are divided into blocks to obtain multiple upgrade block files.
7. An intelligent remote upgrade method as claimed in claim 6, characterized in that: The step of dividing the plurality of difference blocks into blocks to obtain a plurality of upgrade block files includes: Performing block processing on a difference block whose data volume is greater than or equal to a first threshold to obtain a plurality of sub-difference blocks; The plurality of sub-difference blocks and the difference blocks whose data amounts are smaller than a first threshold are used as the plurality of upgraded block files.
8. An intelligent remote upgrade device, characterized in that: include: An upgrade mode determination module, used to determine the location information and device status score of the target device based on the heartbeat packet of the target device; Determine a target upgrade mode based on location information and a device status score of the target device; A first upgrade module, configured to send a first device upgrade instruction and an upgrade package to a target device if the target upgrade mode is a first upgrade mode; the first device upgrade instruction is used to instruct the target device to upgrade using the upgrade package; The second upgrade module is used to send the second device upgrade instruction and the upgrade package to the edge server if the target upgrade mode is the second upgrade mode; the second device upgrade instruction is used to instruct the edge server to process the upgrade package in blocks to obtain multiple upgrade block files, and is also used to instruct the edge server to send the second device upgrade instruction and the multiple upgrade block files to the target device; the second device upgrade instruction is also used to instruct the target device to upgrade using multiple upgrade block files.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Terminal power control method and device
CN109862611A
Firmware upgrading method, device and system of Internet of Things equipment and storage medium
CN111510323A
Smart home equipment remote upgrading method, credible authentication method and storage medium
CN114285585A
Remote equipment upgrading method and device based on PLC (Programmable Logic Controller), equipment and storage medium
CN115134342A
Firmware upgrading method based on cloud side collaboration, server side and edge gateway side
CN115529301A