Intelligent remote upgrade method, device, equipment, and storage medium

By determining the upgrade mode based on the location information and status scores obtained by the heartbeat packet, direct upgrade or edge server block upgrade is used to solve the upgrade problem of vending machines in an unstable network environment, and stable and efficient remote upgrade is achieved, reducing maintenance costs and improving operational efficiency.

CN119854286BActive Publication Date: 2025-08-19河北盛马电子科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510317314.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-18
Publication Date
2025-08-19
Estimated Expiration
2045-03-18

AI Technical Summary

Technical Problem

The vending machine cannot perform stable and efficient remote software and firmware upgrades in the event of unstable network environment or insufficient bandwidth, resulting in interruption or failure of the upgrade process.

Method used

The location information and device status score of the target device are obtained through the heartbeat package, the target upgrade mode is determined, and two upgrade modes are adopted: direct upgrade and block upgrade through edge servers. Direct upgrade is suitable for situations where the network environment is stable and the equipment is in good condition, while block upgrade is suitable for situations where the network is poor or the equipment is instable, and block processing and transmission are carried out through edge servers.

Benefits of technology

Improve the stability and flexibility of remote upgrades, ensure the smooth progress of the upgrade process, reduce maintenance costs, and improve operational efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119854286B_ABST
    Figure CN119854286B_ABST
Patent Text Reader

Abstract

The present disclosure provides an intelligent remote upgrade method and apparatus, equipment, and storage medium, belonging to the field of remote upgrade technology. The method includes: determining the location information and device status score of the target device based on the heartbeat packet of the target device. Determining 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, the first device upgrade instruction and the 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. 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 present disclosure can improve the stability of remote upgrades of vending machines.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure belongs to the field of remote upgrade technology, and more specifically, relates to an intelligent remote upgrade method and apparatus, device, and storage medium. Background Art

[0002] As vending machine applications continue to expand and their functionality becomes increasingly rich, the need for software and firmware upgrades to enhance user experience and improve operational management is becoming increasingly urgent. For example, the expansion of payment methods from single cash to mobile payments 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, which 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 apparatus, 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, comprising:

[0006] 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;

[0007] 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;

[0008] 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 block the upgrade package 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 use the multiple upgrade block files for upgrading.

[0009] A second aspect of the embodiments of the present disclosure provides an intelligent remote upgrade device, comprising:

[0010] An upgrade mode determination module is configured to determine the location information and device status score of a target device based on a heartbeat packet of the target device; and determine a target upgrade mode based on the location information and device status score of the target device;

[0011] A first upgrade module is configured to send a first device upgrade instruction and an upgrade package to a 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;

[0012] A second upgrade module is configured to send a second device upgrade instruction and the upgrade package to an edge server if the target upgrade mode is the second upgrade mode; the second device upgrade instruction is configured to instruct the edge server to perform block processing on the upgrade package to obtain multiple upgrade block files, and is further configured to instruct the edge server to send the second device upgrade instruction and the multiple upgrade block files to a target device; the second device upgrade instruction is further configured to instruct the target device to perform an upgrade using the multiple upgrade block files.

[0013] 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.

[0014] 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.

[0015] The beneficial effects of the intelligent remote upgrade method, device, equipment, and storage medium provided by the embodiments of the present disclosure are:

[0016] On the one hand, by obtaining the target device's location information and device status score through heartbeat packets, we can accurately determine the device's real-time status and environment, providing data support for formulating appropriate upgrade strategies. Determining the target upgrade model based on this information ensures that the upgrade process is more closely aligned with the device's actual needs, avoiding unnecessary upgrade interruptions or failures.

[0017] Furthermore, the introduction of two upgrade modes—direct upgrade and block-based upgrade via edge servers—enhances upgrade flexibility. In the first upgrade mode, the upgrade process is streamlined and efficient. In the second upgrade mode, the transfer and processing by edge servers effectively reduces the burden on remote servers and adapts to scenarios with unstable networks or limited device performance, ensuring smooth transmission of upgrade packages and successful device upgrades. Considering network bandwidth constraints, block-based processing of upgrade packages effectively reduces data transmission pressure.

[0018] 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

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. 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 any creative work.

[0020] Figure 1 A flowchart of an intelligent remote upgrade method provided by an embodiment of the present disclosure;

[0021] Figure 2 This is a structural block diagram of an intelligent remote upgrade device provided by one embodiment of the present disclosure;

[0022] Figure 3 A schematic block diagram of an electronic device provided in one embodiment of the present disclosure. DETAILED DESCRIPTION

[0023] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present disclosure. However, it will be apparent 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 obscuring the description of the present disclosure with unnecessary detail.

[0024] In order to make the purpose, technical solutions and advantages of the present disclosure more clear, specific embodiments will be described below with reference to the accompanying drawings.

[0025] 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.

[0026] S101: Determine the location information and device status score of the target device based on the heartbeat packet of the target device, and determine a target upgrade mode based on the location information and device status score of the target device.

[0027] In this embodiment, before determining the location information and device status score of the target device based on the heartbeat packet of the target device, the following steps are further included:

[0028] Based on the version upgrade instruction and the device information library, a version check instruction is sent to all target devices in the target area.

[0029] The version check instruction is used to instruct all target devices in the target area to send heartbeat packets to the remote server.

[0030] In this embodiment, a version upgrade instruction, initiated by a remote server, triggers the version check and upgrade process for devices in a target region. The version upgrade instruction may include the version number and a description of the upgrade content. The device information database stores information related to all vending machines in the target region, including basic device information and status information. The target region is a designated geographic area encompassing the range of devices requiring version checks and upgrades. The targeted upgrade mode determines the upgrade method based on the target device's location information and device status score.

[0031] After the remote server prepares the upgrade package and confirms the upgrade, it generates a version check instruction and sends it to all target devices in the target region, instructing them to perform a version check. A heartbeat packet is a data packet sent by a target device to the remote server to indicate its online status. This packet can include information such as the device's location, status, network environment, and current version number. The device status score is used to assess the device's health and upgrade feasibility. The score can be calculated based on factors such as hardware performance, network stability, battery charge, and idle status.

[0032] In this embodiment, after receiving the version upgrade instruction, the remote server filters all target devices in the target area from the device information database. 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 containing the device's location information, status information, and current version number to the remote server. The remote server parses the received heartbeat packet to determine the device's location information and calculates a device status score based on the device's status information. Based on the target device's location information and device status score, the remote server selects an appropriate target upgrade mode. Based on 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.

[0033] 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.

[0034] In this embodiment, the first upgrade mode is a direct upgrade, 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 used to trigger the device to initiate the upgrade operation. The first device upgrade instruction may include the version number of the upgrade package, the specific upgrade steps, and the upgrade time requirement. The upgrade package refers to the collection of files for the new version of the target device's software or system, including code files and configuration files. Parameters may include the upgrade package size and a checksum, which is used to ensure that the upgrade package is not damaged during transmission.

[0035] For example, based on the target device's location information and device status score, the remote server determines that the first upgrade mode is appropriate. The remote server generates a first device upgrade instruction and prepares a corresponding upgrade package. The first device upgrade instruction specifies the detailed upgrade process for the target device. The remote server sends the first device upgrade instruction and upgrade package to the target device. During this transmission process, an appropriate transmission protocol is used to ensure data integrity and accuracy.

[0036] 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.

[0037] S103: If the target upgrade mode is the second upgrade mode, a second device upgrade instruction and the upgrade package are sent to the edge server. The second device upgrade instruction instructs the edge server to process the upgrade package into blocks to obtain multiple upgrade block files, and further instructs 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 also instructs the target device to upgrade using the multiple upgrade block files.

[0038] In this embodiment, sending the second device upgrade instruction and upgrade package to the edge server includes:

[0039] An edge server corresponding to the target device is determined based on the location information of the target device.

[0040] The second device upgrade instruction and upgrade package are sent to the edge server corresponding to the target device.

[0041] In this embodiment, the second upgrade mode is an upgrade strategy used when the network environment is poor or the device is unstable. It uses edge servers for block processing, reducing the risk of upgrade package transmission. The second device upgrade instruction may include the upgrade package version number, block size setting, target device unique identifier, upgrade sequence, and operation instructions. Edge servers are network nodes deployed close to the target device, used to offload load from remote servers and optimize data transmission. The upgrade block file may include its own serial number, the upgrade package version number, and data content.

[0042] In this embodiment, the remote server determines that the target device is suitable for the second upgrade mode based on its location information and device status score. Based on the target device's location information, the remote server selects the edge server closest to the target device. The remote server sends the second device upgrade instruction and upgrade package to the edge server. Upon receipt, the edge server divides the upgrade package into blocks based on the second device upgrade instruction, generating multiple upgrade block files. The edge server then sends the second device upgrade instruction and multiple upgrade block files to the target device. Upon receipt, the target device uses these upgrade block files to perform the upgrade according to the upgrade sequence and operation steps specified in the second device upgrade instruction.

[0043] Exemplarily, the remote server can maintain a mapping table between 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 based on 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 receiving the second device upgrade instruction and upgrade package, the edge server 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 the 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.

[0044] As can be seen from the above, obtaining the target device's location information and device status score through heartbeat packets can accurately determine the device's real-time status and environment, providing data support for formulating appropriate upgrade strategies. Determining the target upgrade model based on this information ensures that the upgrade process is more closely aligned with the device's actual needs, avoiding unnecessary upgrade interruptions or failures.

[0045] Furthermore, the introduction of two upgrade modes—direct upgrade and block-based upgrade via edge servers—greatly enhances upgrade flexibility. In the first upgrade mode, the upgrade process is streamlined and efficient. In the second upgrade mode, the transfer and processing by edge servers effectively reduces the burden on remote servers and adapts to scenarios with unstable networks or limited device performance, ensuring smooth transmission of upgrade packages and successful device upgrades. Considering network bandwidth constraints, block-based processing of upgrade packages effectively reduces data transmission pressure.

[0046] 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.

[0047] 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:

[0048] 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.

[0049] 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.

[0050] 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.

[0051] In this embodiment, the first and second regions are pre-determined areas. The first region represents areas with poor network conditions, complex device operating environments, and relatively long distances from remote servers, such as remote mountainous areas or locations with severe signal shielding. The second region represents areas with excellent network conditions, stable device operating conditions, and relatively close distances to remote servers. The status score threshold is a critical value calculated by comprehensively calculating various device performance indicators and is used to determine whether the device's current status meets the requirements for direct upgrade.

[0052] 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.

[0053] 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:

[0054] Generate a network signal heat map based on the network signal data of the target area.

[0055] Based on the first step, the target area is divided into multiple grids. 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.

[0056] The network signal heat map and device distribution density matrix are clustered based on the K-Means clustering algorithm to obtain multiple cluster sets.

[0057] Multiple cluster sets are divided based on a network signal strength threshold and a device density threshold to obtain a first set and a second set. 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.

[0058] In this embodiment, multiple cluster sets are divided based on the network signal strength threshold and the device density threshold, including:

[0059] Calculate the network signal strength and device density of each cluster set.

[0060] 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.

[0061] In this embodiment, a network signal heat map is a graphic that visually displays the distribution of network signal strength in a target area, with light and dark colors representing signal strength. The first step length is the side length of the grid used to divide the target area. This can be set based on 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.

[0062] The device distribution density matrix records the number of devices within each grid in the target area. The network signal strength threshold determines whether a network signal is good or not, and can be set based on the network signal strength required for proper device operation. The device density threshold determines whether a device distribution is dense or not, and can be set based on the actual conditions and business needs of the target area. Multiple clusters can include grids 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.

[0063] 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.

[0064] By collecting vending machine location information and network signal data, the network signal data is used to generate a network signal heat map. The grid is then divided according to the set first step length to generate a device distribution density matrix. After clustering using the K-Means algorithm, the clusters are divided into the first and second regions based on network signal strength and device density thresholds. For example, a bustling commercial street in a city center, with strong network signals and high device density, would fall into the second region; whereas a remote, older urban area, with weak network signals and sparse device distribution, would fall into the first region.

[0065] When a new vending machine software version is released, the first upgrade mode is used for vending machines located in the second area with a device status score greater than or equal to the status score threshold. This mode directly receives upgrade instructions and packages for a rapid upgrade. For example, a vending machine in a downtown mall with a stable network and well-functioning devices can quickly complete the upgrade. For vending machines located in the first area, or in the second area with a device status score below the threshold, such as those in remote, older urban areas with poor signal quality, the second upgrade mode is used. This mode uses edge servers for block upgrades, ensuring a stable upgrade process, minimizing upgrade failures due to network and device status issues, and ensuring the normal operation of the vending machines.

[0066] This embodiment precisely divides the target area into a first region and a second region, enabling the adoption of appropriate upgrade modes for different network and device environments, improving upgrade efficiency and success rates. Cluster analysis is performed using network signal heat maps and device distribution density matrices, enabling scientific and rational regional divisions, making them more accurate and consistent with actual conditions. This embodiment also flexibly responds to different device states, rapidly upgrading devices in good condition and adopting a robust upgrade strategy for devices in poor condition, effectively ensuring the normal operation of the devices and improving overall management efficiency and user experience.

[0067] 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:

[0068] Determine the device resource status and device network status based on the heartbeat packet of the target device.

[0069] The device status score is calculated based on the device resource status, the device network status, and the status score function.

[0070] The state score function is:

[0071]

[0072] 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. Indicates the device network status determined based on the heartbeat packet received at time T, and [a, b] indicates the device idle time interval.

[0073] In this embodiment, the device resource status is used to measure the degree of hardware resource usage during device operation, reflecting the device hardware resource usage. 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 may include network delay data, network packet loss rate, network bandwidth, etc. Weight coefficient 、 Used to adjust the impact of device resource status and device network status on device status score at different time periods. The value is between 0 and 1. For example =0.6 indicates that the device resource status has a greater impact on the score during idle periods. The value is determined based on the device usage scenario and key performance indicators. The device idle time interval refers to the period of time when the device is relatively idle. a and b are time points, such as [a=0:00, b=5:00]. The device status during this period is calculated to reflect the device load.

[0074] For example, 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 usage 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 score exceeds the preset threshold, it indicates that the device is operating well and can be upgraded directly. If the score is below the preset threshold, a more reliable upgrade strategy can be implemented to ensure normal operation of the vending machine.

[0075] This implementation comprehensively assesses the operating status of target devices by comprehensively considering device resource status and network status, combining weight coefficients and idle time intervals to accurately calculate device status scores. This allows for flexible adjustment of upgrade strategies based on device status scores, ensuring stability and security during device upgrades and improving the efficiency and intelligence of device management and maintenance.

[0076] In one embodiment of the present disclosure, the upgrade package is divided into blocks to obtain multiple upgrade block files, including:

[0077] Compare the upgrade package with the upgrade packages of previous versions.

[0078] Based on the comparison results, multiple difference blocks are determined, and each difference block is marked based on the difference type. The difference types include added difference, deleted difference, and modified difference.

[0079] The multiple difference blocks are divided into blocks to obtain multiple upgrade block files.

[0080] In this embodiment, multiple difference blocks are divided into blocks to obtain multiple upgrade block files, including:

[0081] 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.

[0082] The plurality of sub-difference blocks and the difference block with a data amount smaller than a first threshold are used as a plurality of upgraded block files.

[0083] 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 the different content block obtained after comparing the upgrade package with the historical version upgrade package. The 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 represents 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.

[0084] In this embodiment, by comparing the upgrade package with the previous version upgrade package, the differences are identified and marked, making it clear which parts need to be updated, deleted, or added. Large difference blocks are further divided into smaller blocks, reducing the size of individual data blocks. This facilitates more efficient network transmission and device storage processing, reducing transmission failures or slow processing caused by excessive data volumes. Finally, the divided sub-difference blocks and small difference blocks are used as upgrade block files for device upgrades.

[0085] For example, the latest upgrade package and the corresponding historical version upgrade package for the device are obtained. A first threshold is also set. This threshold can be determined based on the device's storage capacity, network transmission stability, and the overall size of the upgrade package; for example, 64KB or 128KB is commonly used. A file comparison algorithm is used to compare the upgrade package with the historical version upgrade package, either byte by byte or based on the file's internal data structure. This comparison identifies all differences between the two versions, which are then treated as difference blocks.

[0086] The difference type is determined based on the specific content changes of the difference block. If the content of a difference block does not exist in the previous version, it is marked as a new difference; if it exists in the previous version but is missing in the new version, it is marked as a deleted difference; if the content has changed, it is marked as a modified difference.

[0087] Check the data size of each difference block. For difference blocks with data sizes greater than or equal to the first threshold, adopt an appropriate block partitioning strategy. For example, you can partition them according to a fixed size to ensure that the data size of each sub-difference block is less than the first threshold. Organize the resulting sub-difference blocks and the difference blocks whose data sizes were originally less than the first threshold into multiple upgrade block files in a specific order. These files can be sorted based on factors such as difference type and location in the original file to facilitate sequential upgrade operations on subsequent devices.

[0088] This embodiment compares the upgrade package with historical versions, accurately identifying and categorizing differences, effectively reducing the amount of data required for the upgrade. By processing large data difference blocks in blocks, the size of individual data blocks is reduced, improving network transmission efficiency and device processing capabilities, and reducing transmission failures or slow processing caused by excessive data volumes. This method also ensures the order and accuracy of upgrade operations, improving the efficiency and success rate of device upgrades, and reducing the risks and costs of the upgrade process.

[0089] Corresponding to an intelligent remote upgrade method of the above embodiment, Figure 2 This is a block diagram of the structure 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.

[0090] The upgrade mode determination module 21 is configured to determine the location information and device status score of the target device based on the heartbeat packet of the target device, and determine the target upgrade mode based on the location information and device status score of the target device.

[0091] The first upgrade module 22 is configured 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.

[0092] The second upgrade module 23 is configured to send a second device upgrade instruction and an upgrade package to the edge server if the target upgrade mode is the second upgrade mode. The second device upgrade instruction instructs the edge server to process the upgrade package into blocks, generating multiple upgrade block files, and further instructs 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 also instructs the target device to upgrade using the multiple upgrade block files.

[0093] In one embodiment of the present disclosure, the upgrade mode determining 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.

[0094] 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.

[0095] 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.

[0096] In one 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.

[0097] The device status score is calculated based on the device resource status, the device network status, and the status score function.

[0098] The state score function is:

[0099]

[0100] 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. Indicates the device network status determined based on the heartbeat packet received at time T, and [a, b] indicates the device idle time interval.

[0101] 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.

[0102] The version check instruction is used to instruct all target devices in the target area to send heartbeat packets to the remote server.

[0103] 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 location information of the target device.

[0104] The second device upgrade instruction and upgrade package are sent to the edge server corresponding to the target device.

[0105] 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.

[0106] Based on the comparison results, multiple difference blocks are determined, and each difference block is marked based on the difference type. The difference types include added difference, deleted difference, and modified difference.

[0107] The multiple difference blocks are divided into blocks to obtain multiple upgrade block files.

[0108] In one 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.

[0109] The plurality of sub-difference blocks and the difference block with a data amount smaller than a first threshold are used as a plurality of upgraded block files.

[0110] See also Figure 3 , Figure 3 This is a 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.

[0111] It should be understood that in the embodiments of the present disclosure, the processor 301 may be a central processing unit (CPU), or may 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 any conventional processor.

[0112] The input device 302 may include a touchpad, a fingerprint collection sensor (for collecting user fingerprint information and fingerprint direction information), a microphone, etc. The output device 303 may include a display (LCD, etc.), a speaker, etc.

[0113] The memory 304 may include a read-only memory and a random access memory, and provides 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.

[0114] 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.

[0115] In another embodiment of the present disclosure, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program. The computer program includes program instructions. When the program instructions are executed by a processor, all or part of the process of the method in the above embodiment is implemented. The computer program can also be used to instruct related hardware to complete the process. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of each of the above method embodiments are implemented. The computer program includes computer program code, which can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can include: any entity or device capable of carrying computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium.

[0116] The computer-readable storage medium can be an internal storage unit of the electronic device in any of the aforementioned embodiments, such as a hard disk or memory of the electronic device. The computer-readable storage medium can also be an external storage device of the electronic device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card, etc. Furthermore, the computer-readable storage medium can 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 can also be used to temporarily store data that has been output or is about to be output.

[0117] Those skilled 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 above description has generally described the composition and steps of each example according to function. 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.

[0118] Those skilled in the art will 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.

[0119] In the several embodiments provided in this 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 merely schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, 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 can be an electrical, mechanical or other form of connection.

[0120] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, i.e., they may be located in one place or distributed across multiple network units. Some or all of these units may be selected based on actual needs to achieve the objectives of the embodiments of the present disclosure.

[0121] In addition, the functional units in the various embodiments of the present disclosure may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0122] The above are only specific embodiments of the present disclosure, but the scope of protection of the present disclosure is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or replacements within the technical scope disclosed in this disclosure, and such modifications or replacements should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be based on the scope of protection of the claims.

Claims

1. An intelligent remote upgrade method, characterized in that: Applied to remote servers, including: Determining the location information and device status score of the target device based on the heartbeat packet of the target device; if the location information of the target device belongs to the first area, determining the target upgrade mode to be the first 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, determining that the target upgrade mode is the second upgrade mode; 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 compare the upgrade package with the historical version upgrade package; based on the comparison result, multiple difference blocks are determined, and each difference block is marked based on the difference type; the difference type includes new difference, deleted difference and modified difference; the difference block with a data volume greater than or equal to the first threshold is divided into blocks to obtain multiple sub-difference blocks; the multiple sub-difference blocks and the difference block with a data volume less than the first threshold are used as the multiple upgrade block files; the second device upgrade instruction 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 use the multiple upgrade block files for upgrading; The method further includes: generating a network signal heat map based on the network signal data of the target area; Based on the first step, the target area is divided into multiple networks. 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. Cluster the network signal heat map and device distribution density matrix based on the K-Means clustering algorithm to obtain multiple cluster sets; calculate the network signal strength and device density of each cluster set; 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 first set, the remaining cluster sets are divided into a second set, and the geographic location area corresponding to the first set is used as the first area, and the geographic location area corresponding to the second set is used as the second area.

2. The intelligent remote upgrade method according to claim 1, wherein: 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; Calculating 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. Indicates the device network status determined based on the heartbeat packet received at time T, and [a, b] indicates the device idle time interval.

3. The intelligent remote upgrade method according to claim 1, wherein: 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.

4. The intelligent remote upgrade method according to claim 1, wherein: 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.

5. An intelligent remote upgrade device, characterized in that: include: An upgrade mode determination module, configured to determine the location information and device status score of a target device based on a heartbeat packet of the target device; If the location information of the target device belongs to the first area, determining the target upgrade mode to be the first 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, determining that the target upgrade mode is the second upgrade mode; A first upgrade module is configured to send a first device upgrade instruction and an upgrade package to a 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; a second upgrade module configured to, if the target upgrade mode is the second upgrade mode, send a second device upgrade instruction and the upgrade package to an edge server; the second device upgrade instruction is configured to instruct the edge server to perform a difference comparison between the upgrade package and the historical version upgrade package; determine multiple difference blocks based on the comparison result, and mark each difference block based on a difference type; the difference type includes a new difference, a deleted difference, and a modified difference; divide a difference block with a data volume greater than or equal to a first threshold into multiple sub-difference blocks; use the multiple sub-difference blocks and the difference block with a data volume less than the first threshold as the multiple upgrade block files; the second device upgrade instruction is further configured to instruct the edge server to send the second device upgrade instruction and the multiple upgrade block files to a target device; the second device upgrade instruction is further configured to instruct the target device to upgrade using the multiple upgrade block files; An upgrade mode determination module is specifically used to generate a network signal heat map based on the network signal data of the target area; Based on the first step, the target area is divided into multiple networks. 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. Cluster the network signal heat map and device distribution density matrix based on the K-Means clustering algorithm to obtain multiple cluster sets; calculate the network signal strength and device density of each cluster set; 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 first set, the remaining cluster sets are divided into a second set, and the geographic location area corresponding to the first set is used as the first area, and the geographic location area corresponding to the second set is used as the second area.

6. 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 4 are implemented.

7. 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 4 are implemented.

Citation Information

Patent Citations

  • 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