An edge computing task offloading method and related device

By combining the state information of edge servers and terminals in edge computing, and employing Proof-of-Work (PoUW) and intelligent offloading decisions, the problems of resource waste and low computing efficiency in existing technologies are solved, achieving efficient utilization of edge computing resources and system stability.

CN121523752BActive Publication Date: 2026-06-26INSPUR (SHANDONG) COMPUTER TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INSPUR (SHANDONG) COMPUTER TECH CO LTD
Filing Date
2025-07-31
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

In existing technologies, edge computing task offloading decision-making methods fail to fully consider the situation of terminals and edge servers, resulting in resource waste and low computing efficiency. In particular, the system may fail when malicious users or computing demands are overloaded.

Method used

By determining the status information of edge servers and terminals, and combining Proof-of-Work (PoUW) and intelligent offloading decision-making mechanisms, the offloading decision of computing tasks is optimized to avoid wasting computing power and ensure the effectiveness of computing tasks and efficient use of resources.

Benefits of technology

It enables efficient utilization of edge computing resources, ensures system stability and scalability, avoids invalid computation, and improves the execution efficiency and resource utilization of computing tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121523752B_ABST
    Figure CN121523752B_ABST
Patent Text Reader

Abstract

The embodiment of the disclosure provides an edge computing task offloading method and related equipment, and relates to the technical field of computers, which is applied to a terminal, and the method comprises the following steps: determining the state of an edge server, the state of a terminal and the first information of a computing task of the terminal; determining an offloading decision according to the state, the state of the terminal and the first information; executing the computing task or offloading the computing task to the edge server according to the offloading decision; the first information comprises at least one of the following: the state of the terminal, a first time delay, a first energy consumption, a second time delay, a second energy consumption, a third time delay, a third energy consumption, a fourth time delay, a fourth energy consumption, the calculation amount of image data corresponding to the terminal encryption computing task, the third time delay and the third energy consumption represent the time delay and the energy consumption required for the terminal to perform a proof of work, and the proof of work is generated based on a to-be-processed task from the edge server. In this way, by combining the proof of work and the intelligent offloading decision mechanism, efficient use of edge computing resources is realized, and the stability of the system is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a method and related equipment for offloading edge computing tasks. Background Technology

[0002] With the rapid development of edge computing, more and more terminals are relying on edge servers to perform computationally intensive tasks. This approach can significantly reduce the burden of local computing on the device and improve task execution efficiency. However, in dynamically changing environments, such as unstable network conditions, limited device power, and high CPU load, effectively determining how to offload and process tasks remains a critical issue.

[0003] Currently, mainstream computing task offloading decision-making methods rely on the terminal's status (such as network, energy, and computing resources) to determine whether to execute tasks locally or offload them to edge servers. However, these decisions often fail to fully consider the actual allocation of edge computing resources, leading to resource waste or low computing efficiency. Especially in the presence of malicious users or overloaded computing demands, edge computing systems may encounter performance bottlenecks or even fail.

[0004] Furthermore, traditional blockchain Proof of Work (PoW) algorithms generally suffer from wasted computing power. The traditional PoW model is akin to a group of people randomly casting nets in the ocean, hoping to obtain rewards through random computation; however, most of the computation does not generate any real value. This meaningless computation not only wastes a significant amount of energy and computing power but also negatively impacts system efficiency and sustainability.

[0005] Therefore, there is a need for a task offloading method that can fully consider the situation of terminals and edge servers, while avoiding the waste of computing power and ensuring the protection of privacy-sensitive data. Summary of the Invention

[0006] This disclosure provides an edge computing task offloading method and related equipment to at least solve the above-mentioned technical problems existing in the prior art.

[0007] The technical solution of this disclosure embodiment is implemented as follows:

[0008] In a first aspect, embodiments of this disclosure provide an edge computing task offloading method, characterized in that the method is applied to a terminal, and the method includes:

[0009] Determine the status of the edge server and the first information of the terminal's computing task;

[0010] An unloading decision is determined based on the state and the first information, wherein the unloading decision represents whether to unload the computing task to the edge server;

[0011] Based on the uninstallation decision, the task can be processed or the task can be uninstalled to an edge server;

[0012] The state can be either a first state or a second state.

[0013] If the state is the first state, the first information includes at least one of the following: terminal state, first latency, first energy consumption, second latency, second energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task;

[0014] If the state is the second state, the first information includes at least one of the following: terminal state, first latency, first energy consumption, second latency, second energy consumption, third latency, third energy consumption, fourth latency, fourth energy consumption, and the computation amount of the image data corresponding to the terminal encryption computation task;

[0015] The third latency represents the latency required for the terminal to perform proof-of-work, and the third energy consumption represents the energy consumption required for the terminal to perform proof-of-work, wherein the proof-of-work is generated based on pending tasks from the edge server.

[0016] The fourth latency characterizes the latency required for the terminal to perform computing tasks on the blockchain, and the fourth energy consumption characterizes the energy consumption required for the terminal to perform computing tasks on the blockchain.

[0017] The first latency represents the latency required to execute the computing task, and the first energy consumption represents the energy consumption required to execute the computing task; the second latency represents the latency required to offload the computing service to the edge server, and the second energy consumption represents the energy consumption required to offload the computing service to the edge server.

[0018] Secondly, embodiments of this disclosure provide an edge computing blockchain offloading method, the method being applied to an edge server, the method comprising:

[0019] Send status indication information to the terminal, the status indication information being used to indicate the status of the edge server; the status is either a first status or a second status;

[0020] The status indication information is used by the terminal to determine an offloading decision by combining the status of the edge server and the terminal's first information. The offloading decision indicates whether to offload the computing task to the edge server. The first information includes: device status and the terminal's computing task information.

[0021] The state can be either a first state or a second state.

[0022] If the state is the first state, the computing task information includes at least one of the following: first latency, first energy consumption, second latency, second energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task;

[0023] If the state is the second state, the computing task information includes at least one of the following: first latency, first energy consumption, second latency, second energy consumption, third latency, third energy consumption, fourth latency, fourth energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task;

[0024] The third latency represents the latency required for the terminal to perform proof-of-work, and the third energy consumption represents the energy consumption required for the terminal to perform proof-of-work, wherein the proof-of-work is generated based on pending tasks from the edge server.

[0025] The fourth latency characterizes the latency required for the terminal to perform computing tasks on the blockchain, and the fourth energy consumption characterizes the energy consumption required for the terminal to perform computing tasks on the blockchain.

[0026] The first latency represents the latency required to execute the computing task, and the first energy consumption represents the energy consumption required to execute the computing task; the second latency represents the latency required to offload the computing service to the edge server, and the second energy consumption represents the energy consumption required to offload the computing service to the edge server.

[0027] Thirdly, embodiments of this disclosure provide an edge computing task offloading device, the device being applied to a terminal, the device comprising:

[0028] The first processing module is used to determine the status of the edge server and the first information of the terminal, the first information including: device status and terminal computing task information;

[0029] The second processing module is used to determine an unloading decision based on the state and the first information, wherein the unloading decision represents whether to unload the computing task to the edge server;

[0030] The first communication module is used to execute computing tasks or offload computing tasks to edge servers according to the offloading decision;

[0031] The state can be either a first state or a second state.

[0032] If the state is the first state, the computing task information includes at least one of the following: first latency, first energy consumption, second latency, second energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task;

[0033] If the state is the second state, the computing task information includes at least one of the following: first latency, first energy consumption, second latency, second energy consumption, third latency, third energy consumption, fourth latency, fourth energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task;

[0034] The third latency represents the latency required for the terminal to perform proof-of-work, and the third energy consumption represents the energy consumption required for the terminal to perform proof-of-work, wherein the proof-of-work is generated based on pending tasks from the edge server.

[0035] The fourth latency characterizes the latency required for the terminal to perform computing tasks on the blockchain, and the fourth energy consumption characterizes the energy consumption required for the terminal to perform computing tasks on the blockchain.

[0036] The first latency represents the latency required to execute the computing task, and the first energy consumption represents the energy consumption required to execute the computing task; the second latency represents the latency required to offload the computing service to the edge server, and the second energy consumption represents the energy consumption required to offload the computing service to the edge server.

[0037] Fourthly, embodiments of this disclosure provide an edge computing task offloading device, the device being applied to an edge server, the device comprising:

[0038] The second communication module is used to send status indication information to the terminal, the status indication information being used to indicate the status of the edge server; the status is either a first status or a second status.

[0039] The status indication information is used by the terminal to determine an offloading decision by combining the status of the edge server and the first information. The offloading decision indicates whether to offload the computing task to the edge server. The first information includes: device status and computing task information of the terminal.

[0040] The state can be either a first state or a second state.

[0041] If the state is the first state, the computing task information includes at least one of the following: first latency, first energy consumption, second latency, second energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task;

[0042] If the state is the second state, the computing task information includes at least one of the following: first latency, first energy consumption, second latency, second energy consumption, third latency, third energy consumption, fourth latency, fourth energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task;

[0043] The third latency represents the latency required for the terminal to perform proof-of-work, and the third energy consumption represents the energy consumption required for the terminal to perform proof-of-work, wherein the proof-of-work is generated based on pending tasks from the edge server.

[0044] The fourth latency characterizes the latency required for the terminal to perform computing tasks on the blockchain, and the fourth energy consumption characterizes the energy consumption required for the terminal to perform computing tasks on the blockchain.

[0045] The first latency represents the latency required to execute the computing task, and the first energy consumption represents the energy consumption required to execute the computing task; the second latency represents the latency required to offload the computing service to the edge server, and the second energy consumption represents the energy consumption required to offload the computing service to the edge server.

[0046] Fifthly, embodiments of this disclosure provide an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform any of the edge computing task offloading methods described above.

[0047] In a sixth aspect, embodiments of this disclosure provide a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform any of the edge computing task offloading methods described above.

[0048] The embodiments disclosed herein have the following beneficial effects:

[0049] Using the edge computing task offloading method, apparatus, storage medium, and electronic device provided in this disclosure, a terminal determines the state of an edge server and first information of the terminal, the first information including: device state and terminal computing task information; determines an offloading decision based on the state and the first information, the offloading decision representing whether to offload the computing task to the edge server; executes the computing task or offloads the computing task to the edge server according to the offloading decision; wherein, the state is a first state or a second state; if the state is a first state, the first information includes at least one of the following: terminal state, first latency, first energy consumption, second latency, second energy consumption, and the computational amount of image data corresponding to the terminal's encrypted computing task; if the state is a second state, the first information includes at least one of the following: terminal state, first latency, and... The first energy consumption, second latency, second energy consumption, third latency, third energy consumption, fourth latency, fourth energy consumption, and computational amount of image data corresponding to the terminal's encrypted computation task; the third latency represents the latency required for the terminal to perform proof-of-work, and the third energy consumption represents the energy consumption required for the terminal to perform proof-of-work, the proof-of-work being generated based on the pending task from the edge server; the fourth latency represents the latency required for the terminal to upload the computation task to the blockchain, and the fourth energy consumption represents the energy consumption required for the terminal to upload the computation task to the blockchain; the first latency represents the latency required to execute the computation task, and the first energy consumption represents the energy consumption required to execute the computation task; the second latency represents the latency required to offload the computation service to the edge server, and the second energy consumption represents the energy consumption required to offload the computation service to the edge server. Thus, by combining proof-of-work and an intelligent offloading decision mechanism, efficient utilization of edge computing resources is achieved, ensuring the stability and scalability of the system.

[0050] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0051] Figure 1 This is a schematic diagram of the structure of an edge network provided in an embodiment of the present disclosure;

[0052] Figure 2 A flowchart illustrating an edge computing task offloading method provided in an embodiment of this disclosure;

[0053] Figure 3 A flowchart illustrating another edge computing task offloading method provided in this embodiment of the disclosure;

[0054] Figure 4 This is a schematic diagram of the structure of an edge computing task offloading device provided in an embodiment of the present disclosure;

[0055] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. Detailed Implementation

[0056] To make the objectives, features, and advantages of this disclosure more apparent and understandable, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without creative effort are within the scope of protection of this disclosure.

[0057] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0058] If the application documents contain similar descriptions such as "first / second", the following explanation shall be added: In the following description, the terms "first / second / third" are used only to distinguish similar objects and do not represent a specific order of objects. It is understood that "first / second / third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0059] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0060] Figure 1 This is a schematic diagram of the structure of an edge network provided in an embodiment of this disclosure; as shown below. Figure 1 As shown, the edge network includes: user smart devices, micro base stations (or base stations), and edge servers.

[0061] Edge servers are physical servers with a certain storage capacity and computing performance. Their computing resources are also limited and not unlimited. Therefore, edge servers can only meet the computing needs of a certain amount of data at any given time.

[0062] User smart devices can be terminals such as mobile phones, smartphones, laptops, digital radio receivers, personal digital assistants (PDAs), tablets (PADs), portable multimedia players (PMPs), wearable devices (such as smart bracelets and smartwatches), and navigation devices. These terminals can communicate with edge servers through base station equipment.

[0063] In mobile edge computing environments, users can offload computationally intensive services from their terminals to edge servers. This avoids limitations imposed by factors such as fluctuating network conditions, limited battery power, and high CPU utilization on the terminal. While still completing service computations, this approach can significantly reduce latency or energy consumption, or achieve an optimal balance between the two. However, the system must also prevent malicious users from excessively requesting resources and consuming excessive computing power, thereby reducing system stability and availability.

[0064] When a terminal has a computationally intensive service requirement to process, it can choose to execute it locally on the terminal or offload it to an edge server. If the terminal is unable to complete the computation service due to external factors such as network fluctuations, low battery power, or high CPU load, it can choose to offload the computation service to the edge. After the edge server completes the computation, it returns the computation result to the mobile device via a wireless channel.

[0065] Offloading computing tasks refers to transferring some computing and processing tasks from endpoints (such as smartphones, sensors, and computers) to edge servers. Typically, endpoints have limited computing power, while edge servers can process data more efficiently, reducing latency and bandwidth consumption. For example, smart devices can send some data processing tasks to nearby edge servers for processing, leveraging edge servers to accelerate response times, especially in applications requiring rapid real-time processing (such as smart cities, the Internet of Things, and autonomous driving).

[0066] Figure 2 This is a flowchart illustrating an edge computing task offloading method provided in an embodiment of this disclosure, as shown below. Figure 2 As shown, the method is applied to a terminal, and the method includes:

[0067] Step 201: Determine the status of the edge server and the first information of the terminal, the first information including: device status and terminal computing task information;

[0068] Step 202: Determine an unloading decision based on the state and the first information, wherein the unloading decision represents whether to unload the computing task to the edge server;

[0069] Step 203: Execute task processing or unload the task to the edge server according to the unloading decision;

[0070] The state can be either a first state or a second state.

[0071] If the state is the first state, the computing task information includes at least one of the following: first latency, first energy consumption, second latency, second energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task;

[0072] If the state is the second state, the computing task information includes at least one of the following: first latency, first energy consumption, second latency, second energy consumption, third latency, third energy consumption, fourth latency, fourth energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task;

[0073] The third latency represents the latency required for the terminal to perform proof-of-work, and the third energy consumption represents the energy consumption required for the terminal to perform proof-of-work, wherein the proof-of-work is generated based on pending tasks from the edge server.

[0074] The fourth latency characterizes the latency required for the terminal to perform computing tasks on the blockchain, and the fourth energy consumption characterizes the energy consumption required for the terminal to perform computing tasks on the blockchain.

[0075] The first latency represents the latency required to execute the computing task, and the first energy consumption represents the energy consumption required to execute the computing task; the second latency represents the latency required to offload the computing service to the edge server, and the second energy consumption represents the energy consumption required to offload the computing service to the edge server.

[0076] Here, proof-of-work is based on the actual tasks to be processed from the edge server. That is, the actual execution of the task serves as the basis for proof-of-work, ensuring that each computation can provide meaningful results rather than being an invalid waste of computing power. This enables each computing service to produce valuable results, improves the efficient use of computing resources, and prevents malicious users from simply relying on computing power to occupy system resources.

[0077] Furthermore, by taking into account the status of the edge server, the status of the terminal, and the first information of the terminal's computing tasks, the offloading strategy is determined, which realizes the efficient utilization of edge computing resources and ensures the stability and scalability of the system in a variable environment.

[0078] In some embodiments, determining the state of the edge server includes:

[0079] Receive status indication information from the edge server, the status indication information being used to indicate the status of the edge server;

[0080] The first state is characterized by the edge server allowing the terminal to unconditionally offload its computing tasks to the task execution list of the edge server;

[0081] The second state is characterized by the fact that the edge server does not allow the terminal to unconditionally offload its computing tasks to the task execution list of the edge server.

[0082] Here, the terminal can proactively initiate offload queries, such as sending a query signal to the edge server to inquire about its status. If the edge server is currently busy, it will indicate that it is busy, for example, if the edge server has many tasks pending or the computational workload of the tasks to be processed is large. The edge server can determine its own busyness based on certain rules through self-checks; the method used by the edge server to determine its own status is not limited here.

[0083] The status of the edge server is recorded as follows c t In different c t To represent different states. For example:

[0084] c t =1 represents the first state, indicating that the edge server is relatively idle. The edge server allows all terminals to unconditionally offload computing tasks from the terminal to the task execution list of the edge server.

[0085] c t =0 represents the second state, indicating that the edge server is relatively busy. The edge server does not allow all terminals to unconditionally offload their computing to the edge server's task execution list. Tasks need to be encoded on the blockchain, and the edge server performs a dechaining operation, decoding the transaction metadata digest into its own cache.

[0086] Here, the unloading decision determined by the terminal is denoted as , This indicates that the computation task will be completed locally on the terminal. If there are any existing but incomplete computation tasks (as indicated by the computation task list) in this case... If a record is made, then the task in the task list to be completed can be performed locally on the terminal. This indicates that the computation task will be performed. The computation is offloaded to an edge server.

[0087] In some embodiments, the device status includes at least one of the following: network status, remaining battery percentage, CPU (central processing unit) load, and computing task information.

[0088] Here, each terminal can check its own device status and computing task information to determine the above information. The number of computing tasks to be processed can be N (N is greater than or equal to 1). The computing task information can include multiple computing tasks, each computing task can have different parameters, and the number of parameters can be one or more.

[0089] Here, the terminal state (i.e., the first information) can be represented as a state. Where f represents the f-th terminal device, i.e., the device number of the terminal. This represents all pending computational tasks for the current terminal f.

[0090] n t : Indicates the network status of the terminal at time t, which can be represented by signal strength.

[0091] e t : Represents the remaining battery percentage of the terminal at time t.

[0092] ρ t : Indicates the CPU load utilization rate of the terminal at time t.

[0093] A f : Represents the computational tasks to be processed at terminal time t, which can be denoted as T represents each computational task to be processed. Considering that the current terminal has N computationally intensive services to execute within a certain period of time, each service requirement is equivalent to a computational task. Therefore, the above is used here. A f This represents the computational tasks to be processed at time t.

[0094] Here, each computational task has different parameters. For example, each computational task is determined by four parameters, represented as follows: Where i represents the i-th computational task. Represents the completion of the calculation task The required amount of input data, considering that parameters may vary at different times, can also be represented by combining the data acquisition time as follows: ; Representative handles computational tasks Required computing resources; This represents the amount of output data, such as the size of the result data that the edge server needs to download to the terminal after the computation task is completed. This represents the maximum tolerable latency, indicating the time required to complete the computational task. The delay should not exceed the time. The above parameters are determined based on the actual situation of each computing task, and there are no restrictions on their values.

[0095] In some embodiments, a method is provided for determining a first delay, a first energy consumption, a second delay, and a second energy consumption.

[0096] In one example, determining the terminal's computing task information may include: for each computing task (assuming the i-th computing task) The required latency (i.e., the first latency) is determined as follows: The calculated energy consumption (i.e., the first energy consumption) is: Where 'l' stands for 'local', referring to the terminal's local location; The computing resources required for the terminal to process computing tasks. This refers to the CPU frequency of the terminal. , This represents the power consumption of the terminal CPU in each cycle, where δ and γ are chip-related constants. The data required for the above calculations can be determined based on the computing task and the terminal's own characteristics, and the calculation method can follow the formula above. It should be noted that the above is only one example, representing that the power consumption and latency mentioned above need to be considered in this embodiment of the disclosure. The method for determining the required data and the calculation method are not limited here.

[0097] In another example, determining the terminal's computing task information may include: for each computing task (assuming the i-th computing task) The cost calculation delay (i.e., the first delay) is determined as follows: The calculated energy consumption (i.e., the first energy consumption) is: ;in, For the CPU frequency of the edge server, , This represents the power consumption of the edge server's CPU per cycle, where comp represents computation.

[0098] Furthermore, assuming the computing tasks are offloaded to edge servers, additional latency and energy consumption are required for data transmission. Therefore, determining the terminal's computing task information also includes:

[0099] Assuming the terminal uses Power is used to upload data, and the uplink rate is: ;in, Indicates upload power, h t N is the channel gain of the terminal's uplink, N0 is the noise power, and W is the link bandwidth allocated to the terminal by MBS (multicast and broadcast services).

[0100] Determine the computing service Ti The latency for transmission via the wireless uplink channel is: The energy consumption during data transmission is: ; =1; comm indicates communication;

[0101] Therefore, if the computing task is offloaded to the edge server, the total latency (i.e., the second latency) is: Total energy consumption (i.e., the second energy consumption) is: .

[0102] At time t, the terminal state is The terminal can determine the offloading decision for each computing task sequentially based on its own state. First, based on the parameters of each computing task... This allows us to obtain the latency and energy consumption of each computing service running locally on the mobile device and offloaded to the edge. Then, based on the terminal status... Decision on the task Uninstallation decision Assume that each decision takes time t0, and the task list is updated every time interval T0 (t0 and T0 are both much shorter than the average time taken to compute tasks). Within time T0, the unloading decisions for all tasks in the current list are completed sequentially. Since the unloading decision for a computing task will in turn affect the device state and thus affect other computing services, all computing tasks are considered together to maximize long-term benefits.

[0103] At any given moment, the terminal may have computational tasks. This needs to be addressed, as these computational tasks may have different tolerance latency levels, for example... , This indicates the tolerable latency for each computational task; privacy levels can also be different, for example, , A higher value indicates that the image content needs more protection. This indicates the privacy level corresponding to each computing task.

[0104] It should be noted that the data required for the above calculations can be determined based on the specific computing task, and the calculation method can follow the formulas described above. It should also be noted that the above is merely an example, illustrating that the power consumption and latency factors mentioned above need to be considered in this embodiment of the disclosure. No limitations are imposed on the methods for determining the required data or the calculation methods used.

[0105] In some embodiments, if the state is a second state, determining the computing task information of the terminal's computing task includes:

[0106] Obtain data of pending tasks published by the edge server; the pending tasks are the actual tasks that the edge server needs to process, and the pending tasks are used by the terminal to perform proof of work.

[0107] Based on the data of the task to be processed, as well as the CPU frequency of the terminal and the power consumption of the CPU in each cycle, a third latency and / or a third power consumption are determined.

[0108] The data of the task to be processed includes at least one of the following: task execution computation amount, proof generation computation amount.

[0109] Here, the third time delay is denoted as The third power consumption is denoted as This refers to the state of the edge server. c t When =0, it represents the time and power consumption required for the terminal to perform blockchain proof-of-work.

[0110] Here, the data of the pending tasks published by the edge server is the actual task that the edge server needs to process. Specifically, the edge server can design some preprocessing tasks to obtain pending tasks with a security level of 0 (i.e., that can be executed by the terminal), and then execute them locally on the terminal after they are obtained.

[0111] Here, the tasks to be processed can be "training data processing" or "training data preprocessing" tasks. These tasks are used to reduce the burden on edge servers, utilize the remaining computing power of the terminals, and prepare for subsequent blockchain on-chain work. For example, the tasks to be processed can include, but are not limited to, at least one of the following:

[0112] Data cleaning can include, for example, denoising (such as removing outliers or noise from sensor readings), missing value handling (such as using simple methods (such as mean or median padding) to process incomplete local data records), and format standardization (such as converting data collected from different devices (such as images and audio) into a uniform format, resolution, or encoding).

[0113] Data labeling / augmentation can include, for example: automatic labeling (such as performing preliminary classification or labeling of local data based on simple rules or small models), and data augmentation (such as performing operations on image data such as rotation, cropping, scaling, and color dithering to increase data diversity; and performing synonym replacement and word order adjustment on text data).

[0114] Feature engineering can include: basic feature extraction (such as calculating statistical features (mean, variance, maximum / minimum, frequency, etc.) from raw data (such as time series, logs)), simple feature transformation (such as normalizing or standardizing the data) and dimensionality reduction (such as using simplified versions of methods such as PCA (principal component analysis) to perform preliminary dimensionality reduction on local data (if computationally feasible)).

[0115] Data filtering / sampling can include: rule-based filtering (e.g., filtering data samples that meet specific conditions according to rules issued by the server) and representative sampling (e.g., selecting a small portion of representative samples from a large amount of local data for uploading or use in subsequent calculations).

[0116] Privacy-preserving processing may include: data anonymization (such as blurring or masking sensitive information in the data, such as faces and license plates) and differential privacy noise addition (such as adding appropriate noise to local calculation results or data summaries to meet differential privacy requirements).

[0117] Of course, the above is just one example of a task that can be executed by a terminal and issued by an edge server; other tasks are also possible, and this is not a limitation. It is important to note that these tasks typically have relatively controllable computational loads, making them suitable for execution on edge devices (i.e., those with limited computing power and energy). The edge server can define these tasks and distribute them along with the execution code (or instructions) and input data (or data index) to the terminals participating in PoUW (Proof of Useful Work) so that the terminals can perform the proof-of-work.

[0118] The aforementioned proof-of-work method, based on real tasks from edge servers, combines task execution with the blockchain system to achieve "meaningful proof-of-work (PoUW)," avoiding the computational waste caused by traditional PoW. Specifically, traditional PoW primarily verifies the computing power of nodes in the blockchain; however, it relies heavily on computational power consumption to obtain rewards, resulting in significant meaningless computational waste. Traditional PoW is like a group of people randomly casting nets in the ocean, hoping to be the first to catch a "golden coin fish" and claim the reward; the rest get nothing in their nets. The PoUW model provided here is like underwater archaeology; everyone goes down to dig for treasure (equivalent to the real task), and whoever catches the gold coin first can bring back the excavated treasure (equivalent to the computational result), providing valuable data to the archaeological team (equivalent to the edge server).

[0119] In this way, by using the actual execution of tasks as the basis for proof-of-work, it ensures that each computation provides a meaningful result, rather than being a waste of computing power. Furthermore, it reduces the burden on edge servers, and terminals can determine whether proof-of-work and blockchain uploading are necessary based on their own circumstances, making reasonable use of the terminal's remaining computing power and preparing for subsequent blockchain uploading work.

[0120] In one example, a method for determining a third delay and / or a third power consumption is provided, comprising:

[0121] The computational load of the task is determined based on the data of the pending tasks published by the edge server. Prove the computational complexity Therefore, the total PoUW computational cost is determined: D represents the task difficulty;

[0122] Based on the total PoUW computation, determine the terminal's local PoUW latency (i.e., the third latency): And, terminal local PoUW power consumption (i.e., third power consumption): ;

[0123] in, This represents the identifier of the k-th pending task published by the edge server; This indicates the CPU frequency of the terminal. This indicates the power consumption of the terminal CPU in each cycle.

[0124] The data required for the above calculations can be determined based on the data of the task to be processed and the local conditions of the terminal. The calculation method can be based on the formulas above. It should be noted that the above is only one example, representing that the power consumption and latency of this embodiment need to be considered. The method for determining the required data and the calculation method are not limited here.

[0125] In some embodiments, if the state is a second state and the task is determined to be unloaded to an edge server based on the unloading decision, the method further includes: performing proof-of-work based on the data of the task to be processed;

[0126] The step of performing proof of workload based on the data of the task to be processed includes:

[0127] Execute the task to be processed based on the data of the task to be processed, obtain the task execution result and generate a calculation proof;

[0128] Based on the task execution results and the calculation proof, construct the first block header;

[0129] The first block header is chained to the first blockchain so that the edge server can obtain the first block header and verify the computation proof; the result of the verification of the computation proof serves as the basis for the edge server to determine whether to execute the computation task offloaded from the terminal to the edge server.

[0130] The first block header includes the following information:

[0131] The task execution result includes the hash value, computational proof, block version, previous block hash, Merkle root of task metadata, timestamp, task difficulty, random number, block type, and task identifier; the task difficulty is determined and distributed by the edge server based on the amount of tasks to be processed.

[0132] The result of the verification calculation serves as the basis for the edge server to determine whether to execute the computation task of offloading the terminal to the edge server, and represents:

[0133] The edge server verifies the proof of computation. If the verification is correct, the terminal is considered to have performed a valid proof of workload, and the terminal can then receive and process the computation tasks that it has offloaded to the edge server.

[0134] If the verification fails, it is considered that the terminal has not performed a valid proof of work, and the computing tasks offloaded to the edge server may not be received or processed subsequently.

[0135] In this way, by using the actual execution of tasks as the basis for proof-of-work, it ensures that each computation provides a meaningful result, rather than being a waste of computing power. Furthermore, it reduces the burden on edge servers, and terminals can determine whether proof-of-work and blockchain uploading are necessary based on their own circumstances, making reasonable use of the terminal's remaining computing power and preparing for subsequent blockchain uploading work.

[0136] The task difficulty is determined and assigned by the edge server based on the amount of task to be processed, and is characterized by:

[0137] If the edge server currently needs to process a large amount of tasks, the task difficulty can be increased, so that the terminal may choose to process the computing tasks locally on the terminal due to the excessive time spent on proof of work.

[0138] If the edge server currently has a small workload, the task difficulty can be reduced. As a result, the terminal may choose to offload the computing tasks to the edge server because the workload proves to be low and the terminal's current state is suitable.

[0139] In this way, edge servers can exercise some control over the computing tasks offloaded to them based on their own circumstances.

[0140] Specifically, there can be two blockchains, referred to as the first blockchain and the second blockchain. The first blockchain is designed and maintained for meaningful proof-of-work tasks. The execution of the task to be processed or the verification of the task result is considered the work itself, rather than simply an operation that wastes computing power. The resulting computational proof at least proves that the terminal has completed the task to be processed, and that the work is meaningful; that is, the obtained computational proof is a meaningful proof-of-work. The second blockchain is a traditional blockchain that serves other traditional blocks, such as the block where the unloaded computational task is uploaded.

[0141] In one example, the edge server defines the task difficulty and assigns specific computing tasks to the terminal. T k , T k This refers to tasks to be processed that are distributed by the edge server and accessible to the terminal. The terminal (e.g., terminal j) receives the task. T k Execute the task T k And obtain the task execution result. At the same time, it generates information about the correct execution of the task. T k And obtain the results Calculation proof .

[0142] Here, based on the task execution result and the computational proof, the constructed first block header may include: ResultHash (referring to the task execution result). hash value Proof (referring to computational proof) And other related content, such as Version (block version), PrevHash (previous block hash), MerkleRoot (merkle root of task metadata), Timestamp (timestamp), Difficulty (task difficulty), Nonce (random number), BlockType (block type, e.g., 1 for PoUW task block; 0 for traditional block), TaskID (task identifier, denoted as...). ).

[0143] In some embodiments, the task to be processed is executed, the task execution result is obtained, and a computational proof is generated, including:

[0144] Obtain the function of the task to be processed from the data of the task to be processed, and generate a computational proof based on the task execution process during the execution of the task to be processed;

[0145] The function represents an execution function or program used to perform the task to be processed and generate intermediate key processes.

[0146] Here, task execution and proof can be represented as computation. ;in, It is an execution function or program that performs a required task on the edge server and generates certain intermediate key processes. For the task result, For computational proof, it is to prove the validity of the computational process.

[0147] For example, It can be a functional encryption function that generates ciphertext that only edge servers can understand. This is achieved by generating computational proofs. Useful work (task execution) that the terminal can perform. get The correctness of a proof can be efficiently and trustlessly verified by other nodes in the blockchain network. Without this proof, the verifier would have to re-execute the task, causing PoUW to lose its efficiency advantage. Therefore, It serves as a bridge connecting useful work and blockchain consensus.

[0148] Here, the computational proof is generated. The approach could involve using advanced cryptographic techniques (such as zk-SNARKs, zk-STARKs) to compress complex computations into a short and easily verifiable piece of evidence, or relying on trusted hardware to ensure the integrity of the computation, enabling PoUW to be securely verified with extremely low computational cost. For example, Additional encryption processes can be designed within the code, such as encrypting the first row of an image by encrypting the elements of the first row using a non-public encryption algorithm. ExecuteAndProve... It is the encrypted result of the first row of the image. Since the amount of encrypted data is very small, it only adds a small computational burden to the edge terminal.

[0149] If the terminal needs to offload tasks to the edge server, proof-of-work is required, which means executing the tasks assigned by the edge server. The program and the corresponding tasks to be processed generate valid computational proofs. This means that the workload requirements are met.

[0150] One example provides a way for a terminal to construct the first block header. The first block header is denoted as... :

[0151]

[0152] Among them, finding random numbers is: finding Make Hash( ) <Target(D);

[0153] Target(D) is the target value. The goal of PoW is to find a hash value less than Target(D). This target value is related to D, which represents the task difficulty. D is issued by the edge server. Target(D) is inversely proportional to D. For example, , As a preset constant, the easier the task difficulty (D), the larger the Target (D), the smaller the PoW difficulty, and the less time required; conversely, the more difficult the task, the smaller the Target (D), the more PoW difficulty, and the more time required.

[0154] Correspondingly, another example provides a method for edge server-side verification of the first block header. The edge server receives the longest first blockchain (i.e., the most recently updated first blockchain) and verifies each block in the first blockchain sequentially, including basic verification, PoW verification, and difficulty verification. Basic verification includes checking the version, the hash of the previous block, and the timestamp. PoW verification includes determining the BlockType; if BlockType=1, verifying:

[0155]

[0156] As above, Forward inference was performed. `VerifyProof()` is a verification mechanism used to confirm whether the device has completed the task correctly and to output the result. It is valid. A successful verification returns True, indicating that the proof of the task and result is valid and the task execution proceeded without issue; otherwise, it returns False, indicating that the proof of the task and result is invalid.

[0157] In this way, the above process ensures the validity of task execution, avoiding the need for verification nodes (i.e., edge servers) to re-execute computation tasks, thereby improving system efficiency. For example, combining the above example, decoding can be used... To verify whether the terminal has completed program execution, restore the content of the first line of the image.

[0158] The PoUW method provided in this disclosure, on the one hand, uses the actual execution of the task as the basis for proof of work, ensuring that each computation can provide meaningful results rather than being an invalid waste of computing power.

[0159] On the other hand, considering that in open edge computing environments, malicious users may excessively consume computing resources, affecting system stability and performance, the above-mentioned workload demonstration demonstrates that resources can be allocated reasonably to avoid resource abuse and prevent malicious users from occupying computing resources, ensuring that each task produces valuable results and preventing malicious users from simply relying on computing power to consume system resources.

[0160] In some embodiments, this disclosure also provides conventional task blockchain technology for all terminals. If a terminal needs to send a computing task to an edge server, the terminal needs to package and upload it to the blockchain (specifically, it can upload it to a second blockchain). First, the terminal needs to receive a terminal-defined difficulty value defined by the edge server. Furthermore, the terminal packages the transaction metadata (key task information) of a batch of tasks that are currently being prepared for uninstallation or local execution into a candidate block, which specifically includes the following types of data: block header field and transaction (task) data field.

[0161] The block header fields include:

[0162] Device ID: A unique ID number that identifies all local devices in the blockchain.

[0163] Previous block hash (PrevHash): Points to the header hash of the previous block, ensuring the continuity of the blockchain;

[0164] Merkle Root: The root hash obtained by hashing all transaction records to be packaged pairwise; any change to any transaction data will cause the root hash to change.

[0165] Timestamp: Records the local time when the candidate block was generated, usually accurate to the second;

[0166] Difficulty target: The target hash threshold that the current PoW computation needs to reach, used to control the block production rate;

[0167] Nonce: A number that increments continuously until the hash reaches the difficulty target.

[0168] The transaction (task) data fields include:

[0169] Each transaction corresponds to one or more computational tasks to be executed. The content packaged into the candidate block includes:

[0170] Task ID: A globally unique identifier for a computing task, used for querying and verification;

[0171] Input data hashing: Hash the input data, upload only the hash and not the plaintext, saving bandwidth and protecting privacy;

[0172] Computational load: The number of CPU cycles required for a given computational task, used to estimate resources in edge service areas;

[0173] Output data size: used to estimate downlink backhaul latency and energy consumption after unloading;

[0174] Maximum tolerable delay t: used to constrain time;

[0175] Privacy level V: Any value of 1, 2 or 3, used to indicate whether encrypted areas need to be processed;

[0176] Privacy mask hash (MASK hash, denoted as Hmask ): Only upload the hash of the encrypted region mask to verify the uniform mask used by the edge server;

[0177] Device status summary: such as current network status n t Remaining battery percentage e t CPU load utilization ρ t A small summary, which is convenient for on-chain smart contracts or consensus nodes to use as a strategy reference.

[0178] In order to reduce the block size, the real system often only uploads the hash or digest of the above fields, while the actual input or mask and other big data are stored on the terminal or edge server, and only the index is left on the chain.

[0179] The process of packaging and uploading the terminal to the blockchain includes:

[0180] 1. The terminal serializes the fields of each of the above tasks in a certain format, calculates the hash of each transaction, and forms a transaction list.

[0181] 2. Combine the hashes of all transactions in pairs and calculate to obtain the root hash MerkleRoot.

[0182] 3. Fill in the block header, and fill in Version, PrevHash, Timestamp, Difficulty, MerkleRoot, and Nonce (initially set to 0) in the block header.

[0183] 4. PoW process: Continuously change Nonce and recalculate the double SHA-256 hash of the entire block header until the condition is met: Hash(BlockHeader) < Target. Here, Target is determined by Difficulty, and Difficulty is determined by the edge server. The edge server will dynamically determine Difficulty based on the amount of tasks already received and the length of the task chain encoded successfully on the blockchain. When Difficulty is infinite, the edge server can reject any local device from offloading tasks to the edge side.

[0184] 5. After the terminal locally designs and finds a legal block, it broadcasts the complete block containing the computing task information to the blockchain network; each node in the network can verify the block structure, Difficulty, MerkleRoot, and transaction validity, and after passing the verification, add it to its respective local chain.

[0185] Here, only the block header and the transaction metadata summary can be stored on the blockchain, without directly storing large files or plaintext. Transaction (task) data includes the above task ID, input / output size, computing amount, latency requirement, privacy mask hash, device status summary, etc. The entire process ensures that confidential tasks can be trusted to be uploaded to the chain, verified, and trigger edge offloading execution.

[0186] The embodiment of the present disclosure also provides a method for a terminal to estimate the computing amount and overhead of blockchain encoding (PoW). Here, the proof-of-work process is used to simulate the computing amount of "packing tasks onto the chain":

[0187] Let the target difficulty of the current chain be , then the expected number of hash attempts is: (or, more generally, according to the formula , here the simplified form is taken).

[0188] Let the single hash computing amount (that is, the CPU cycles required for one round of SHA-256 input and output) be , then the total computing amount: .

[0189] The terminal's CPU frequency is (cycles / s); power per cycle is (W), then the terminal PoW latency and power consumption (equivalent to the fourth latency and the fourth power consumption) are determined as follows: , .

[0190] In some embodiments, determining an unloading decision based on the state and the first information includes:

[0191] The first information is identified using an offloading strategy model to obtain an identification result, which indicates whether the computing task is offloaded to the edge server.

[0192] The unloading strategy model is obtained by training a dual neural network on a training dataset. The dual neural network includes an online neural network and a target neural network.

[0193] Each training data point is represented by a quadruple, which includes: state information at a first time, action, immediate reward from environmental feedback, and state information at a second time, which is the time following the first time.

[0194] The action is either a first action or a second action. The first action indicates that the terminal executes a task, and the second action indicates that the computing task is offloaded to the edge server for execution.

[0195] The status information includes at least one of the following: device status, first latency, first energy consumption, second latency, second energy consumption, and computational amount of image data corresponding to the terminal encryption computation task; if the action is the second action, the status information also includes at least one of the following: third latency, third energy consumption, fourth latency, and fourth energy consumption;

[0196] The instant reward is determined based on the status information and actions during the first time period.

[0197] In some embodiments, if the state is a first state, the immediate reward is determined based on a first immediate reward function, which is constructed based on at least one of the following information:

[0198] Terminal status;

[0199] The latency and / or energy consumption of computing tasks executed on the terminal;

[0200] This indicates the latency and / or energy consumption of offloading computational tasks to edge servers for execution;

[0201] The computational load of the image data corresponding to the terminal encryption computation task.

[0202] In some embodiments, if the state is a second state, the immediate reward is determined based on a second immediate reward function, which is constructed based on at least one of the following information:

[0203] Terminal status;

[0204] The latency and / or energy consumption of computing tasks executed on the terminal;

[0205] This indicates the latency and / or energy consumption of offloading computational tasks to edge servers for execution;

[0206] The latency and / or energy consumption of the terminal blockchain encoding;

[0207] The latency and / or energy consumption required for the terminal to perform proof of work;

[0208] The computational load of the image data corresponding to the terminal encryption computation task.

[0209] Here, the unloading strategy model can be obtained by the edge server training a dual neural network based on the training dataset, and the terminal can receive the unloading strategy model from the edge server.

[0210] Based on this, in some embodiments, the method further includes:

[0211] Collect training data;

[0212] The training data is sent to the edge server, and the training data is used by the edge server to train the offloading strategy model;

[0213] Receive the offload strategy model sent by the edge server.

[0214] The following describes a process for training an unloading strategy model, specifically including:

[0215] Obtain at least one training data set;

[0216] Construct an online neural network and a target neural network, wherein the online neural network and the target neural network have the same structure;

[0217] The at least one training data is input into the online neural network to train the online neural network, and the network parameters of the target neural network are updated according to the network parameters of the online neural network at a target period until the training target is reached. The trained target neural network is used as the unloading strategy model.

[0218] Here, the training data is represented using quadruples, which are represented as follows: t represents a point in time. The state information at time t (equivalent to the state information at the first time mentioned above) For actions, Instant rewards for environmental feedback This refers to the state information at time t+1 (equivalent to the state information at the second time mentioned above).

[0219] Specifically, the status information is recorded as , . n t : Represents the network status of the terminal at time t, which can be represented by signal strength. e t : Represents the remaining battery percentage of the terminal at time t. ρ t : Indicates the CPU load utilization rate of the terminal at time t. This represents the overhead associated with completing the computation task at time t.

[0220] when When, it indicates the first action, that is, the computation task is completed on the terminal; when When =1, it indicates the second action, which is to choose to offload the computing task to the edge server to complete the computing.

[0221] Status information , indicating the state Next choice decision The terminal status afterwards.

[0222] The immediate reward representing environmental feedback is intended to minimize latency and energy consumption, while also taking into account the computational task. T t,1 latency limit τ t,1 and device power limits e t And defined.

[0223] The following explains how to collect training data.

[0224] In one example, The edge server allows all terminals to unconditionally offload computing tasks from their terminals to the edge server's task execution list. Therefore, in the current... In this case, the terminal needs to make its own decision. The terminal offloading decision is... The process of collecting training data includes:

[0225] Determine the terminal ; Where t represents time, These represent the latency and energy consumption required to execute a computing task on the terminal, respectively. These represent the total latency and total energy consumption required to offload computing tasks to edge servers, respectively. This represents the computational load of the image data corresponding to the local terminal's encrypted computation task.

[0226] definition The total overhead of computing tasks executed on the terminal. ; Calculation methods include:

[0227] Latency and energy consumption of computing tasks executed locally :

[0228]

[0229]

[0230] Since the terminal makes decisions on each task sequentially, here, This represents the latency and energy consumption required for the computation task ranked first in the terminal task list at time t to execute the computation task on the terminal. τ t,1 This represents the latency limit of the computation task ranked first in the terminal task list at time t. `inf` indicates that the value approaches infinity.

[0231] Determine total cost The weighted average of the two is: ; and They are respectively The weights of the two.

[0232] definition When =1, the total overhead of the computing task being offloaded to the edge server for execution. The calculation methods include:

[0233] Latency and energy consumption of offloading computing tasks to edge servers :

[0234]

[0235]

[0236] in, These represent the total latency and total energy consumption required for the computation task ranked first in the terminal task list at time t to be unloaded and executed on the edge server.

[0237] Determine total cost The weighted average of the two is: ; and They are respectively The weights of the two.

[0238] Based on the latency and energy consumption of computing tasks executed on terminals and edge servers, and defining the state of mobile devices... Make decisions in a timely manner Instant reward (reward) function .

[0239] In one example, When using the first immediate reward function, it can be as follows (1):

[0240] (1)

[0241] in, The formula for calculating the immediate reward of environmental feedback is used as the result. ; , , , These are all set constants or weighting coefficients, and their values ​​are not limited; This indicates the computational load of the image data corresponding to the encryption computation task, which can be specifically the proportion of the encrypted region in the encrypted image to the total image. This indicates the latency and / or energy consumption of the computing task executed on the terminal; This indicates the latency and / or energy consumption of offloading computational tasks to edge servers for execution; This indicates the network status of the terminal at time t. This represents the percentage of battery remaining in the terminal at time t. This represents the CPU load utilization rate of the terminal at time t; This indicates that the computation task is performed locally on the terminal. This indicates that the computation task will be performed. The computational task is offloaded to an edge server.

[0242] In another example, Edge servers do not allow all terminals to unconditionally offload computing tasks from their terminals to the edge server's task execution list. The process of collecting training data includes:

[0243] Determine terminal status ,as follows:

[0244] .

[0245] definition The total overhead of computing tasks executed on the terminal. See the formula in the example above for details;

[0246] definition When =1, the total overhead of the computing task being offloaded to the edge server for execution. See the formula in the example above for details;

[0247] Based on the latency and energy consumption of computing tasks executed on terminals and edge servers, and defining the state of mobile devices... Make decisions in a timely manner Instant reward (reward) function .

[0248] In one example, When using the second instant reward function, it can be expressed as follows (2):

[0249] (2)

[0250] in, This indicates the energy consumption of the terminal blockchain code (PoW). This indicates the latency of the terminal blockchain code (PoW). This indicates the latency of the terminal performing proof-of-work. This indicates the energy consumption of the terminal during proof of work.

[0251] A formula for calculating the immediate reward of environmental feedback; This indicates the computational load of the image data corresponding to the terminal encryption computation task; This indicates the latency and / or energy consumption of the computing task executed on the terminal; This indicates the latency and / or energy consumption of offloading computational tasks to edge servers for execution; This indicates the network status of the terminal at time t. This represents the percentage of battery remaining in the terminal at time t. This represents the CPU load utilization rate of the terminal at time t; This indicates that the computation task is performed locally on the terminal. This indicates that the computation task will be performed. The computational task is offloaded to an edge server; This indicates the computational load of the image data corresponding to the terminal encryption computation task; , , , These are all set constants or weighting coefficients.

[0252] Specifically, considering that if the maximum Q-value estimated by the online neural network is directly used as the target during updates, the target will drift continuously and fail to converge, a proposal is made to train two sets of neural networks with identical structures (i.e., an online neural network and a target neural network). By introducing a delayed update target neural network, the target value remains unchanged within N steps, avoiding the oscillations caused by "moving the target". That is, by using two sets of neural networks with identical structures.

[0253] The above two examples illustrate respectively and This refers to the immediate reward function used to offload computational tasks to edge servers, and the required data. Of course, other formulas can be used for designing the formula, such as... Weights can also be designed separately. Alternatively, it can be expressed as follows:

[0254] .

[0255] Taking all the above information into account, there are no restrictions on the design of the formula.

[0256] The following provides a method for training a dual neural network for reinforcement learning.

[0257] A dual neural network consists of an online neural network (DQN1) and a target neural network (DQN2), each with an input layer, hidden layers, and an output layer. The input layer receives the state vector. The hidden layers can be 2-4 layers, each with 128-512 neurons, activated using ReLU to enhance non-linear expressiveness. The output layer outputs a value of length equal to the number of actions. The vector, in example 2 of this disclosure, each component is... Value estimation corresponding to an action.

[0258] The online neural network DQN1 and the target neural network DQN2 have identical structures, but different parameter sets. The parameter set of the online neural network DQN1 is denoted as... The parameter set of the target neural network DQN2 is denoted as Therefore, the online neural network DQN1 can be denoted as... Used to determine the current parameters Selecting actions (ε-greedy) and calculating gradients and updating parameters during training. The target neural network DQN2 can be denoted as... ,parameter Every N steps from the online neural network Synchronization once is represented as: N is greater than 1, and there is no restriction on the value of N. This allows for a certain degree of stability in the calculation of the Q-value objective. Here, the Q-value represents the value of an action; DQN estimates the value (Q-value) of each action and selects actions using an ε-greedy policy.

[0259] The training process includes the following steps:

[0260] 1. Interact and sample: Execute an action to change the current state. With action Send it into the environment and execute the action. Observe the feedback and receive an immediate reward from the environment. and the next state The instant reward function is shown above, which takes into account factors such as latency, energy consumption, and privacy costs; see the example of the training sample data above for details, which will not be repeated here.

[0261] Samples are continuously stored during this process, and quadruplets are stored. Store the samples in the experience replay pool D; when |D| reaches its upper limit C, the new sample will overwrite the oldest sample. Randomly select B samples from the experience replay pool D, denoted as B1, B2, B3, B4, B5, B6, B7, B8, B9 This serves as training sample data; here, random sampling not only breaks down temporal correlations but also allows the neural network to encounter more diverse experiences. for Previous state.

[0262] 2. Initialize network parameters: Randomly initialize the parameters θ of the online neural network DQN1, and copy the parameters of the target neural network DQN2 to... ←θ.

[0263] 3. Construct an experience replay pool to store the interactive samples required for training. This experience replay pool can be a circular buffer with a capacity of C (denoted as D). The experience replay pool can break the correlation of time series data and improve the sample utilization rate.

[0264] 4. Set the training hyperparameters, which include: exploration rate (denoted as ε), discount factor (denoted as γ, γ∈[0,1]), learning rate (denoted as η), mini-batch size (denoted as B), and target neural network synchronization interval (i.e., N). These hyperparameters can be designed based on experience and training requirements, and their values ​​are not limited.

[0265] 5. Construct behavioral strategies (denoted as ε-greedy), which, while ensuring a certain degree of exploration, lean towards actions with higher value.

[0266] Here, each time in the state Select action First, generate a random number in the interval [0,1]. If the random number... Then a random action is selected. (Uniform exploration); otherwise, with probability 1- Select actions using a greedy strategy. , As training progresses, the intensity gradually decreases. This allows agents to shift from "extensive experimentation" to "concentrated use of learned strategies."

[0267] 6. Training the network: At the start of training, let... That is, the parameters are synchronized once during initialization, and then every time... After a mini-batch gradient update or step-by-step interaction, a hard update is performed, changing the parameters of the target neural network. Update the parameters to the online neural network ,Right now Within these N steps, the parameters of the target neural network The parameters of the online neural network remain unchanged and are used to calculate the static target Q value, thus avoiding the need for parameter optimization. Too rapid updates cause the target to drift.

[0268] For the first in the experience pool Sample The target Q-value is given by the target neural network. ; It is a maximum value estimate of all possible actions in the next state, based entirely on the old parameters. Therefore, in the current small batch calculation regarded as against The constant.

[0269] Parameters of the fixed target network Updating every N steps provides a buffer period for the online neural network, allowing it time to approach a relatively stable target Q-value before synchronously updating the target neural network. This helps with training convergence and reduces overestimation bias. If each update... θ At the same time, the target neural network also uses the latest... θ If the online neural network's parameters change continuously, the target neural network will adjust itself, leading to gradient oscillations and difficulty in training convergence. Therefore, synchronizing the target neural network's parameters only every N steps avoids this problem and promotes a more stable training process.

[0270] In this embodiment of the disclosure, a loss function is also provided, defined as follows:

[0271] The online neural network estimates the current Q-value using the parameters of the online neural network DQN1. θ Give:

[0272] Mean squared Bellman error definition: For a minibatch of B training samples, the loss function is as follows:

[0273]

[0274] in, It is the static target Q value. It is the Q-value estimated online.

[0275] When differentiating the loss function L, It is considered a constant. The gradient only acts on... This ensures the stability of the semi-gradient update.

[0276] The gradient is calculated as follows: ; The gradient.

[0277] Update the online neural network using an optimizer (such as Adam or SGD). η is the learning rate.

[0278] Monitor average reward, loss reduction, or policy performance (such as task completion rate, energy consumption / latency metrics). When the metrics stabilize, approach the optimum, or exceed a predetermined threshold, training can be terminated to obtain the final Q-value estimate. That is, the target neural network is obtained and used as the unloading strategy model.

[0279] Considering that although blockchain technology ensures the integrity and immutability of on-chain task summary data through hashing and digests, actual computational task data (especially tasks containing sensitive images) still faces potential privacy leakage risks during the process of uploading from the terminal to the edge server, and during storage and processing on the edge server. Therefore, this disclosure proposes to encrypt the uploaded task at the terminal. Specifically, a method is proposed to encrypt sensitive regions (denoted as MASK regions) in an image according to their privacy level (denoted as V) to construct a secure and reliable edge computing offloading framework to ensure security, while maintaining low computational cost.

[0280] Based on this, in some embodiments, the data of the computing task includes task image data; the step of offloading the computing task to the edge server according to the offloading decision includes:

[0281] The encrypted region selection model is used to identify the encrypted regions in the task image data.

[0282] Feature extraction is performed on the encrypted region, and the extracted features are then normalized to obtain the data to be encrypted.

[0283] Generate a feature hash value based on the data to be encrypted;

[0284] A key is generated based on the feature hash value, as well as the privacy level, salt value, and / or context information;

[0285] The task image data is encrypted using the key to obtain encrypted task image data;

[0286] The encrypted task image data is sent to the edge server.

[0287] In some embodiments, the method further includes at least one of the following:

[0288] The salt value is pre-agreed with the edge server;

[0289] Receive the privacy level sent by the edge server;

[0290] The context information is sent to the edge server.

[0291] Specifically, the privacy level is provided to the terminal by the edge server. There is a mapping relationship between the privacy level and the encryption strength; a higher privacy level indicates a greater need for protection of the image content, and thus a higher encryption strength. Here, this mapping relationship is established by mapping the privacy level to different AES key lengths.

[0292] For example, V=1 indicates a low privacy level, with the encryption algorithm being AES-128 and the key length being 128 bits; this provides basic protection with minimal computational overhead.

[0293] V=2 indicates a medium privacy level, with the encryption algorithm being AES-192 and the key length being 192 bits; this provides stronger protection with moderate computational overhead.

[0294] V=3 indicates a high level of privacy, with the encryption algorithm being AES-256 and the key length being 256 bits; this provides the highest level of protection but also has the highest computational cost.

[0295] V=0 (or V not specified) indicates an extremely low privacy level or no encryption. Lightweight methods (such as simple XOR pseudo-random number streams) can be used, but for security and robustness, it is recommended to use at least AES-128. Here, for the sake of simplification, it is assumed that encryption is required for all V≥1.

[0296] Specifically, after determining the encryption region (MASK) using the encryption region selection model, an encryption key is generated based on the features of the encryption region. Here, the encryption region is a portion of the image. Assuming the image to be encrypted is an image of a person, the encryption region (such as a privacy region) determined by the encryption region selection model is only the face portion of the image.

[0297] In the embodiments disclosed in this invention, the key is not generated completely randomly, but is derived from the unique characteristics of the encrypted area (MASK) to ensure that the encrypted key is closely related to the encrypted area (MASK) it protects.

[0298] Here, features of the encrypted region are extracted and normalized. To ensure that the same key can be generated for each MASK regardless of the original data format of the encrypted region, a unified normalization process is proposed for the MASK region data. The normalization method can be set based on actual needs and is not limited. Two normalization methods are provided below.

[0299] Method 1: Binary MASK (e.g., image mask), which arranges each pixel (0 or 1) of the image in a fixed order (e.g., from top to bottom, from left to right) to form a deterministic binary bit string.

[0300] For example, suppose we have a 3x3 image. By using the binary MASK method, we can arrange the value of each pixel in order from top to bottom and from left to right to obtain a binary bit string, say 100110001. This deterministic binary bit string can be used to represent the content of the image.

[0301] Method 2: Region MASK (e.g., a coordinate list), sort the coordinate points of all polygon regions in ascending order, and convert these coordinate values ​​into a standardized binary representation.

[0302] For example, consider a simple polygonal region with vertex coordinates of (2,3), (4,5), (3,7), and (1,6). Sort these coordinates in ascending order (first by x-coordinate, then by y-coordinate if x-coordinates are the same), resulting in (1,6), (2,3), (3,7), and (4,5). Convert these coordinates to a standardized binary representation. Assume that the x and y values ​​of each coordinate are within the range [0,10], and that the coordinates are converted to a fixed-length binary representation using some method (such as simple scaling). For example, x=1 is represented as 00001 in binary, and y=6 as 00110. After converting the x and y values ​​of all coordinates, we obtain the binary string: 00001 00110 00010 00011 00011 0011100100 00101, which is the standardized binary representation obtained through the region masking method.

[0303] The normalized encryption region (i.e., the data to be encrypted) is represented as: Canonicalize(·) represents the conversion of the original encrypted region into a deterministic, standardized representation.

[0304] Specifically, after obtaining the normalized MASK data (i.e., the data to be encrypted), a feature hash is generated based on the data to be encrypted. This is done by hashing the normalized MASK data to ensure a fixed-length hash value is generated for subsequent key derivation. The hash algorithm used here can be SHA-256 or SHA-3, which can convert MASK data of different formats into hash values ​​of uniform length. The hashing process is represented as follows: .in, The hash value representing the mask (i.e., the encrypted area), also known as the characteristic hash value, has a fixed length (e.g., 256 bits).

[0305] Specifically, upon obtaining Next, the key corresponding to the MASK data is generated. Here, a Key Derivation Function (KDF) is used to derive the symmetric key from the aforementioned feature hash value. For example, the KDF is specifically the HKDF (HMAC-based Key Derivation Function), which takes the input hash value, salt value, context information, and key length as input to generate the final key.

[0306] The KDF formula can be expressed as: Here, salt is the salt value, used to enhance the security of the key. The salt value is very important; it is a fixed key value that is agreed upon by the local terminal and the edge server and cannot be sent. The feature hash value extracted from the MASK region is used as one of the input key materials, and the generated key is closely related to the MASK region. Info represents contextual information (such as task ID or encryption type). This indicates the key length, which is determined according to the aforementioned privacy level. Decide.

[0307] Using the key derivation method described above, on the one hand, since each key is uniquely derived from its encryption region, the key's lifespan is directly bound to the encryption region. For example, if the encryption region changes, the derived key will also change accordingly. This binding ensures simplified key management, eliminating the need to explicitly store each key; instead, keys can be re-derived from the encryption region data and related parameters.

[0308] Through the above derivation process, key generation is deterministic. As long as the data in the encrypted region, the privacy level V, the salt value, and the context information (such as the task ID) are consistent, the same key will be generated regardless of when the derivation is repeated. Thus, the decryptor only needs the encrypted region data and other relevant parameters to derive the correct key. If any change occurs in the encrypted region (even a minor one), its normalized representation will change, leading to… The changes generate new keys, and this mechanism provides automatic key rotation without the need for manual updates.

[0309] On the other hand, since the key is derived by the terminal based on the above method, rather than being transmitted, the terminal only needs to send the encrypted data, privacy level, and context information to the decryptor (such as an edge server), without transmitting the key itself. The edge server uses this information and, based on the agreed-upon non-transmitted salt value, re-derives the key according to the same key derivation process to perform decryption, thus improving the security of data transmission. Simultaneously, after decrypting and obtaining the original image, the decryptor (such as the edge server) can determine whether the data has been tampered with and verify the correctness of the decryption process by calculating the mask region on the decrypted image.

[0310] In this way, the masked areas of each image (such as faces and backgrounds) are encrypted using MDK derived keys. Terminals and edge servers can use the same derivation process for encryption and decryption.

[0311] By deriving corresponding keys based on the MASK region and encrypting the image as described above, sensitive areas of the data are encrypted when the data is offloaded to the edge server, ensuring that the edge server can only decrypt the data under the correct context and conditions. Here, deriving keys from the characteristics of the MASK data greatly simplifies key management and distribution while enhancing the security of encrypted data. This method is particularly suitable for edge computing and mobile device scenarios, achieving efficient execution while balancing privacy protection and resource management.

[0312] In some embodiments, after key derivation is completed (i.e., generating a key based on the feature hash value, privacy level, salt value, and context information), the key is used to encrypt and / or decrypt data. To ensure that data in the encrypted region (MASK region) is not leaked, it is proposed to use a symmetric encryption algorithm (such as AES) to encrypt this region. Specifically, the AES-GCM (Authenticated Encryption with Associated Data) mode can be used to ensure both confidentiality and authentication.

[0313] Specifically, encrypting the encrypted region in the task image data using the key includes:

[0314] A symmetric encryption algorithm is used to encrypt the encrypted region in the task image data according to the key and initialization vector.

[0315] Specifically, based on the generated key, the encrypted area is encrypted using a symmetric encryption algorithm, including:

[0316] 1. Data Preparation: Prepare the data (such as images, coordinate regions, metadata, etc.) of the area to be encrypted as plaintext. Use a region identifier (region_id) to determine the region to be encrypted, which, as in the example above, could be a region in an image.

[0317] 2. Construct the data required for encryption, including:

[0318] Constructing a symmetric key ( Specifically, the derived key is used as the symmetric key;

[0319] Constructing the Initialization Vector (IV): AES-GCM mode typically requires a unique random initialization vector (IV) for "randomness" in the encryption process.

[0320] Authentication Tag: In AES-GCM, an authentication tag is generated to ensure data integrity and authentication.

[0321] 3. Encrypt the encrypted area using a symmetric encryption algorithm, as shown in the following formula:

[0322]

[0323] in, Indicates the encryption mode used. This represents the encrypted ciphertext. This represents the data in the encrypted area (i.e., the MASK area) to be encrypted. Indicates the derived key. This represents the initialization vector (which can generate a unique IV for each ID device).

[0324] After encryption, the terminal sends the encrypted data (CT_mask) along with the authentication tag to the edge server. Simultaneously, it sends the region identifier (region_id), privacy level V, and other possible contextual information (such as the task ID). The salt value, a shared key between the edge server and the terminal, does not need to be sent. Because the key is a unique identifier and privacy level derived from the MASK region, during transmission, other information (such as the region identifier and privacy level) is sent to the edge server. The edge server can then use this information to derive a new key and perform decryption.

[0325] Accordingly, a decryption method is provided so that the edge server can decrypt the encrypted data after receiving it. Specific methods may include:

[0326] 1. Derivation of Decryption Key: The edge server uses the same region identifier (region_id), privacy level (V), and salt value to generate the same key as the terminal via a key derivation function (KDF). The formula is as follows:

[0327]

[0328] in, The salt value represents a fixed key value that is agreed upon by the local terminal and the edge server and cannot be sent. This represents a region identifier used to identify the encrypted region, which can be sent from the terminal to the edge server; This indicates the privacy level, and the key length can be determined based on the privacy level. L Therefore, the key generation formula on the edge server side can also be expressed as: Additionally, if the terminal still uses `info`, then the edge server should use the following formula: ;info represents context information (such as task ID or encryption type), which can be agreed upon by the terminal and the edge server or sent by the terminal to the edge server.

[0329] 2. Decrypt using the derived key and the received encrypted data (CT_mask), as shown in the following formula:

[0330]

[0331] Plaintext refers to the decrypted plaintext data, i.e., the original MASK area data. This is the encrypted ciphertext. The tag is an authentication label used to verify data integrity. During decryption, AES-GCM mode verifies the authentication tag. If the tag matches, it means the data has not been tampered with during transmission; if the tag does not match, the decryption process will fail.

[0332] A derived key (MDK) is used to encrypt data in the mask area using a symmetric encryption algorithm such as AES-GCM. The encrypted data includes ciphertext and an authentication tag, ensuring data confidentiality and integrity. Upon receiving the data, the edge server generates a key using the same protocol and key derivation process, then decrypts the data and verifies its integrity. This method tightly binds the key to the data area, enhancing data protection security while reducing the complexity of key management and transmission.

[0333] In some embodiments, the method further includes:

[0334] Send an annotated image dataset to the edge server; the annotated image dataset is used by the edge server to train an encrypted region selection model;

[0335] Receive the encrypted region selection model sent by the edge server.

[0336] Here, the encrypted region selection model is obtained through generative adversarial training.

[0337] This document provides a method for training an encrypted region selection model on an edge server, comprising: acquiring a training dataset; constructing a generative adversarial network (GAN); and training the GAN based on the training dataset.

[0338] Here, each terminal device creates an labeled image dataset, which may contain, for example, portrait images and their corresponding name tags; the terminal then sends the image dataset to the edge server.

[0339] Here, the generative adversarial network (GAN) built by the edge server includes: discriminator D and generator G.

[0340] The discriminator D is a face recognition network used to recognize the input image, such as the portrait image P mentioned above, and the output is the corresponding name label.

[0341] The generator G is the encryption region selection model, responsible for determining which regions in the image need to be encrypted. The model's inputs include:

[0342] Labeling image data (e.g., portrait images and their corresponding name tags): such as an HxWx3 image P, where H is the number of rows (height) of the image, W is the number of columns (width) of the image, and 3 indicates that each pixel has three color channels (RGB);

[0343] Privacy level V: Indicates the level of privacy sensitivity, which can be 1, 2 or 3;

[0344] Task response time tolerance t: the maximum delay time that the task can tolerate.

[0345] The model output is an encrypted region (MASK), which can be represented as an HxWx1 MASK matrix. Each point on the matrix is ​​0 or 1, indicating whether the position needs to be encrypted. For example, 0 means no encryption and 1 means encryption.

[0346] Specifically, the edge server collects all image data from the terminal device and constructs a dataset. For each image P, from a common tolerable latency range [t]... low ,t high Randomly sample J values ​​t1, t2, ..., t J Using privacy levels (V=1, 2, or 3), a total of 3xJ training samples are generated. These 3xJ training samples are then used to train the generator G and the discriminator D. The discriminator D is trained to accurately identify the names corresponding to the images, while the generator G is trained to generate a MASK matrix of encrypted regions, ensuring that images encrypted through region selection cannot be correctly identified by the discriminator D.

[0347] The process for each round of training is as follows:

[0348] Use generator G to generate the MASK region;

[0349] The MASK region is encrypted using the AES encryption method to obtain the corresponding encrypted image P';

[0350] The loss function is calculated, where the discriminator D and the generator G each use the loss function L. D and L G Training, L D Let L be the loss function of the discriminator D. G Let G be the loss function for the generator; as follows:

[0351]

[0352]

[0353] Where N is the number of elements in the original image set, which is also equal to the size of the encrypted image set. For L, it is an image in the image set; D Both the original image set P and the encrypted image set P' are traversed. For L G Only the encrypted image set P' is traversed. For the corresponding The true label, This is the recognition result of discriminator D. The sum of all elements in the MASK matrix represents the number of encrypted pixels; w v and w t This parameter represents the weight corresponding to the privacy level V and the task response time tolerance t, and limits the size of the mask region selected by G.

[0354] The above loss function can also be:

[0355]

[0356]

[0357] After multiple rounds of training, training can end when the loss functions of the generator and discriminator no longer change significantly, indicating that the model has converged. Once training is complete, the edge server distributes the trained generator G as the encrypted region selection model to all terminals. The terminals then use the encrypted region selection model to select encrypted regions from the image.

[0358] The method provided in this disclosure proposes an intelligent offloading decision mechanism. By comprehensively considering multiple factors (such as terminal status, various latency, energy consumption, and the computational amount of image data corresponding to terminal encrypted computing tasks), it ensures optimal task offloading decisions. Furthermore, considering that the increase in the number of edge computing devices (i.e., terminals) and tasks may lead to system crashes or performance degradation due to computational overload, network instability, or improper allocation of computing resources, the method combines the PoUW approach with the intelligent offloading decision mechanism to achieve efficient utilization of edge computing resources, ensuring the stability and scalability of the system in variable environments.

[0359] Figure 3 This is a flowchart illustrating a task processing method for an edge server provided in an embodiment of this disclosure; as shown below. Figure 3 As shown, the method is applied to an edge server, and the method includes:

[0360] Step 301: Send status indication information to the terminal, the status indication information being used to indicate the status of the edge server; the status is either a first status or a second status;

[0361] The status indication information is used by the terminal to determine an offloading decision by combining the status of the edge server and the terminal's first information. The offloading decision indicates whether to offload the computing task to the edge server. The first information includes: device status and the terminal's computing task information.

[0362] The state can be either a first state or a second state.

[0363] If the state is the first state, the computing task information includes at least one of the following: first latency, first energy consumption, second latency, second energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task;

[0364] If the state is the second state, the computing task information includes at least one of the following: first latency, first energy consumption, second latency, second energy consumption, third latency, third energy consumption, fourth latency, fourth energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task;

[0365] The third latency represents the latency required for the terminal to perform proof-of-work, and the third energy consumption represents the energy consumption required for the terminal to perform proof-of-work, wherein the proof-of-work is generated based on pending tasks from the edge server.

[0366] The fourth latency characterizes the latency required for the terminal to perform computing tasks on the blockchain, and the fourth energy consumption characterizes the energy consumption required for the terminal to perform computing tasks on the blockchain.

[0367] The first latency represents the latency required to execute the computing task, and the first energy consumption represents the energy consumption required to execute the computing task; the second latency represents the latency required to offload the computing service to the edge server, and the second energy consumption represents the energy consumption required to offload the computing service to the edge server.

[0368] In some embodiments, the method further includes: generating an uninstallation strategy model and sending the uninstallation strategy model to a terminal;

[0369] The generated unloading strategy model includes:

[0370] Obtain at least one training data set;

[0371] Construct an online neural network and a target neural network, wherein the online neural network and the target neural network have the same structure;

[0372] The at least one training data is respectively input into the online neural network to train the online neural network, and the network parameters of the target neural network are updated according to the network parameters of the online neural network at a target period until the training target is reached. The trained target neural network is used as the unloading strategy model.

[0373] Each training data point is represented by a quadruple, which includes: state information at a first time, action, immediate reward from environmental feedback, and state information at a second time, which is the time following the first time.

[0374] The action is either a first action or a second action. The first action indicates that the terminal executes a task, and the second action indicates that the computing task is offloaded to the edge server for execution.

[0375] The status information includes at least one of the following: device status, first latency, first energy consumption, second latency, second energy consumption, and computational amount of image data corresponding to the terminal encryption computation task; if the action is the second action, the status information also includes at least one of the following: third latency, third energy consumption, fourth latency, and fourth energy consumption;

[0376] The instant reward is determined based on the status information and actions during the first time period.

[0377] The uninstallation strategy model is already in place. Figure 2 The method is explained in detail in the example shown, and will not be repeated here.

[0378] In some embodiments, the method further includes: generating an encrypted region selection model and sending the encrypted region selection model to a terminal;

[0379] The generated encrypted region selection model includes:

[0380] Obtain a labeled image dataset; the labeled image dataset includes at least one image data and a label corresponding to each image data.

[0381] Construct a generative adversarial network; the generative adversarial network includes: a discriminator and a generator;

[0382] The generative adversarial network is trained based on the labeled image dataset to obtain an encrypted region selection model;

[0383] The generator's inputs include: labeled image data, privacy level, and / or task response time tolerance; the generator's output includes: encrypted area.

[0384] The input to the discriminator includes: image data after the encrypted region has been encrypted, and the output of the discriminator is the discrimination result of the image data.

[0385] The encrypted region selection model has been implemented. Figure 2 The method is explained in detail in the example shown, and will not be repeated here.

[0386] In some embodiments, the method further includes decoding the blockchain.

[0387] Here, the edge server performs edge computing for edge service tasks. When the edge server has available data storage space, it receives complete candidate blocks broadcast from mobile devices or other consensus nodes via a peer-to-peer network or micro base station interface.

[0388] The edge server uses the previously recorded decoded block sequence number, which represents the sequence number of the last decoded block. Based on this sequence number, the edge server increments the decoded block sequence number by 1 to parse the block header field for the current sequence number. It then extracts the block header fields from the block's binary stream: {Device ID, PrevHash, MerkleRoot, Timestamp, Difficulty, Nonce}, and performs the following operations:

[0389] 1. PoW Verification: The edge server performs a double SHA-256 hash calculation on the extracted block header and compares the result with the target value.

[0390] If satisfied If the task is accepted, it is considered legitimate; otherwise, it is discarded directly, indicating that the difficulty is "incompatible," and the discard information is sent to the device ID. Upon receiving the discard information, the terminal understands that the task unloading was unsuccessful and can either re-encode the computation task on the blockchain or perform local computation.

[0391] 2. Merkle Root Verification: The edge server performs Merkle root verification based on the transaction hash list in the block body, including:

[0392] Extracting the block will retrieve a list of all transaction hashes for each transaction, stored sequentially. ;

[0393] Recursive Reconstruction of Merkelgen: Setting And through the formula Calculate the root value up to the highest level ;like Matches the MerkleRoot in the block header, i.e. This proves that the transaction list is complete and has not been tampered with.

[0394] 3. Transaction (task metadata) decoding:

[0395] For each transaction j in the block body:

[0396] Decoding serialized transaction fields: ;

[0397] Verify transaction hash To verify the integrity of the fields;

[0398] Verify device status summary Does it match the actual status found in the query?

[0399] After successful verification, the edge server sends a request signal to the terminal corresponding to the device ID, requesting the task data to be calculated. The edge server receives the data sent by the terminal and compares it according to the serialized transaction fields. If the comparison is successful, it stores the data in the edge server's data storage space, completing the task enqueue. The edge server executes the calculation task, and after the calculation is completed, it returns the result to the terminal. At the same time, it can also put the processed transaction status on the blockchain or update the off-chain status.

[0400] Edge servers can update the PoW difficulty based on the size of their own data storage space and broadcast it to all terminals.

[0401] Through the above steps, the edge server can reliably decode and verify candidate blocks on the chain, accurately restore the transaction metadata digests, and then transform them into executable computing tasks, achieving reliable task offloading and execution.

[0402] Figure 4 This is a schematic diagram of the structure of an edge computing task offloading device provided in an embodiment of this disclosure; as shown below. Figure 4 As shown, the device is applied to a terminal, and the device includes:

[0403] The first processing module is used to determine the status of the edge server and the first information of the terminal, the first information including: device status and terminal computing task information;

[0404] The second processing module is used to determine an unloading decision based on the state and the first information, wherein the unloading decision represents whether to unload the computing task to the edge server;

[0405] The first communication module is used to perform task processing or unload the task to the edge server according to the unloading decision;

[0406] The state can be either a first state or a second state.

[0407] If the state is the first state, the computing task information includes at least one of the following: first latency, first energy consumption, second latency, second energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task;

[0408] If the state is the second state, the computing task information includes at least one of the following: first latency, first energy consumption, second latency, second energy consumption, third latency, third energy consumption, fourth latency, fourth energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task;

[0409] The third latency represents the latency required for the terminal to perform proof-of-work, and the third energy consumption represents the energy consumption required for the terminal to perform proof-of-work, wherein the proof-of-work is generated based on pending tasks from the edge server.

[0410] The fourth latency characterizes the latency required for the terminal to perform computing tasks on the blockchain, and the fourth energy consumption characterizes the energy consumption required for the terminal to perform computing tasks on the blockchain.

[0411] The first latency represents the latency required to execute the computing task, and the first energy consumption represents the energy consumption required to execute the computing task; the second latency represents the latency required to offload the computing service to the edge server, and the second energy consumption represents the energy consumption required to offload the computing service to the edge server.

[0412] It is understood that, when implementing the edge computing task offloading method on the corresponding terminal side, the edge computing task offloading device provided in the above embodiments can allocate the above processing to different program modules as needed to complete all or part of the processing described above. Furthermore, the device and the corresponding method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiments, which will not be repeated here.

[0413] Accordingly, this disclosure provides an edge computing task offloading device, which is applied to an edge server, and the device includes:

[0414] The second communication module is used to send status indication information to the terminal, the status indication information being used to indicate the status of the edge server; the status is either a first status or a second status.

[0415] The status indication information is used by the terminal to determine an offloading decision by combining the status of the edge server and the terminal's first information. The offloading decision indicates whether to offload the computing task to the edge server. The first information includes: device status and the terminal's computing task information.

[0416] The state can be either a first state or a second state.

[0417] If the state is the first state, the computing task information includes at least one of the following: first latency, first energy consumption, second latency, second energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task;

[0418] If the state is the second state, the computing task information includes at least one of the following: first latency, first energy consumption, second latency, second energy consumption, third latency, third energy consumption, fourth latency, fourth energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task;

[0419] The third latency represents the latency required for the terminal to perform proof-of-work, and the third energy consumption represents the energy consumption required for the terminal to perform proof-of-work, wherein the proof-of-work is generated based on pending tasks from the edge server.

[0420] The fourth latency characterizes the latency required for the terminal to perform computing tasks on the blockchain, and the fourth energy consumption characterizes the energy consumption required for the terminal to perform computing tasks on the blockchain.

[0421] The first latency represents the latency required to execute the computing task, and the first energy consumption represents the energy consumption required to execute the computing task; the second latency represents the latency required to offload the computing service to the edge server, and the second energy consumption represents the energy consumption required to offload the computing service to the edge server.

[0422] It is understood that the edge computing task offloading device provided in the above embodiments, when implementing the edge computing task offloading method on the corresponding edge server side, can allocate the above processing to different program modules as needed to complete all or part of the processing described above. Furthermore, the device and the corresponding method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiments, which will not be repeated here.

[0423] This application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform an edge computing task offloading method.

[0424] This application provides a computer-readable storage medium storing executable instructions, wherein the executable instructions are executed by a processor, causing the processor to execute the edge computing task offloading method provided in this application.

[0425] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.

[0426] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0427] As an example, executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborating files (e.g., a file that stores one or more modules, subroutines, or code sections).

[0428] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.

[0429] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure; as shown below. Figure 5 As shown, the electronic device 50 includes: a processor 501, and a memory 502 communicatively connected to the processor 501; the memory 502 stores instructions that can be executed by the processor 501.

[0430] If the electronic device is an edge server, the instruction is executed by the processor 501 to enable the processor 501 to perform the following:

[0431] Send status indication information to the terminal, the status indication information being used to indicate the status of the edge server; the status is either a first status or a second status;

[0432] The status indication information is used by the terminal to determine an offloading decision by combining the status of the edge server and the terminal's first information. The offloading decision indicates whether to offload the computing task to the edge server. The first information includes: device status and the terminal's computing task information.

[0433] If the electronic device is a terminal, the instruction is executed by the processor 501 to enable the processor 501 to perform the following:

[0434] Determine the status of the edge server and the first information of the terminal, the first information including: device status and terminal computing task information;

[0435] An unloading decision is determined based on the state and the first information, wherein the unloading decision represents whether to unload the computing task to the edge server;

[0436] Based on the uninstallation decision, the task can be processed or the task can be uninstalled to an edge server;

[0437] The state can be either a first state or a second state.

[0438] If the state is the first state, the computing task information includes at least one of the following: first latency, first energy consumption, second latency, second energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task;

[0439] If the state is the second state, the computing task information includes at least one of the following: first latency, first energy consumption, second latency, second energy consumption, third latency, third energy consumption, fourth latency, fourth energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task;

[0440] The third latency represents the latency required for the terminal to perform proof-of-work, and the third energy consumption represents the energy consumption required for the terminal to perform proof-of-work, wherein the proof-of-work is generated based on pending tasks from the edge server.

[0441] The fourth latency characterizes the latency required for the terminal to perform computing tasks on the blockchain, and the fourth energy consumption characterizes the energy consumption required for the terminal to perform computing tasks on the blockchain.

[0442] The first latency represents the latency required to execute the computing task, and the first energy consumption represents the energy consumption required to execute the computing task; the second latency represents the latency required to offload the computing service to the edge server, and the second energy consumption represents the energy consumption required to offload the computing service to the edge server.

[0443] The electronic devices and corresponding edge computing task offloading methods provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0444] In practical applications, the electronic device 50 may further include at least one network interface 503. The various components of the electronic device 50 are coupled together via a bus system 504. It is understood that the bus system 504 is used to implement communication between these components. In addition to a data bus, the bus system 504 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 5 All buses are labeled as bus system 504. The number of processors 501 and the number of memories 502 can be at least one. The network interface 503 is used for wired or wireless communication between the electronic device 50 and other devices.

[0445] The memory 502 in this embodiment is used to store various types of data to support the operation of the electronic device 50.

[0446] The methods disclosed in the above embodiments of this disclosure can be applied to processor 501, or implemented by processor 501. Processor 501 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 501 or by instructions in the form of software. The processor 501 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 501 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this disclosure can be directly manifested as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, which is located in memory 502. Processor 501 reads the information in memory 502 and, in conjunction with its hardware, completes the steps of the aforementioned edge computing task offloading method.

[0447] In some embodiments, the electronic device 50 may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the aforementioned methods.

[0448] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this disclosure can be achieved, and this is not limited herein.

[0449] In the above description, the term "some embodiments" refers to a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0450] Unless otherwise defined, all technical and scientific terms used in this disclosure have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs. The terminology used in this disclosure is for the purpose of describing embodiments of this disclosure only and is not intended to be limiting of this disclosure.

[0451] It should be understood that in the various embodiments of this disclosure, the sequence number of each implementation process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this disclosure.

[0452] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this disclosure, "a plurality of" means two or more, unless otherwise explicitly specified.

[0453] The above description is merely a specific embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.

Claims

1. A method for offloading edge computing tasks, characterized in that, The method is applied to a terminal, and the method includes: Determine the status of the edge server and the first information of the terminal, the first information including: device status and terminal computing task information; An unloading decision is determined based on the state and the first information, wherein the unloading decision represents whether to unload the computing task to the edge server; The computing task is executed or the computing task is offloaded to an edge server based on the offloading decision. The state can be either a first state or a second state. If the state is the first state, the computing task information includes at least one of the following: first latency, first energy consumption, second latency, second energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task; If the state is the second state, the computing task information includes at least one of the following: first latency, first energy consumption, second latency, second energy consumption, third latency, third energy consumption, fourth latency, fourth energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task; The third latency represents the latency required for the terminal to perform proof-of-work, and the third energy consumption represents the energy consumption required for the terminal to perform proof-of-work, wherein the proof-of-work is generated based on pending tasks from the edge server. The fourth latency characterizes the latency required for the terminal to perform computing tasks on the blockchain, and the fourth energy consumption characterizes the energy consumption required for the terminal to perform computing tasks on the blockchain. The first latency represents the latency required to execute the computing task, and the first energy consumption represents the energy consumption required to execute the computing task; the second latency represents the latency required to offload the computing service to the edge server, and the second energy consumption represents the energy consumption required to offload the computing service to the edge server. Determining an unloading decision based on the stated state and the first information includes: The first information is identified using an offloading strategy model to obtain an identification result, which indicates whether the computing task is offloaded to the edge server. The unloading strategy model is obtained by training a dual neural network on a training dataset. The dual neural network includes an online neural network and a target neural network. Each training data point in the training dataset is represented by a quadruple, which includes: state information at a first time, action, immediate reward from environmental feedback, and state information at a second time, where the second time is the time following the first time. The action is either a first action or a second action. The first action indicates that the terminal executes a task, and the second action indicates that the computing task is offloaded to the edge server for execution. The status information includes at least one of the following: device status, first latency, first energy consumption, second latency, second energy consumption, and computational amount of image data corresponding to the terminal encryption computation task; if the action is the second action, the status information also includes at least one of the following: third latency, third energy consumption, fourth latency, and fourth energy consumption; The instant reward is determined based on the status information and actions during the first time period.

2. The method according to claim 1, characterized in that, Determining the status of the edge server includes: Receive status indication information from the edge server, the status indication information being used to indicate the status of the edge server; The first state is characterized by the edge server allowing the terminal to unconditionally offload its computing tasks to the task execution list of the edge server; The second state is characterized by the fact that the edge server does not allow the terminal to unconditionally offload its computing tasks to the task execution list of the edge server.

3. The method according to claim 1, characterized in that, If the state is the second state, determine the computing task information of the terminal's computing task, including: Obtain data of pending tasks published by the edge server; the pending tasks are the actual tasks that the edge server needs to process, and the pending tasks are used by the terminal to perform proof of work. Based on the data of the task to be processed, as well as the CPU frequency of the terminal and the power consumption of the CPU in each cycle, a third latency and / or a third power consumption are determined. The data of the task to be processed includes at least one of the following: task execution computation amount, proof generation computation amount.

4. The method according to claim 1, characterized in that, If the state is the second state, and the unloading decision determines that the task will be unloaded to the edge server, the method further includes: performing proof of workload based on the data of the task to be processed; The step of performing proof of workload based on the data of the task to be processed includes: Execute the task to be processed, obtain the task execution result, and generate a calculation proof; Based on the task execution results and the calculation proof, construct the first block header; The first block header is linked to the first blockchain so that the edge server can obtain the first block header and verify the computation proof; the result of the verification of the computation proof serves as the basis for the edge server to determine whether to execute the computation task offloaded from the terminal to the edge server; The step of executing the task to be processed, obtaining the task execution result, and generating a computational proof includes: Obtain the function of the task to be processed from the data of the task to be processed, and generate a computational proof based on the task execution process during the execution of the task to be processed; The function represents an execution function or program used to perform the task to be processed and generate intermediate key processes.

5. The method according to claim 4, characterized in that, The first block header includes the following information: The task execution result includes the hash value, computation proof, block version, previous block hash, Merkle root of task metadata, timestamp, task difficulty, random number, block type, and task identifier; the task difficulty is determined and issued by the edge server based on the amount of task to be processed; the task difficulty is used to affect the difficulty of the terminal performing proof of work.

6. The method according to claim 1, characterized in that, If the state is the first state, the immediate reward is determined based on a first immediate reward function, which is: ; in, The formula for calculating instant rewards; This indicates the latency and / or energy consumption of the computing task executed on the terminal; This indicates the latency and / or energy consumption of offloading computational tasks to edge servers for execution; This indicates the network status of the terminal at time t. This represents the percentage of battery remaining in the terminal at time t. This represents the CPU load utilization rate of the terminal at time t; This indicates that the computation task is performed locally on the terminal. This indicates that the computing task will be offloaded to an edge server to complete the computing task; Indicates status information; This indicates the computational load of the image data corresponding to the terminal encryption computation task; , , , These are all set constants or weighting coefficients.

7. The method according to claim 1, characterized in that, If the state is the second state, the immediate reward is determined based on a second immediate reward function, which is: ; in, The formula for calculating instant rewards; This indicates the computational load of the image data corresponding to the terminal encryption computation task; This indicates the energy consumption required for the terminal to perform computational tasks on the blockchain. This indicates the latency required for the terminal to upload computational tasks to the blockchain. This represents the latency required for the terminal to perform proof-of-work. This indicates the energy consumption required for the terminal to perform proof of work. This indicates the latency and / or energy consumption of the computing task executed on the terminal; This indicates the latency and / or energy consumption of offloading computational tasks to edge servers for execution; This indicates the network status of the terminal at time t. This represents the percentage of battery remaining in the terminal at time t. This represents the CPU load utilization rate of the terminal at time t; This indicates that the computation task is performed locally on the terminal. This indicates that the computing task will be offloaded to an edge server to complete the computing task; Indicates status information; When this occurs, it indicates that the edge server is in the second state; When this occurs, it indicates that the edge server is in its first state; This indicates the computational load of the image data corresponding to the terminal encryption computation task; , , , These are all set constants or weighting coefficients.

8. The method according to claim 1, characterized in that, The method further includes: Collect training data; The training data is sent to the edge server, and the training data is used by the edge server to train the offloading strategy model; Receive the offload strategy model sent by the edge server.

9. The method according to claim 1, characterized in that, The data for the computation task includes task image data; The computational task is offloaded to the edge server according to the offloading decision, including: The encrypted region selection model is used to identify the encrypted regions in the task image data. Feature extraction is performed on the encrypted region, and the extracted features are then normalized to obtain encrypted data. Generate a feature hash value based on the encrypted data; A key is generated based on the feature hash value, as well as the privacy level, salt value, and / or context information; The encrypted region in the task image data is encrypted using the key to obtain the encrypted task image data; The encrypted task image data is sent to the edge server.

10. The method according to claim 9, characterized in that, The method further includes at least one of the following: The salt value is pre-agreed with the edge server; Receive the privacy level sent by the edge server; The context information is sent to the edge server.

11. The method according to claim 10, characterized in that, Encrypting the encrypted region in the task image data using the key includes: A symmetric encryption algorithm is used to encrypt the encrypted region in the task image data according to the key and initialization vector.

12. The method according to claim 10, characterized in that, The method further includes: Send an annotated image dataset to the edge server; the annotated image dataset is used by the edge server to train an encrypted region selection model; Receive the encrypted region selection model sent by the edge server.

13. A method for offloading blockchain data from edge computing, characterized in that, The method is applied to an edge server, and the method includes: Send status indication information to the terminal, the status indication information being used to indicate the status of the edge server; the status is either a first status or a second status; The status indication information is used by the terminal to determine an offloading decision by combining the status of the edge server and the terminal's first information. The offloading decision indicates whether to offload the computing task to the edge server. The first information includes: device status and the terminal's computing task information. The state can be either a first state or a second state. If the state is the first state, the computing task information includes at least one of the following: first latency, first energy consumption, second latency, second energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task; If the state is the second state, the computing task information includes at least one of the following: first latency, first energy consumption, second latency, second energy consumption, third latency, third energy consumption, fourth latency, fourth energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task; The third latency represents the latency required for the terminal to perform proof-of-work, and the third energy consumption represents the energy consumption required for the terminal to perform proof-of-work, wherein the proof-of-work is generated based on pending tasks from the edge server. The fourth latency characterizes the latency required for the terminal to perform computing tasks on the blockchain, and the fourth energy consumption characterizes the energy consumption required for the terminal to perform computing tasks on the blockchain. The first latency represents the latency required to execute the computing task, and the first energy consumption represents the energy consumption required to execute the computing task; the second latency represents the latency required to offload the computing service to the edge server, and the second energy consumption represents the energy consumption required to offload the computing service to the edge server. The method further includes: generating an unloading strategy model and sending the unloading strategy model to a terminal; The generated unloading strategy model includes: Obtain at least one training data set; Construct an online neural network and a target neural network, wherein the online neural network and the target neural network have the same structure; The at least one training data is respectively input into the online neural network to train the online neural network, and the network parameters of the target neural network are updated according to the network parameters of the online neural network at a target period until the training target is reached. The trained target neural network is used as the unloading strategy model. Each training data point is represented by a quadruple, which includes: state information at a first time, action, immediate reward from environmental feedback, and state information at a second time, which is the time following the first time. The action is either a first action or a second action. The first action indicates that the terminal executes a task, and the second action indicates that the computing task is offloaded to the edge server for execution. The status information includes at least one of the following: device status, first latency, first energy consumption, second latency, second energy consumption, and computational amount of image data corresponding to the terminal encryption computation task; if the action is the second action, the status information also includes at least one of the following: third latency, third energy consumption, fourth latency, and fourth energy consumption; The instant reward is determined based on the status information and actions during the first time period.

14. The method according to claim 13, characterized in that, The method further includes: generating an encrypted region selection model and sending the encrypted region selection model to a terminal; The generated encrypted region selection model includes: Obtain a labeled image dataset; the labeled image dataset includes at least one image data and a label corresponding to each image data. Construct a generative adversarial network; the generative adversarial network includes: a discriminator and a generator; The generative adversarial network is trained based on the labeled image dataset to obtain an encrypted region selection model; The generator's inputs include: labeled image data, privacy level, and / or task response time tolerance; the generator's output includes: encrypted area. The input to the discriminator includes: image data after the encrypted region has been encrypted, and the output of the discriminator is the discrimination result of the image data.

15. An edge computing task offloading device, characterized in that, The device is used in a terminal, and the device includes: The first processing module is used to determine the status of the edge server and the first information of the terminal, the first information including: device status and terminal computing task information; The second processing module is used to determine an unloading decision based on the state and the first information, wherein the unloading decision represents whether to unload the computing task to the edge server; The first communication module is used to execute computing tasks or offload computing tasks to edge servers according to the offloading decision; The state can be either a first state or a second state. If the state is the first state, the computing task information includes at least one of the following: first latency, first energy consumption, second latency, second energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task; If the state is the second state, the computing task information includes at least one of the following: first latency, first energy consumption, second latency, second energy consumption, third latency, third energy consumption, fourth latency, fourth energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task; The third latency represents the latency required for the terminal to perform proof-of-work, and the third energy consumption represents the energy consumption required for the terminal to perform proof-of-work, wherein the proof-of-work is generated based on pending tasks from the edge server. The fourth latency characterizes the latency required for the terminal to perform computing tasks on the blockchain, and the fourth energy consumption characterizes the energy consumption required for the terminal to perform computing tasks on the blockchain. The first latency represents the latency required to execute the computing task, and the first energy consumption represents the energy consumption required to execute the computing task; the second latency represents the latency required to offload the computing service to the edge server, and the second energy consumption represents the energy consumption required to offload the computing service to the edge server. The second processing module is used to identify the first information using an offloading strategy model and obtain an identification result, wherein the identification result indicates whether the computing task is offloaded to the edge server; The unloading strategy model is obtained by training a dual neural network on a training dataset. The dual neural network includes an online neural network and a target neural network. Each training data point in the training dataset is represented by a quadruple, which includes: state information at a first time, action, immediate reward from environmental feedback, and state information at a second time, where the second time is the time following the first time. The action is either a first action or a second action. The first action indicates that the terminal executes a task, and the second action indicates that the computing task is offloaded to the edge server for execution. The status information includes at least one of the following: device status, first latency, first energy consumption, second latency, second energy consumption, and computational amount of image data corresponding to the terminal encryption computation task; if the action is the second action, the status information also includes at least one of the following: third latency, third energy consumption, fourth latency, and fourth energy consumption; The instant reward is determined based on the status information and actions during the first time period.

16. An edge computing task offloading device, characterized in that, The device is used in an edge server, and the device includes: The second communication module is used to send status indication information to the terminal, the status indication information being used to indicate the status of the edge server; the status is either a first status or a second status. The status indication information is used by the terminal to determine an offloading decision by combining the status of the edge server and the first information. The offloading decision indicates whether to offload the computing task to the edge server. The first information includes: device status and computing task information of the terminal. The state can be either a first state or a second state. If the state is the first state, the computing task information includes at least one of the following: first latency, first energy consumption, second latency, second energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task; If the state is the second state, the computing task information includes at least one of the following: first latency, first energy consumption, second latency, second energy consumption, third latency, third energy consumption, fourth latency, fourth energy consumption, and the amount of computation of the image data corresponding to the terminal encryption computing task; The third latency represents the latency required for the terminal to perform proof-of-work, and the third energy consumption represents the energy consumption required for the terminal to perform proof-of-work, wherein the proof-of-work is generated based on pending tasks from the edge server. The fourth latency characterizes the latency required for the terminal to perform computing tasks on the blockchain, and the fourth energy consumption characterizes the energy consumption required for the terminal to perform computing tasks on the blockchain. The first latency represents the latency required to execute the computing task, and the first energy consumption represents the energy consumption required to execute the computing task; the second latency represents the latency required to offload the computing service to the edge server, and the second energy consumption represents the energy consumption required to offload the computing service to the edge server. The device is also used to generate an unloading strategy model and send the unloading strategy model to the terminal; The generated unloading strategy model includes: Obtain at least one training data set; Construct an online neural network and a target neural network, wherein the online neural network and the target neural network have the same structure; The at least one training data is respectively input into the online neural network to train the online neural network, and the network parameters of the target neural network are updated according to the network parameters of the online neural network at a target period until the training target is reached. The trained target neural network is used as the unloading strategy model. Each training data point is represented by a quadruple, which includes: state information at a first time, action, immediate reward from environmental feedback, and state information at a second time, which is the time following the first time. The action is either a first action or a second action. The first action indicates that the terminal executes a task, and the second action indicates that the computing task is offloaded to the edge server for execution. The status information includes at least one of the following: device status, first latency, first energy consumption, second latency, second energy consumption, and computational amount of image data corresponding to the terminal encryption computation task; if the action is the second action, the status information also includes at least one of the following: third latency, third energy consumption, fourth latency, and fourth energy consumption; The instant reward is determined based on the status information and actions during the first time period.

17. An electronic device, characterized in that, include: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 12; or to enable the at least one processor to perform the method of any one of claims 13 and 14.

18. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method of any one of claims 1 to 12; or, the computer instructions are used to cause the computer to perform the method of any one of claims 13 and 14.