Data storage method and device, equipment and medium

By slicing and encrypting data in the LAN, data leakage problems caused by edge nodes are solved, and efficient and secure data storage and processing are achieved.

CN120406833APending Publication Date: 2025-08-01CHINA TELECOM NETWORK SECURITY TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510413465.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-02
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

Traditional edge computing methods cannot meet high security requirements. Breakthrough of edge nodes may lead to data leakage. How to ensure data security and storage efficiency in a LAN environment.

Method used

By sharding the data based on the number of edge nodes in the LAN, and storing the sharded data on different edge nodes, determining the target node using node information matching, encrypted transmission and sensitive information processing are used to achieve secure storage and efficient utilization of data.

Benefits of technology

It improves the efficiency and security of data storage, reduces the risk of data leakage, ensures that even if some nodes are compromised, complete data cannot be obtained, and improves the security and resource utilization efficiency of distributed systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120406833A_ABST
    Figure CN120406833A_ABST
Patent Text Reader

Abstract

The invention discloses a data storage method and device, equipment and a medium. The method comprises the steps of obtaining to-be-stored data; based on the number of edge nodes in a target node group where the edge nodes are located, the to-be-stored data are fragmented, and multiple pieces of fragmented data are obtained; determining target node information for any fragment data based on any fragment data, matching the target node information with node information of each edge node in the target node group, and determining a target edge node according to a matching result; and if the determined target edge node is the other edge node, sending any fragment data to the target edge node, so that the target edge node stores any fragment data. According to the method, the data storage efficiency can be improved, the occurrence of safety problems such as data leakage is reduced, and the data safety is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of edge computing, and in particular to a data storage method, apparatus, device, and medium. Background Art

[0002] With the rapid adoption of Internet of Things (IoT) devices and the introduction of 5G (fifth-generation mobile communication technology), the amount of data at the edge of the network is exploding. Traditional cloud computing models, relying on centralized data processing and storage, present challenges such as transmission latency, network bandwidth usage, and privacy concerns. To address these issues, edge computing technology has emerged. It distributes data processing tasks to edge nodes closer to the data source, reducing network latency, optimizing bandwidth utilization, and distributing processing pressure.

[0003] With the increasing threat of cyberattacks, traditional edge node self-computing methods can no longer meet today's high security requirements. Because each edge node stores and processes complete data, a compromised edge node could lead to security issues such as data leaks. Therefore, ensuring data security in a local area network environment is a pressing technical challenge. Summary of the Invention

[0004] The embodiments of the present application provide a data storage method, apparatus, device, and medium for improving the efficiency of data storage, reducing the occurrence of security issues such as data leakage, and ensuring data security.

[0005] In a first aspect, an embodiment of the present application provides a data storage method, applied to an edge node in a local area network, comprising:

[0006] Get the data to be stored;

[0007] Slicing the data to be stored based on the number of edge nodes in the target node group where the edge node is located to obtain multiple slicing data;

[0008] For any shard data, based on the any shard data, determine the target node information, and match the target node information with the node information of each edge node in the target node group, and determine the target edge node according to the matching result;

[0009] If the determined target edge node is another edge node, the arbitrary one shard data is sent to the target edge node, so that the target edge node stores the arbitrary one shard data.

[0010] In an embodiment of the present application, an edge node in a local area network shards the acquired data to be stored based on the number of edge nodes in the target node group where the edge node is located, obtaining multiple sharded data; for any one of the sharded data, target node information is determined based on any one of the sharded data, and the target node information is matched with the node information of each edge node in the target node group. According to the matching result, a target edge node, that is, the edge node to store any one of the sharded data, is determined; if the target edge node is another edge node, then any one of the sharded data is sent to the target edge node so that the target edge node stores any one of the sharded data, thereby improving the data storage efficiency and realizing that each sharded data of the data to be stored is stored in different edge nodes in the target node group. Even if an attacker breaks into an edge node in the target node group, it is impossible to obtain the complete data based on the sharded data stored in the edge node, and the attacker is even less likely to determine other edge nodes in the target node group. Therefore, the data security is improved and the occurrence of security problems such as data leakage is reduced.

[0011] In a possible design, after acquiring the data to be stored, the method further includes:

[0012] Acquiring the performance data of each edge node in the target node group;

[0013] Based on the performance data of each edge node and the sum value of the performance data of each edge node, determining the performance proportion of each edge node;

[0014] Based on the performance proportion of each edge node and the data volume of the data to be stored, determining the amount of each sharded data;

[0015] Based on the amount of each sharded data, sharding the data to be stored to obtain multiple sharded data.

[0016] In an embodiment of the present application, according to the performance data of each edge node and the sum value of the performance data of each edge node, the performance proportion of each edge node is determined. Based on the performance proportion of each edge node and the data volume of the data to be stored, the amount of each sharded data is determined. Based on the amount of each sharded data, the data to be stored is sharded to obtain multiple sharded data, so that the larger the amount of the sharded data corresponding to the edge node with better performance data, and the smaller the amount of the sharded data corresponding to the edge node with worse performance data.

[0017] In a possible design, after obtaining multiple sharded data, the method further includes:

[0018] Based on the node information of the edge node, determining a first source tag and adding the first source tag to each sharded data;

[0019] Wherein, the method further includes:

[0020] In response to a first processing request triggered by a user, process the shard data with a first source tag in the first processing request to obtain first shard data of the edge node;

[0021] Sign the first processing request to obtain a second processing request, and send the second processing request to each other edge node respectively;

[0022] Receive the first shard data of each other edge node sent by each other edge node, and based on the first shard data of the edge node and the first shard data of each other edge node, obtain target shard data corresponding to the first processing request, where the first shard data of the other edge node is obtained by the other edge node processing the shard data with the first source tag based on the received second processing request.

[0023] In an embodiment of the present application, the edge node determines a first source tag based on the node information of the edge node, and adds the first source tag to each shard data respectively, so that the source of each shard data is clearer. And the edge node processes the stored shard data based on the first processing request triggered by the user to obtain the first shard data of the edge node. And the edge node signs the first processing request to obtain a second processing request, and sends the second processing request to each other edge node respectively. Each other edge node processes the stored shard data based on the second processing request to obtain the first shard data of the other edge node. The edge node obtains the target shard data corresponding to the first processing request based on the first shard data of the edge node and the first shard data of each other edge node received. The present application can more efficiently utilize the computing and storage resources of each edge node in the target node group, realize the reasonable scheduling and balance of resources, improve the data processing efficiency, and at the same time reduce the centralized load of the data processing task.

[0024] In a possible design, after sending the second processing request to each other edge node respectively and before receiving the first shard data corresponding to each other edge node sent by each other edge node, it further includes:

[0025] For any one of the other edge nodes, receive a first sensitive key request sent by the any one of the other edge nodes, where the first sensitive key request is used to obtain the sensitive key of the edge node;

[0026] Based on the first sensitive key request, determine the sensitive key of the edge node, and send the sensitive key of the edge node to any one of the other edge nodes, so that any one of the other edge nodes uses the sensitive key of the edge node to decrypt the sensitive information in the sharded data with the first source tag, and processes the decrypted sharded data with the first source tag based on the second processing request to obtain the first sharded data of any one of the other edge nodes.

[0027] In an embodiment of the present application, the edge node receives the first sensitive key request sent by any one of the other edge nodes, and sends the sensitive key of the edge node to any one of the other edge nodes, so that any one of the other edge nodes uses the sensitive key of the edge node to decrypt the sensitive information in the sharded data with the first source tag, and processes the decrypted sharded data with the first source tag based on the second processing request to obtain the first sharded data of any one of the other edge nodes, thereby ensuring the security of the sensitive information in the sharded data.

[0028] In a possible design, the method further includes:

[0029] For any one of the other edge nodes, receive the third processing request of the any one of the other edge nodes, where the any one of the other edge nodes is an edge node in response to the fourth processing request triggered by the user;

[0030] Use the public key of the any one of the other edge nodes stored in the edge node to decrypt the first digital signature in the third processing request to obtain the first hash value;

[0031] Perform a hash calculation on the fourth processing request in the third processing request to obtain a second hash value;

[0032] Compare the first hash value and the second hash value to obtain a comparison result, and determine whether the third processing request is a legitimate request based on the comparison result.

[0033] In an embodiment of the present application, the edge node receives the third processing request of any one of the other edge nodes, uses the public key of the any one of the other edge nodes stored in the edge node to decrypt the first digital signature in the third processing request to obtain the first hash value; performs a hash calculation on the fourth processing request in the third processing request to obtain a second hash value; determines whether the third processing request is a legitimate request based on the first hash value and the second hash value, thereby ensuring the authenticity, integrity and source credibility of the processing request, and preventing man-in-the-middle attacks or malicious node forgery requests.

[0034] In a possible design, determining whether the third processing request is a legitimate request based on the comparison result includes:

[0035] If the comparison result indicates that the first hash value and the second hash value are the same, determine that the third processing request is a legitimate request, and process the shard data with the second source label in the third processing request based on the third processing request to obtain the second shard data of the edge node, and send the second shard data of the edge node to any one of the other edge nodes, where the second source label is used to represent any one of the other edge nodes that generates the shard data;

[0036] If the comparison result indicates that the first hash value and the second hash value are different, determine that the third processing request is not a legitimate request, and generate exception information based on the third processing request, and send the exception information to any one of the other edge nodes.

[0037] In the embodiments of the present application, if the first hash value and the third hash value are the same, it indicates that the third processing request is a legitimate request. Therefore, the shard data with the second source label in the third processing request is processed based on the third processing request to obtain the second shard data of the edge node, and the second shard data of the edge node is sent to any one of the other edge nodes. If the first hash value and the third hash value are different, it indicates that the third processing request is not a legitimate request. Therefore, exception information is generated and sent to any one of the other edge nodes. The present application can ensure that the edge node only responds to legitimate processing requests that have passed signature verification, improving the security of processing tasks in the distributed system.

[0038] In a possible design, processing the shard data with the second source label in the third processing request based on the third processing request to obtain the second shard data of the edge node includes:

[0039] If there is encrypted sensitive information in the shard data with the second source label stored by the edge node, send a second sensitive key request to any one of the other edge nodes, where the second sensitive key request is used to obtain the sensitive key of any one of the other edge nodes;

[0040] Receive the sensitive key of any one of the other edge nodes sent by any one of the other edge nodes after receiving the second sensitive key request;

[0041] Decrypt the shard data with the second source label by using the sensitive key of any one of the other edge nodes, and process the decrypted shard data with the second source label based on the third processing request to obtain the second shard data of the edge node.

[0042] In an embodiment of the present application, if there is encrypted sensitive information in the shard data with the second source label stored by an edge node, a second sensitive key request is sent to any one of the other edge nodes, and the sensitive key of any one of the other edge nodes sent by any one of the other edge nodes is received; the shard data with the second source label is decrypted by using the sensitive key of any one of the other edge nodes, and the decrypted shard data with the second source label is processed based on the third processing request to obtain the second shard data of the edge node, thereby ensuring the security of the sensitive information in the shard data.

[0043] In a possible design, before obtaining the data to be stored, it further includes:

[0044] After joining the target node group, any one of the adjacent edge nodes of the edge node is used as a standby edge node, where the standby edge node is an edge node for storing the shard data of the edge node; and / or

[0045] When it is detected that any one of the other edge nodes joins the target node group, any one of the adjacent edge nodes of the edge node is used as a standby edge node.

[0046] In an embodiment of the present application, after an edge node joins the target node group, any one of the adjacent edge nodes of the edge node is used as a standby edge node. Moreover, when it is detected in the present application that any one of the other edge nodes joins the target node group, any one of the adjacent edge nodes of the edge node is used as a standby edge node to store the shard data of the edge node, so as to use the standby edge node to recover the data when the edge node is abnormal.

[0047] In a possible design, the method further includes:

[0048] When it is detected that any one of the other edge nodes exits the target node group, any one of the adjacent edge nodes of the edge node is used as a standby edge node.

[0049] In an embodiment of the present application, when it is detected that any one of the other edge nodes exits the target node group, any one of the adjacent edge nodes of the edge node is used as a standby edge node to store the shard data of the edge node, so as to use the standby edge node to recover the data when the edge node is abnormal.

[0050] In a second aspect, an embodiment of the present application provides a data storage device, including:

[0051] An acquisition module, configured to acquire data to be stored;

[0052] A sharding module, configured to shard the data to be stored based on the number of edge nodes in the target node group where the edge node is located, to obtain a plurality of sharded data;

[0053] A determination module, configured to, for any one of the sharded data, determine target node information based on the any one of the sharded data, match the target node information with the node information of each edge node in the target node group, and determine a target edge node according to the matching result;

[0054] A sending module, configured to, if the determined target edge node is another edge node, send the any one of the sharded data to the target edge node, so that the target edge node stores the any one of the sharded data.

[0055] In a third aspect, the present application provides an electronic device, including:

[0056] A memory, configured to store program instructions;

[0057] A processor, configured to call the program instructions stored in the memory and execute the steps included in the method according to any one of the first aspects according to the obtained program instructions.

[0058] In a fourth aspect, the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, the computer program includes program instructions, and when the program instructions are executed by a computer, the computer is caused to execute the method according to any one of the first aspects.

[0059] In a fifth aspect, the present application provides a computer program product, where the computer program product includes: computer program code, and when the computer program code runs on a computer, the computer is caused to execute the method according to any one of the first aspects.

[0060] For the technical effects brought by the second aspect to the fifth aspect and any one of their designs, reference may be made to the technical effects brought by the corresponding designs in the first aspect, which will not be elaborated here. Description of the Drawings

[0061] Figure 1 It is a schematic diagram of an application scenario provided by an embodiment of the present application;

[0062] Figure 2 It is a flowchart of a data storage method provided by an embodiment of the present application;

[0063] Figure 3 It is a schematic diagram of a local area network provided by an embodiment of the present application;

[0064] Figure 4 Another schematic diagram of a local area network provided by an embodiment of the present application;

[0065] Figure 5 A schematic diagram of a node group provided by an embodiment of the present application;

[0066] Figure 6 A flowchart of a method for determining target shard data corresponding to a first processing request provided by an embodiment of the present application;

[0067] Figure 7 A flowchart of a method for processing a first sensitive key request provided by an embodiment of the present application;

[0068] Figure 8 A flowchart of a method for verifying whether a third processing request is a legal request provided by an embodiment of the present application;

[0069] Figure 9 A specific flowchart of a method for verifying whether a third processing request is a legal request provided by an embodiment of the present application;

[0070] Figure 10 A flowchart of a method for obtaining second shard data of an edge node provided by an embodiment of the present application;

[0071] Figure 11 A specific flowchart of a method for determining target shard data corresponding to a first processing request provided by an embodiment of the present application;

[0072] Figure 12 A flowchart of a method for determining first shard data of edge node 2 provided by an embodiment of the present application;

[0073] Figure 13 A schematic diagram of an edge node joining a node group provided by an embodiment of the present application;

[0074] Figure 14 Another schematic diagram of an edge node joining a node group provided by an embodiment of the present application;

[0075] Figure 15 A schematic diagram of an edge node exiting a node group provided by an embodiment of the present application;

[0076] Figure 16 A schematic diagram of the structure of a data storage device provided by an embodiment of the present application;

[0077] Figure 17 A schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0078] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. Unless there is a conflict, the embodiments in the present application and the features in the embodiments can be combined with each other in any way. In addition, although a logical order is shown in the flowchart, in some cases, the steps shown or described can be performed in an order different from that here.

[0079] The terms "first" and "second" in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of its variations are intended to cover non-exclusive protection. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. "Multiple" in this application can mean at least two, for example, two, three or more, and the embodiments of this application are not limited thereto.

[0080] In the technical solution of this application, the collection, dissemination, and use of data comply with the requirements of relevant national laws and regulations.

[0081] Before introducing a data storage method provided by an embodiment of the present application, in order to facilitate understanding, the technical background of the embodiment of the present application is first introduced in detail below.

[0082] With the rapid adoption of IoT devices and the application of 5G communication technology, the amount of data at the edge of the network is exploding. Traditional cloud computing models, relying on centralized data processing and storage, present challenges such as transmission latency, network bandwidth usage, and privacy and security concerns. To address these challenges, edge computing technology has emerged. It distributes data processing tasks to edge nodes closer to the data source, reducing network latency, optimizing bandwidth utilization, and distributing processing pressure.

[0083] With the increasing threat of cyberattacks, traditional edge node self-computing methods can no longer meet today's high security requirements. Because each edge node stores and processes complete data, a compromised edge node could lead to security issues such as data leaks. Therefore, ensuring data security in a local area network environment is a pressing technical challenge.

[0084] To solve the above problems, the present application proposes a data storage method, apparatus, device and medium, which are used to improve the efficiency of data storage, reduce the occurrence of security problems such as data leakage, and ensure the security of data.

[0085] First, refer to Figure 1 , which is a schematic diagram of the application scenario of the embodiment of the present application, including a client 11, a server 12 and an edge node 13. Among them, the client 11 is used to obtain a processing request triggered by a user and send it to the server 12; the server 12 is used to send the received processing request to the edge node 13 in the local area network. The edge node 13 is used to perform corresponding processing on the stored sharded data based on the received processing request. Moreover, the edge node 13 is also used to obtain the data to be stored and perform sharded storage on the data to be stored. The local area network includes n node groups, where n is an integer greater than or equal to 1, and each node group includes m edge nodes, where m is an integer greater than 1. The client 11 and the server 12 are communicatively connected through a network, which can be a local area network, a wide area network, etc. The server 12 can be an independent physical server, and can also be a server cluster or a distributed system composed of multiple physical servers, and can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, and big data and artificial intelligence platforms.

[0086] In an embodiment of the present application, as an alternative implementation, the edge node 13 in the local area network obtains the data to be stored; shards the data to be stored based on the number of edge nodes in the target node group where the edge node 13 is located, to obtain multiple sharded data; for any one of the sharded data, determines the target node information based on any one of the sharded data, and matches the target node information with the node information of each edge node in the target node group, and determines the target edge node according to the matching result; if the determined target edge node is another edge node, then sends any one of the sharded data to the target edge node, so that the target edge node stores any one of the sharded data.

[0087] Next, refer to Figure 2 The flowchart of a data storage method shown to illustrate the technical solution provided by the embodiment of the present application:

[0088] Step 201, obtain the data to be stored.

[0089] In an embodiment of the present application, according to different actual scenarios, the types of the data to be stored collected are different. For example, in a video surveillance scenario, the data to be stored can be video data. In an intelligent manufacturing scenario, the data to be stored can be production data. In a financial scenario, the data to be stored can be financial data.

[0090] Step 202: Based on the number of edge nodes in the target node group where the edge node is located, slice the data to be stored to obtain multiple sliced data.

[0091] In the embodiments of the present application, the local area network includes at least one node group, and each node group includes multiple edge nodes. The number of edge nodes included in each node group in the local area network may be the same or different. Each edge node in the node group may have similar or the same hardware configuration, including resources such as a processor, memory, storage space, and network bandwidth.

[0092] For example, Figure 3 is a schematic diagram of a local area network provided by the embodiments of the present application. As Figure 3 shown, the local area network includes 3 node groups, and each node group includes 2 edge nodes. Figure 4 is another schematic diagram of a local area network provided by the embodiments of the present application. As Figure 4 shown, the local area network includes 3 node groups. Node group 1 includes 2 edge nodes, node group 2 includes 3 edge nodes, and node group 3 includes 2 edge nodes.

[0093] In the embodiments of the present application, the server 12 can group the edge nodes in the local area network in the following several ways to obtain multiple node groups:

[0094] The first way: Randomly group the edge nodes in the local area network to obtain multiple node groups.

[0095] For example, the local area network includes 6 edge nodes, namely edge node 1, edge node 2, edge node 3, edge node 4, edge node 5, and edge node 6. Edge node 1, edge node 2, and edge node 3 can be randomly divided into node group 1, and edge node 4, edge node 5, and edge node 6 can be divided into node group 2.

[0096] The second way: Obtain the performance data of each edge node in the local area network, and based on the performance data of each edge node, cluster the edge nodes in the local area network to obtain multiple node groups.

[0097] Among them, the performance data of each edge node includes some or all of the CPU (Central Processing Unit) data, storage space data, and memory data. In the embodiments of the present application, based on the performance data of each edge node, a set clustering algorithm is used to cluster the edge nodes in the local area network to obtain multiple node groups. The set clustering algorithm can be set according to the actual situation. For example, the clustering algorithm can be the k-means algorithm (k-means clustering algorithm), the DBSCAN (Density-Based Spatial Clustering of Applications with Noise) algorithm, or other algorithms.

[0098] In the third method, obtain the location data of each edge node in the local area network. Based on the location data of each edge node, determine the distance between any two edge nodes in the local area network. Based on the distance between any two edge nodes, cluster the edge nodes in the local area network to obtain multiple node groups.

[0099] Among them, the location data of each edge node is the location of the edge node in the actual environment. In the embodiments of the present application, based on the distance between any two edge nodes, a set clustering algorithm is used to cluster the edge nodes in the local area network to obtain multiple node groups. The set clustering algorithm can be set according to the actual situation.

[0100] In the fourth method, obtain the performance data of each edge node in the local area network. Based on the performance data of each edge node, determine the attribute correlation of each edge node. Based on the attribute correlation of each edge node, cluster the edge nodes in the local area network to obtain multiple node groups.

[0101] In the embodiments of the present application, determining the attribute correlation of each edge node based on the performance data of each edge node includes:

[0102] For any one edge node, use the ratio between the memory data of any one edge node and the storage space data of any one edge node as the attribute correlation of any one edge node.

[0103] For example, the memory data of edge node 1 is 8G (Gigabyte), and the storage space data of edge node 1 is 256G. Then the attribute correlation of edge node 1 is 8 / 256 = 1 / 32. The memory data of edge node 2 is 16G, and the storage space data of edge node 2 is 512G. Then the attribute correlation of edge node 2 is 16 / 512 = 1 / 32.

[0104] In the embodiments of the present application, based on the attribute correlation of each edge node, a set clustering algorithm is used to cluster the edge nodes in the local area network, and multiple node groups are obtained. The set clustering algorithm can be set according to the actual situation.

[0105] In the embodiments of the present application, after grouping the edge nodes in the local area network to obtain multiple node groups, the edge nodes in the same node group are sorted. The previous edge node of each edge node can be used as the backup edge node of this edge node, and the backup node of the first edge node is the last edge node. Alternatively, the next edge node of each edge node can be used as the backup edge node of this edge node, and the backup node of the last edge node is the first edge node, so that all the edge nodes in the same node group form a directed node ring. Each edge node in the node group stores the address information of all the edge nodes in the node group.

[0106] For example, Figure 5 is a schematic diagram of a node group provided by the embodiments of the present application. As Figure 5 shown, the node group includes edge node 1, edge node 2, and edge node 3. Edge node 1 is the backup edge node of edge node 2, edge node 2 is the backup edge node of edge node 3, and edge node 3 is the backup edge node of edge node 1.

[0107] In the embodiments of the present application, based on the number of edge nodes in the target node group where the edge node is located, the data to be stored is sharded to obtain multiple sharded data. The size of each sharded data can be the same or different. For example, if the number of edge nodes in the target node group is 3, then according to the number of edge nodes in the node group, the data to be stored is evenly sharded to obtain 3 sharded data, and the size of each sharded data is the same.

[0108] Optionally, after obtaining the data to be stored, it further includes:

[0109] Obtaining the performance data of each edge node in the target node group;

[0110] Based on the performance data of each edge node and the sum value of the performance data of each edge node, determining the performance ratio of each edge node;

[0111] Based on the performance ratio of each edge node and the data volume of the data to be stored, determining the amount of each sharded data;

[0112] Based on the amount of each sharded data, sharding the data to be stored to obtain multiple sharded data.

[0113] In the embodiments of the present application, based on the performance data of each edge node and the sum value of the performance data of each edge node, determining the performance ratio of each edge node includes:

[0114] For any edge node, the ratio between the performance data of any edge node and the sum value of the performance data of each edge node is used as the performance proportion of any edge node.

[0115] Among them, the performance data of each edge node includes some or all of the CPU data, storage space data, and memory data.

[0116] Taking the performance data of the edge node including the storage space data as an example, the target node group includes edge node 1, edge node 2, and edge node 3. The storage space data of edge node 1 is 256G, the storage space data of edge node 2 is 512G, and the storage space data of edge node 3 is 512G. The performance proportion of edge node 1 is The performance proportion of edge node 2 is The performance proportion of edge node 3 is

[0117] In the embodiments of the present application, based on the obtained performance data of each edge node, the data to be stored is sharded to obtain multiple sharded data, so that the larger the amount of data of the sharded data corresponding to the edge node with better performance data, and the smaller the amount of data of the sharded data corresponding to the edge node with worse performance data.

[0118] Optionally, after obtaining multiple sharded data, it further includes:

[0119] Based on the node information of the edge node, determine the first source label, and add the first source label to each sharded data respectively.

[0120] Among them, the first source label can be the edge node number or the edge node name.

[0121] Optionally, after obtaining multiple sharded data, it further includes:

[0122] For any sharded data, use the set sensitive information recognition method to identify the sensitive information in any sharded data, and use the sensitive key of the edge node to encrypt the sensitive information in any sharded data.

[0123] Among them, the set sensitive information recognition method can be set according to the actual situation. For example, a sensitive information recognition model can be used to identify the sensitive information in the sharded data.

[0124] In the embodiments of the present application, use the set sensitive information recognition method to identify the sensitive information in the sharded data, and use the sensitive key of the edge node to encrypt the sensitive information in the sharded data, so as to ensure the security of the sensitive information in the sharded data and reduce the risk of data leakage.

[0125] Step 203: For any sharded data, determine the target node information based on the sharded data, match the target node information with the node information of each edge node in the target node group, and determine the target edge node according to the matching result.

[0126] Among them, the node information of the edge node can be information such as the edge node number and the edge node name.

[0127] In the embodiment of the present application, in the process of sharding the data to be stored based on the performance data of each obtained edge node to obtain multiple sharded data, determine the sharded data volume corresponding to any one edge node based on the performance ratio of any one edge node and the data volume of the data to be stored; shard the data to be stored based on the sharded data volume corresponding to any one edge node to obtain sharded data, and the sharded data includes the node information of any one edge node.

[0128] Optionally, determining the target node information based on any sharded data includes:

[0129] Perform a modulo operation on the slice number of any slice of data and the number of edge nodes in the target node group to obtain a modulo result; match the modulo result with the edge node numbers of each edge node in the target node group to determine the target edge node.

[0130] For example, the node group includes edge node A, edge node B, and edge node C. The edge node number of edge node A is 0, the edge node number of edge node B is 1, and the edge node number of edge node C is 2. If the slice number of slice data 1 is 0, perform a modulo operation on the slice number of slice data 1 and the number of edge nodes in the node group, and the obtained modulo result is 0. Match the modulo result with the edge node numbers of each edge node in the node group to determine that the target edge node is edge node A. If the slice number of slice data 2 is 1, perform a modulo operation on the slice number of slice data 2 and the number of edge nodes in the node group, and the obtained modulo result is 1; match the modulo result with the edge node numbers of each edge node in the node group to determine that the target edge node is edge node B. If the slice number of slice data 3 is 2, perform a modulo operation on the slice number of slice data 3 and the number of edge nodes in the node group, and the obtained modulo result is 2; match the modulo result with the edge node numbers of each edge node in the node group to determine that the target edge node is edge node C.

[0131] Optionally, the data storage method further includes:

[0132] Shard the data to be stored based on a set threshold to obtain multiple sharded data; acquire the performance data of each edge node; determine the performance proportion of each edge node based on the performance data of each edge node and the sum value of the performance data of each edge node; determine the number of sharded data allocated to each edge node based on the performance proportion of each edge node and the number of sharded data.

[0133] Among them, the above set threshold is greater than or equal to the number of edge nodes in the target node group where the edge node is located, and can be set according to the actual situation. The performance data of the above edge node includes some or all of the CPU data, storage space data, and memory data.

[0134] Taking the performance data of the edge node including storage space data as an example, the above set threshold is 5, indicating that the data to be stored is sharded into 5 sharded data. The target node group includes Edge Node 1, Edge Node 2, and Edge Node 3. The storage space data of Edge Node 1 is 512G, the storage space data of Edge Node 2 is 256G, and the storage space data of Edge Node 3 is 512G. Therefore, the performance proportion of Edge Node 1 is The performance proportion of Edge Node 2 is The performance proportion of Edge Node 3 is The amount of sharded data allocated to Edge Node 1 is 0.4 * 5 = 2, that is, 2 sharded data are allocated to Edge Node 1. The amount of sharded data allocated to Edge Node 2 is 0.2 * 5 = 1, that is, 1 sharded data is allocated to Edge Node 2. The amount of sharded data allocated to Edge Node 3 is 0.4 * 5 = 2, that is, 2 sharded data are allocated to Edge Node 3.

[0135] In the embodiments of the present application, based on the performance data of each edge node and the sum value of the performance data of each edge node, the performance proportion of each edge node is determined. Based on the performance proportion of each edge node and the number of sharded data, the number of sharded data allocated to each edge node is determined, so that the edge node with better performance data is allocated more sharded data, and the edge node with worse performance data is allocated less sharded data, thereby enabling more efficient and full utilization of the storage resources of each edge node and ensuring the load balance of the system in a distributed environment.

[0136] Step 204, if the determined target edge node is another edge node, then send any one of the sharded data to the target edge node so that the target edge node stores any one of the sharded data.

[0137] In the embodiments of the present application, if the determined target edge node is an edge node, then store any one of the sharded data.

[0138] For example, as Figure 5As shown, the node group includes Edge Node 1, Edge Node 2, and Edge Node 3. Edge Node 1 obtains the data a to be stored, and based on the number of edge nodes in the node group, slices the data a to be stored, obtaining sliced data a1, sliced data a2, and sliced data a3. Edge Node 1 determines the target edge node as Edge Node 1 based on the sliced data a1 and the node information of each edge node, and Edge Node 1 stores the sliced data a1. Edge Node 1 determines the target edge node as Edge Node 2 based on the sliced data a2 and the node information of each edge node, and Edge Node 1 sends the sliced data a2 to Edge Node 2, and Edge Node 2 stores the sliced data a2. Edge Node 1 determines the target edge node as Edge Node 3 based on the sliced data a3 and the node information of each edge node, and Edge Node 1 sends the sliced data a3 to Edge Node 3, and Edge Node 3 stores the sliced data a3.

[0139] Edge Node 2 obtains the data b to be stored, and based on the number of edge nodes in the node group, slices the data b to be stored, obtaining sliced data b1, sliced data b2, and sliced data b3. Edge Node 2 determines the target edge node as Edge Node 1 based on the sliced data b1 and the node information of each edge node, and Edge Node 2 sends the sliced data b1 to Edge Node 1, and Edge Node 1 stores the sliced data b1. Edge Node 2 determines the target edge node as Edge Node 2 based on the sliced data b2 and the node information of each edge node, and Edge Node 2 stores the sliced data b2. Edge Node 2 determines the target edge node as Edge Node 3 based on the sliced data b3 and the node information of each edge node, and Edge Node 2 sends the sliced data b3 to Edge Node 3, and Edge Node 3 stores the sliced data b3.

[0140] Edge Node 3 obtains the data c to be stored, and based on the number of edge nodes in the node group, slices the data c to be stored, obtaining sliced data c1, sliced data c2, and sliced data c3. Edge Node 3 determines the target edge node as Edge Node 1 based on the sliced data c1 and the node information of each edge node, and Edge Node 3 sends the sliced data c1 to Edge Node 1, and Edge Node 1 stores the sliced data c1. Edge Node 3 determines the target edge node as Edge Node 2 based on the sliced data c2 and the node information of each edge node, and Edge Node 3 sends the sliced data c2 to Edge Node 2, and Edge Node 2 stores the sliced data c2. Edge Node 3 determines the target edge node as Edge Node 3 based on the sliced data c3 and the node information of each edge node, and Edge Node 3 stores the sliced data c3.

[0141] In the embodiments of the present application, data can be transmitted between any two edge nodes in the target node group. During the data transmission process, the SSL / TLS (Secure Socket Layer / Transport Layer Security) protocol is used to ensure the encrypted transmission of data, thereby protecting the security of data during network transmission and preventing the data from being stolen or tampered with during the transmission process. For example, during the process of an edge node sending any shard data to the target edge node, the SSL / TLS protocol is adopted.

[0142] In the embodiments of the present application, after any shard data is sent to the target edge node, the target edge node receives any shard data, and uses the storage key of the target edge node to encrypt any shard data, and stores the encrypted any shard data in the local database or file system, thereby protecting the security of data in the static state and preventing the data from being leaked when the data storage medium is illegally accessed or stolen.

[0143] In the embodiments of the present application, the edge nodes in the local area network shard the to-be-stored data obtained based on the number of edge nodes in the target node group where the edge nodes are located, to obtain a plurality of shard data; for any shard data, based on any shard data, determine the target node information, and match the target node information with the node information of each edge node in the target node group. According to the matching result, determine the target edge node, that is, the edge node that will store any shard data; if the target edge node is another edge node, then send any shard data to the target edge node, so that the target edge node stores any shard data, thereby improving the data storage efficiency, and realizing that each shard data of the to-be-stored data is stored in different edge nodes in the target node group. Even if an attacker breaks through an edge node in the target node group, it is impossible to obtain the complete data based on the shard data stored in the edge node, and the attacker is even more unable to determine other edge nodes in the target node group. Therefore, the data security is improved, and the occurrence of security problems such as data leakage is reduced.

[0144] In the embodiments of the present application, in response to a first processing request triggered by a user, an edge node determines target shard data corresponding to the first processing request based on the shard data stored by each edge node in the target node group. Figure 6 The flowchart of a method for determining target shard data corresponding to a first processing request provided by the embodiments of the present application is as Figure 6 shown, and at least includes the following steps 601-603:

[0145] Step 601: In response to a first processing request triggered by a user, process the sharded data with the first source tag in the first processing request to obtain the first sharded data of the edge node.

[0146] Among them, the first source tag is used to represent the edge node that generates the sharded data. In the embodiments of the present application, according to different actual scenarios, the first processing requests triggered by users are different. For example, in a video surveillance scenario, the first processing request may be to query a certain target, and in a user data management scenario, the first processing request may be to obtain user data that meets set conditions.

[0147] Taking the user data management scenario as an example, the target node group includes Edge Node 1, Edge Node 2, and Edge Node 3, and the sharded data is user data. If the first processing request is to obtain user data with a user age between 20 and 30 years old, then Edge Node 1 responds to the first processing request triggered by the user. Since the first source tag included in the first processing request is Edge Node 1, based on the first processing request, query and process the sharded data from Edge Node 1 to obtain the user data with a user age between 20 and 30 years old corresponding to Edge Node 1, that is, the first sharded data of the edge node.

[0148] Step 602: Sign the first processing request to obtain a second processing request, and send the second processing request to each other edge node respectively.

[0149] Optionally, signing the first processing request to obtain a second processing request includes:

[0150] Perform a hash calculation on the first processing request to obtain a third hash value, and encrypt the third hash value using the private key of the edge node to obtain a second digital signature; obtain the second processing request based on the first processing request and the second digital signature.

[0151] In the embodiments of the present application, a set hash algorithm can be used to perform a hash calculation on the first processing request to obtain a third hash value. Among them, the set hash algorithm can be set according to the actual situation. For example, the set hash algorithm can be SHA-256 (Secure Hash Algorithm - 256, a 256-bit secure hash algorithm). SHA is a family of cryptographic hash functions that can calculate the algorithm corresponding to a digital message to a fixed-length string (also known as a message digest). The output of SHA-256 is a 256-bit (32-byte) hash value.

[0152] In the embodiments of the present application, each edge node generates and maintains its own pair of asymmetric key pairs (including a public key and a private key).

[0153] In the embodiment of the present application, the first processing request is signed to obtain a second processing request, so as to ensure that the request content in the second processing request sent to other edge nodes will not be tampered with or forged during the transmission process.

[0154] Step 603: Receive the first shard data of each other edge node sent by each other edge node, and based on the first shard data of the edge node and the first shard data of each other edge node, obtain the target shard data corresponding to the first processing request.

[0155] Among them, the first shard data of other edge nodes is obtained by other edge nodes processing the shard data with the first source label based on the received second processing request.

[0156] Optionally, based on the first shard data of the edge node and the first shard data of each other edge node, obtaining the target shard data corresponding to the first processing request includes:

[0157] Summarize the first shard data of the edge node and the first shard data of each other edge node to obtain the target shard data corresponding to the first processing request.

[0158] As Figure 1 shown, the client 11 obtains the first processing request triggered by the user and sends it to the server 12; the server 12 is used to send the received first processing request to the edge node 13 in the local area network. The edge node 13 is used to process the shard data with the first source label in the first processing request based on the first processing request to obtain the first shard data of the edge node; sign the first processing request to obtain a second processing request, and send the second processing request to each other edge node respectively; receive the first shard data of each other edge node sent by each other edge node, and based on the first shard data of the edge node and the first shard data of each other edge node, obtain the target shard data corresponding to the first processing request

[0159] For example, as Figure 5As shown, the edge node 2 responds to the first processing request triggered by the user, processes the shard data with the first source label in the first processing request based on the first processing request, and obtains the first shard data of the edge node 2. The edge node 2 signs the first processing request to obtain a second processing request, and sends the second processing request to the edge node 1 and the edge node 3. The edge node 1 receives the second processing request, processes the shard data with the first source label based on the second processing request, obtains the first shard data of the edge node 1, and sends the first shard data of the edge node 1 to the edge node 2. The edge node 3 receives the second processing request, processes the shard data with the first source label based on the second processing request, obtains the first shard data of the edge node 3, and sends the first shard data of the edge node 3 to the edge node 2. The edge node 2 receives the first shard data of the edge node 1 and the first shard data of the edge node 3, and obtains the target shard data corresponding to the first processing request based on the first shard data of the edge node 1, the first shard data of the edge node 2, and the first shard data of the edge node 3.

[0160] In the embodiment of the present application, the edge node processes the stored shard data based on the first processing request triggered by the user to obtain the first shard data of the edge node. And the edge node signs the first processing request to obtain a second processing request, and sends the second processing request to each other edge node respectively. Each other edge node processes the stored shard data based on the second processing request to obtain the first shard data of the other edge node. The edge node obtains the target shard data corresponding to the first processing request based on the first shard data of the edge node and the first shard data of each other edge node received. The present application can more efficiently utilize the computing and storage resources of each edge node in the target node group, realize the reasonable scheduling and balance of resources, improve the data processing efficiency, and at the same time reduce the centralized load of the data processing task.

[0161] Since there may be encrypted sensitive information in the shard data with the first source label stored by other edge nodes, and the shard data with the first source label cannot be processed, therefore, in the present application, after step 602 sends the second processing request to each other edge node respectively, before step 603 receives the first shard data corresponding to each other edge node sent by each other edge node, it receives the first sensitive key request sent by any one other edge node, and sends the sensitive key of the edge node to any one other edge node. Figure 7 The flow chart of a method for processing the first sensitive key request provided by the embodiment of the present application is as Figure 7 shown, and at least includes the following steps 701-702:

[0162] Step 701, receive the first sensitive key request sent by any one other edge node.

[0163] Among them, the first sensitive key request is used to obtain the sensitive key of the edge node.

[0164] Step 702: Based on the first sensitive key request, determine the sensitive key of the edge node, and send the sensitive key of the edge node to any other edge node, so that any other edge node uses the sensitive key of the edge node to decrypt the sensitive information in the sharded data with the first source label, and processes the decrypted sharded data with the first source label based on the second processing request to obtain the first sharded data of any other edge node.

[0165] Optionally, sending the sensitive key of the edge node to any other edge node further includes:

[0166] Encrypt the sensitive key of the edge node using the public key of any other edge node stored by the edge node, and send the encrypted sensitive key of the edge node to any other edge node.

[0167] In the embodiments of the present application, any other edge node receives the encrypted sensitive key of the edge node, and uses the private key of any other edge node to decrypt the encrypted sensitive key of the edge node to obtain the sensitive key of the edge node.

[0168] In the embodiments of the present application, any other edge node responds to the fourth processing request triggered by the user, signs the fourth processing request to obtain the third processing request, and sends the third processing request to the edge node. After receiving the third processing request, the edge node needs to verify whether the third processing request is a legal request. Figure 8 It is a flowchart of a method for verifying whether the third processing request is a legal request provided by the embodiments of the present application. As Figure 8 shown, it at least includes the following steps 801-804:

[0169] Step 801: Receive the third processing request of any other edge node.

[0170] Among them, any other edge node is the edge node that responds to the fourth processing request triggered by the user. Any other edge node responds to the fourth processing request triggered by the user, performs a hash operation on the fourth processing request to obtain the first hash value, and encrypts the first hash value using the private key of any other edge node to obtain the first digital signature; the third processing request is obtained based on the fourth processing request and the first digital signature. The present application can perform a hash calculation on the fourth processing request using a set hash algorithm to obtain the first hash value.

[0171] Step 802: Use the public key of any other edge node stored in the edge node to decrypt the first digital signature in the third processing request to obtain the first hash value.

[0172] Step 803: Perform a hash calculation on the fourth processing request in the third processing request to obtain the second hash value.

[0173] In the embodiments of the present application, a set hash algorithm can be used to perform a hash calculation on the fourth processing request in the third processing request to obtain the third hash value. The set hash algorithm in the above hash calculation of the fourth processing request using the set hash algorithm is the same as the set hash algorithm in the hash calculation of the fourth processing request in the third processing request using the set hash algorithm.

[0174] Step 804: Compare the first hash value and the second hash value to obtain a comparison result, and determine whether the third processing request is a legal request based on the comparison result.

[0175] Optionally, determining whether the third processing request is a legal request based on the comparison result includes:

[0176] If the comparison result indicates that the first hash value and the second hash value are the same, determine that the third processing request is a legal request, and process the shard data with the second source label in the third processing request based on the third processing request to obtain the second shard data of the edge node, and send the second shard data of the edge node to any other edge node, where the second source label is used to represent any other edge node that generates the shard data;

[0177] If the comparison result indicates that the first hash value and the second hash value are different, determine that the third processing request is not a legal request, and generate exception information based on the third processing request, and send the exception information to any other edge node.

[0178] Among them, the exception information includes information such as the request time and the request content.

[0179] In the embodiments of the present application, to ensure that each edge node only starts the corresponding data processing process after receiving a legal processing request from an edge node in distributed processing, the present application adopts an authentication mechanism based on digital signatures to ensure the authenticity, integrity, and source credibility of the processing request, and prevent man-in-the-middle attacks or malicious node forgery requests. Each edge node only responds to legal processing requests that have passed signature verification, improving the security of processing tasks in the distributed system.

[0180] Figure 9 It is a specific flowchart of a method for verifying whether a third processing request is a legal request provided by the embodiments of the present application, as shown in Figure 9As shown in the figure, it includes at least the following steps 901 - 906:

[0181] Step 901: Receive a third processing request from any other edge node.

[0182] Among them, any other edge node is an edge node that responds to a fourth processing request triggered by a user. The third processing request includes the fourth processing request and a first digital signature.

[0183] Step 902: Use the public key of any other edge node stored in the edge node to decrypt the first digital signature in the third processing request to obtain a first hash value.

[0184] Step 903: Calculate the hash value of the fourth processing request in the third processing request to obtain a second hash value.

[0185] Step 904: Determine whether the first hash value is the same as the second hash value. If they are the same, execute Step 905; otherwise, execute Step 906.

[0186] Step 905: Determine that the third processing request is a legitimate request, and process the shard data with the second source label in the third processing request to obtain the second shard data of the edge node, and send the second shard data of the edge node to any other edge node.

[0187] Among them, the second source label is used to represent any other edge node that generates the shard data.

[0188] In the embodiment of the present application, if there is no shard data with the second source label in the shard data stored in the edge node, or the shard data with the second source label cannot be processed based on the third processing request to obtain the second shard data of the edge node, then send information indicating that the edge node does not have the second shard data to any other edge node.

[0189] Step 906: Determine that the third processing request is not a legitimate request, generate exception information based on the third processing request, and send the exception information to any other edge node.

[0190] In the embodiment of the present application, the shard data with the second source label in the third processing request is processed to obtain the second shard data of the edge node. Figure 10 It is a flowchart of a method for obtaining the second shard data of an edge node provided by the embodiment of the present application. As Figure 10 shown, it includes at least the following steps 101 - 103:

[0191] Step 101, if there is encrypted sensitive information in the shard data stored by the edge node with the second source label, send a second sensitive key request to any other edge node.

[0192] Among them, the second sensitive key request is used to obtain the sensitive key of any other edge node.

[0193] Step 102, receive the sensitive key of any other edge node sent by any other edge node after receiving the second sensitive key request.

[0194] Specifically, receive the sensitive key of any other edge node encrypted with the public key of the edge node sent by any other edge node after receiving the second sensitive key request; use the private key of the edge node to decrypt the encrypted sensitive key of any other edge node to obtain the sensitive key of any other edge node.

[0195] Step 103, use the sensitive key of any other edge node to decrypt the shard data with the second source label, and process the decrypted shard data with the second source label based on the third processing request to obtain the second shard data of the edge node.

[0196] Taking the target node group including edge node 1 and edge node 2, and edge node 1 receiving the first processing request as an example, Figure 11 This is a specific flowchart of a method for determining the target shard data corresponding to the first processing request provided by the embodiment of the present application. As Figure 11 shown, it at least includes the following steps 111-118:

[0197] Step 111, in response to the first processing request triggered by the user, edge node 1 processes the shard data with the first source label in the first processing request to obtain the first shard data of edge node 1.

[0198] Among them, the first source label is used to represent edge node 1 that generates the shard data.

[0199] Step 112, edge node 1 signs the first processing request to obtain a second processing request.

[0200] Among them, the second processing request includes a digital signature and the first processing request.

[0201] Step 113, edge node 1 sends the second processing request to edge node 2.

[0202] Step 114, edge node 2 uses the public key of edge node 1 stored in it to decrypt the digital signature in the second processing request to obtain hash value 1.

[0203] Step 115: The edge node 2 performs a hash calculation on the first processing request in the second processing request to obtain a hash value 2.

[0204] Step 116: The edge node 2 determines that the hash value 1 is the same as the hash value 2, determines that the second processing request is a legitimate request, and processes the shard data with the first source label based on the second processing request to obtain the first shard data of the edge node 2.

[0205] Step 117: The edge node 2 sends the first shard data of the edge node 2 to the edge node 1.

[0206] Step 118: The edge node 1 obtains the target shard data corresponding to the first processing request based on the first shard data of the edge node 1 and the first shard data of the edge node 2.

[0207] In the above step 116, the edge node 2 processes the shard data with the first source label based on the second processing request to obtain the first shard data of the edge node 2. Figure 12 This is a flowchart of a method for determining the first shard data of the edge node 2 provided by an embodiment of the present application. As Figure 12 shown, it at least includes the following steps 121-127:

[0208] Step 121: The edge node 2 determines that there is encrypted sensitive information in the stored shard data with the first source label.

[0209] Step 122: The edge node 2 sends a sensitive key request to the edge node 1.

[0210] Step 123: The edge node 1 determines the sensitive key of the edge node 1 based on the sensitive key request.

[0211] Step 124: The edge node 1 encrypts the sensitive key of the edge node 1 using the public key of the edge node 2 stored to obtain the encrypted sensitive key of the edge node 1.

[0212] Step 125: The edge node 1 sends the encrypted sensitive key of the edge node 1 to the edge node 2.

[0213] Step 126: The edge node 2 decrypts the encrypted sensitive key of the edge node 1 using the private key of the edge node 2 to obtain the sensitive key of the edge node 1.

[0214] Step 127: The edge node 2 decrypts the shard data with the first source label using the sensitive key of the edge node 1, and processes the decrypted shard data with the first source label based on the second processing request to obtain the first shard data of the edge node 2.

[0215] In the embodiments of the present application, before obtaining the data to be stored, the following steps are further included:

[0216] After joining the target node group, any adjacent edge node of the edge node is used as a standby edge node, where the standby edge node is an edge node for storing the shard data of the edge node; and / or,

[0217] When it is detected that any other edge node joins the target node group, any adjacent edge node of the edge node is used as a standby edge node.

[0218] Optionally, detecting that any other edge node joins the target node group includes:

[0219] Receiving the node joining information sent by any other edge node to each edge node in the target node group.

[0220] For example, Figure 13 is a schematic diagram of an edge node joining a node group provided by an embodiment of the present application. As Figure 13 shown, the node group includes edge node 1, edge node 2, and edge node 3. Edge node 1 is the standby edge node of edge node 2, edge node 2 is the standby edge node of edge node 3, and edge node 3 is the standby edge node of edge node 1. After edge node 4 joins the node group, edge node 3 is used as the standby edge node of edge node 4, and edge node 3 deletes the shard data (a1, b1, c1) of the backed-up edge node 1. Since edge node 4 is not an edge node that exited the node group in history, there is no need to recover the data. After edge node 1 detects that edge node 4 joins the node group, edge node 4 is used as the standby node of edge node 1, and the shard data (a1, b1, c1) stored in edge node 1 is backed up to edge node 4.

[0221] Figure 14 is another schematic diagram of an edge node joining a node group provided by an embodiment of the present application. As Figure 14As shown, the node group includes Edge Node 1, Edge Node 2, and Edge Node 3. Edge Node 1 is the standby edge node of Edge Node 2, Edge Node 2 is the standby edge node of Edge Node 3, and Edge Node 3 is the standby edge node of Edge Node 1. After Edge Node 4 joins the node group, Edge Node 3 is used as the standby edge node of Edge Node 4, and Edge Node 3 deletes the shard data (a1, b1, c1) of the backed-up Edge Node 1. Since Edge Node 4 is an edge node that exited the node group in history, based on the shard data backed up in Edge Node 3, the shard data (a4, b4, c4) stored by Edge Node 4 in history is restored. After Edge Node 1 detects that Edge Node 4 has joined the node group, Edge Node 4 is used as the standby node of Edge Node 1, and the shard data (a1, b1, c1) stored by Edge Node 1 is backed up to Edge Node 4.

[0222] In the embodiment of the present application, the data storage method further includes:

[0223] When it is detected that any other edge node exits the target node group, any adjacent edge node of the edge node is used as the standby edge node.

[0224] Since any other edge node exiting the target node group includes active exit and passive exit. When any other edge node actively exits the target node group, it is necessary to send node exit information to all edge nodes in the target node group. When any other edge node passively exits the target node group, each edge node in the target node group needs to determine whether any other edge node has exited through the heartbeat mechanism. Therefore, detecting that any other edge node exits the target node group includes: receiving the node exit information sent by any other edge node to each edge node in the target node group; or, determining that the duration of not detecting the heartbeat sent by any other edge node exceeds the set duration threshold. Among them, the set duration can be set according to the actual situation.

[0225] For example, Figure 15 is a schematic diagram of an edge node exiting the node group provided by the embodiment of the present application. As Figure 15As shown in the figure, the node group includes Edge Node 1, Edge Node 2, and Edge Node 3. Edge Node 1 is the standby edge node of Edge Node 2, Edge Node 2 is the standby edge node of Edge Node 3, and Edge Node 3 is the standby edge node of Edge Node 1. After Edge Node 2 exits the node group, Edge Node 3 detects that Edge Node 2 has exited the node group, sets Edge Node 1 as the standby node of Edge Node 3, and backs up the shard data (a3, b3, c3) stored in Edge Node 3 to Edge Node 1. The shard data (a2, b2, c2) backed up by Edge Node 2 and stored in Edge Node 3 remains unchanged to ensure data integrity, prevent data loss, and facilitate data recovery after Edge Node 2 rejoins the node group.

[0226] Based on the same technical concept, the present application exemplarily provides a data storage device, as Figure 16 shown, the device includes:

[0227] An acquisition module 161, configured to acquire data to be stored;

[0228] A sharding module 162, configured to shard the data to be stored based on the number of edge nodes in the target node group where the edge nodes are located, to obtain a plurality of shard data;

[0229] A determination module 163, configured to, for any one of the shard data, based on the any one of the shard data, determine target node information, match the target node information with the node information of each edge node in the target node group, and determine a target edge node according to the matching result;

[0230] A sending module 164, configured to, if the determined target edge node is another edge node, send the any one of the shard data to the target edge node, so that the target edge node stores the any one of the shard data.

[0231] Optionally, after acquiring the data to be stored, the acquisition module 161 is further configured to:

[0232] Acquire the performance data of each edge node in the target node group;

[0233] Based on the performance data of each edge node and the sum value of the performance data of each edge node, determine the performance proportion of each edge node;

[0234] Based on the performance proportion of each edge node and the data volume of the data to be stored, determine the amount of each shard data;

[0235] Based on the amount of each shard data, shard the data to be stored to obtain a plurality of shard data.

[0236] Optionally, after obtaining the multiple shard data, the sharding module 162 is further configured to:

[0237] Based on the node information of the edge node, determine a first source tag, and add the first source tag to each shard data respectively;

[0238] Wherein, the data storage device further includes:

[0239] A processing module, configured to, in response to a first processing request triggered by a user, process the shard data with the first source tag in the first processing request to obtain the first shard data of the edge node;

[0240] A signature module, configured to sign the first processing request to obtain a second processing request, and send the second processing request to each other edge node respectively;

[0241] A first receiving module, configured to receive the first shard data of each other edge node sent by each other edge node, and obtain the target shard data corresponding to the first processing request based on the first shard data of the edge node and the first shard data of each other edge node, wherein the first shard data of the other edge node is obtained by the other edge node processing the shard data with the first source tag based on the received second processing request.

[0242] Optionally, after sending the second processing request to each other edge node respectively and before receiving the first shard data of each other edge node sent by each other edge node, the signature module is further configured to:

[0243] For any one of the other edge nodes, receive a first sensitive key request sent by the any one of the other edge nodes, wherein the first sensitive key request is used to obtain the sensitive key of the edge node;

[0244] Based on the first sensitive key request, determine the sensitive key of the edge node, and send the sensitive key of the edge node to the any one of the other edge nodes, so that the any one of the other edge nodes uses the sensitive key of the edge node to decrypt the sensitive information in the shard data with the first source tag, and processes the decrypted shard data with the first source tag based on the second processing request to obtain the first shard data of the any one of the other edge nodes.

[0245] Optionally, the data storage device further includes:

[0246] A second receiving module, configured to receive, for any one of other edge nodes, a third processing request from the any one of other edge nodes, where the any one of other edge nodes is an edge node that responds to a fourth processing request triggered by a user;

[0247] A decryption module, configured to use the public key of the any one of other edge nodes stored by the edge node to decrypt the first digital signature in the third processing request to obtain a first hash value;

[0248] A calculation module, configured to perform a hash calculation on the fourth processing request in the third processing request to obtain a second hash value;

[0249] A judgment module, configured to compare the first hash value and the second hash value to obtain a comparison result, and determine whether the third processing request is a legitimate request based on the comparison result.

[0250] Optionally, the judgment module is configured to:

[0251] If the comparison result indicates that the first hash value is the same as the second hash value, determine that the third processing request is a legitimate request, and process the shard data with the second source label in the third processing request to obtain the second shard data of the edge node, and send the second shard data of the edge node to the any one of other edge nodes, where the second source label is used to represent the any one of other edge nodes that generate the shard data;

[0252] If the comparison result indicates that the first hash value is different from the second hash value, determine that the third processing request is not a legitimate request, and generate exception information based on the third processing request, and send the exception information to the any one of other edge nodes.

[0253] Optionally, the judgment module is configured to:

[0254] If there is encrypted sensitive information in the shard data with the second source label stored by the edge node, send a second sensitive key request to the any one of other edge nodes, where the second sensitive key request is used to obtain the sensitive key of the any one of other edge nodes;

[0255] Receive the sensitive key of the any one of other edge nodes sent by the any one of other edge nodes after receiving the second sensitive key request;

[0256] Decrypt the sharded data with the second source label by using the sensitive key of any one of the other edge nodes, and process the decrypted sharded data with the second source label based on the third processing request to obtain the second sharded data of the edge node.

[0257] Optionally, before obtaining the data to be stored, the obtaining module 161 is further configured to:

[0258] After joining the target node group, use any adjacent edge node of the edge node as a standby edge node, where the standby edge node is an edge node for storing the sharded data of the edge node; and / or

[0259] When it is detected that any other edge node joins the target node group, use any adjacent edge node of the edge node as a standby edge node.

[0260] Optionally, the data storage device further includes:

[0261] A detection module, configured to use any adjacent edge node of the edge node as a standby edge node when it is detected that any other edge node exits the target node group.

[0262] Based on the same inventive concept, an embodiment of the present application provides an electronic device, which can implement the functions of the data storage device described above. Please refer to Figure 17 , the device includes a processor 171 and a memory 172, where the memory 172 is used to store program instructions;

[0263] The processor 171 calls the program instructions stored in the memory and runs the program instructions to implement the following steps:

[0264] Obtain the data to be stored;

[0265] Shard the data to be stored based on the number of edge nodes in the target node group where the edge node is located to obtain a plurality of sharded data;

[0266] For any one of the sharded data, determine the target node information based on the any one of the sharded data, match the target node information with the node information of each edge node in the target node group, and determine the target edge node according to the matching result;

[0267] If the determined target edge node is another edge node, send the any one of the sharded data to the target edge node so that the target edge node stores the any one of the sharded data.

[0268] Optionally, after obtaining the data to be stored, the processor 171 is further configured to execute:

[0269] Obtain the performance data of each edge node in the target node group;

[0270] Based on the performance data of each edge node and the sum value of the performance data of each edge node, determine the performance proportion of each edge node;

[0271] Based on the performance proportion of each edge node and the data volume of the data to be stored, determine the data volume of each shard;

[0272] Based on the data volume of each shard, shard the data to be stored to obtain a plurality of sharded data.

[0273] Optionally, after obtaining the plurality of sharded data, the processor 171 is further configured to execute:

[0274] Based on the node information of the edge node, determine a first source label, and add the first source label to each sharded data;

[0275] Wherein, the processor 171 is further configured to execute:

[0276] In response to a first processing request triggered by a user, process the sharded data with the first source label in the first processing request to obtain the first sharded data of the edge node;

[0277] Sign the first processing request to obtain a second processing request, and send the second processing request to each other edge node respectively;

[0278] Receive the first sharded data of each other edge node sent by each other edge node, and based on the first sharded data of the edge node and the first sharded data of each other edge node, obtain the target sharded data corresponding to the first processing request, wherein the first sharded data of the other edge node is obtained by the other edge node processing the sharded data with the first source label based on the received second processing request.

[0279] Optionally, after sending the second processing request to each other edge node respectively and before receiving the first sharded data corresponding to each other edge node sent by each other edge node, the processor 171 is further configured to execute:

[0280] For any one of the other edge nodes, receive a first sensitive key request sent by the any one of the other edge nodes, where the first sensitive key request is used to obtain the sensitive key of the edge node;

[0281] Based on the first sensitive key request, determine the sensitive key of the edge node, and send the sensitive key of the edge node to any one of the other edge nodes, so that any one of the other edge nodes uses the sensitive key of the edge node to decrypt the sensitive information in the sharded data with the first source label, and processes the decrypted sharded data with the first source label based on the second processing request to obtain the first sharded data of any one of the other edge nodes.

[0282] Optionally, the processor 171 is further configured to execute:

[0283] For any one of the other edge nodes, receive the third processing request of any one of the other edge nodes, where any one of the other edge nodes is an edge node in response to a fourth processing request triggered by a user;

[0284] Use the public key of any one of the other edge nodes stored by the edge node to decrypt the first digital signature in the third processing request to obtain a first hash value;

[0285] Perform a hash calculation on the fourth processing request in the third processing request to obtain a second hash value;

[0286] Compare the first hash value and the second hash value to obtain a comparison result, and determine whether the third processing request is a legitimate request based on the comparison result.

[0287] Optionally, determining whether the third processing request is a legitimate request based on the comparison result includes:

[0288] If the comparison result indicates that the first hash value and the second hash value are the same, determine that the third processing request is a legitimate request, and process the sharded data with the second source label in the third processing request based on the third processing request to obtain the second sharded data of the edge node, and send the second sharded data of the edge node to any one of the other edge nodes, where the second source label is used to characterize any one of the other edge nodes that generates the sharded data;

[0289] If the comparison result indicates that the first hash value and the second hash value are different, determine that the third processing request is not a legitimate request, and generate exception information based on the third processing request, and send the exception information to any one of the other edge nodes.

[0290] Optionally, processing the sharded data with the second source label in the third processing request based on the third processing request to obtain the second sharded data of the edge node includes:

[0291] If there is encrypted sensitive information in the shard data with the second source label stored by the edge node, send a second sensitive key request to any one of the other edge nodes, where the second sensitive key request is used to obtain the sensitive key of any one of the other edge nodes;

[0292] Receive the sensitive key of any one of the other edge nodes sent after any one of the other edge nodes receives the second sensitive key request;

[0293] Use the sensitive key of any one of the other edge nodes to decrypt the shard data with the second source label, and process the decrypted shard data with the second source label based on the third processing request to obtain the second shard data of the edge node.

[0294] Optionally, before obtaining the data to be stored, the processor 171 is further configured to execute:

[0295] After joining the target node group, use any one of the adjacent edge nodes of the edge node as a standby edge node, where the standby edge node is an edge node used to store the shard data of the edge node; and / or

[0296] When it is detected that any one of the other edge nodes joins the target node group, use any one of the adjacent edge nodes of the edge node as a standby edge node.

[0297] Optionally, the processor 171 is further configured to execute:

[0298] When it is detected that any one of the other edge nodes exits the target node group, use any one of the adjacent edge nodes of the edge node as a standby edge node.

[0299] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium. The computer program product includes: computer program code, which when running on a computer, causes the computer to execute any one of the data storage methods described above. Since the principle of the above computer-readable storage medium for solving problems is similar to that of the data storage method, the implementation of the above computer-readable storage medium can refer to the implementation of the method, and the repeated parts will not be described again.

[0300] Based on the same inventive concept, an embodiment of the present application also provides a computer program product, which includes computer program code. When the computer program code runs on a computer, it causes the computer to execute any of the data storage methods discussed above. Since the principle of the above computer program product for solving problems is similar to that of the data storage method, the implementation of the above computer program product can refer to the implementation of the method, and the repeated parts will not be elaborated.

[0301] Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0302] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0303] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including instruction means, and the instruction means implements the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0304] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of user operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0305] Obviously, those skilled in the art can make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, this application is also intended to include these modifications and variations.

Claims

1. A data storage method, characterized in that, Applied to edge nodes in a local area network, including: Obtain data to be stored; Based on the number of edge nodes in the target node group where the edge node is located, slice the data to be stored to obtain multiple sliced data; For any one of the sliced data, based on the any one of the sliced data, determine target node information, and match the target node information with the node information of each edge node in the target node group. According to the matching result, determine the target edge node; If the determined target edge node is another edge node, send the any one of the sliced data to the target edge node so that the target edge node stores the any one of the sliced data.

2. The method according to claim 1, characterized in that, After obtaining the data to be stored, it further includes: Obtain the performance data of each edge node in the target node group; Based on the performance data of each edge node and the sum value of the performance data of each edge node, determine the performance ratio of each edge node; Based on the performance ratio of each edge node and the data volume of the data to be stored, determine the amount of each sliced data; Based on the amount of each sliced data, slice the data to be stored to obtain multiple sliced data.

3. The method according to claim 1 or 2, characterized in that, After obtaining the multiple sliced data, it further includes: Based on the node information of the edge node, determine the first source tag, and add the first source tag to each sliced data respectively; Wherein, the method further includes: In response to a first processing request triggered by a user, process the sliced data with the first source tag in the first processing request to obtain the first sliced data of the edge node; Sign the first processing request to obtain a second processing request, and send the second processing request to each other edge node respectively; Receive the first sliced data of each other edge node sent by each other edge node, and based on the first sliced data of the edge node and the first sliced data of each other edge node, obtain the target sliced data corresponding to the first processing request, wherein the first sliced data of the other edge node is the first sliced data obtained by the other edge node after processing the sliced data with the first source tag based on the received second processing request.

4. The method according to claim 3, characterized in that, After sending the second processing request to each other edge node respectively and before receiving the first sliced data of each other edge node corresponding to each other edge node, it further includes: For any one of the other edge nodes, receive the first sensitive key request sent by the any one of the other edge nodes, wherein the first sensitive key request is used to obtain the sensitive key of the edge node; Based on the first sensitive key request, determine the sensitive key of the edge node, and send the sensitive key of the edge node to the any one of the other edge nodes so that the any one of the other edge nodes uses the sensitive key of the edge node to decrypt the sensitive information in the sliced data with the first source tag, and process the decrypted sliced data with the first source tag based on the second processing request to obtain the first sliced data of the any one of the other edge nodes.

5. The method according to claim 1, wherein The method further includes: For any other edge node, receiving a third processing request of the any other edge node, where the any other edge node is an edge node in response to a fourth processing request triggered by a user; Using the public key of the any other edge node stored by the edge node, decrypting the first digital signature in the third processing request to obtain a first hash value; Performing a hash calculation on the fourth processing request in the third processing request to obtain a second hash value; Comparing the first hash value and the second hash value to obtain a comparison result, and determining whether the third processing request is a legal request based on the comparison result.

6. The method according to claim 5, wherein The determining whether the third processing request is a legal request based on the comparison result includes: If the comparison result indicates that the first hash value and the second hash value are the same, determining that the third processing request is a legal request, and processing the shard data with the second source label in the third processing request based on the third processing request to obtain the second shard data of the edge node, and sending the second shard data of the edge node to the any other edge node, where the second source label is used to represent the any other edge node that generates the shard data; If the comparison result indicates that the first hash value and the second hash value are different, determining that the third processing request is not a legal request, and generating exception information based on the third processing request, and sending the exception information to the any other edge node.

7. The method according to claim 6, characterized in that, The processing the shard data with the second source label in the third processing request to obtain the second shard data of the edge node includes: If there is encrypted sensitive information in the shard data with the second source label stored by the edge node, sending a second sensitive key request to the any other edge node, where the second sensitive key request is used to obtain the sensitive key of the any other edge node; Receiving the sensitive key of the any other edge node sent by the any other edge node after receiving the second sensitive key request; Using the sensitive key of the any other edge node to decrypt the shard data with the second source label, and processing the decrypted shard data with the second source label based on the third processing request to obtain the second shard data of the edge node.

8. The method according to claim 1, characterized in that, Before obtaining the data to be stored, it further includes: After joining the target node group, taking any adjacent edge node of the edge node as a standby edge node, where the standby edge node is an edge node for storing the shard data of the edge node; and / or Detecting that any other edge node joins the target node group, and taking any adjacent edge node of the edge node as a standby edge node.

9. The method according to claim 1, characterized in that The method further includes: When any other edge node is detected to exit the target node group, any adjacent edge node of the edge node is used as a standby edge node.

10. A data storage device, characterized in that, Including: An acquisition module, configured to acquire data to be stored; A sharding module, configured to shard the data to be stored based on the number of edge nodes in the target node group where the edge node is located, to obtain a plurality of sharded data; A determination module, configured to, for any one of the sharded data, determine target node information based on the any one of the sharded data, match the target node information with the node information of each edge node in the target node group, and determine a target edge node according to the matching result; A sending module, configured to, if the determined target edge node is another edge node, send the any one of the sharded data to the target edge node, so that the target edge node stores the any one of the sharded data.

11. An electronic device, characterized in that, Including: A memory, configured to store program instructions; A processor, configured to call the program instructions stored in the memory and execute the steps included in the method according to any one of claims 1-9 according to the obtained program instructions.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and the computer program includes program instructions, and when the program instructions are executed by a computer, the computer is caused to execute the method according to any one of claims 1-9.

13. A computer program product, characterized in that, The computer program product includes: computer program code, and when the computer program code runs on a computer, the computer is caused to execute the method according to any one of claims 1-9 above.

Citation Information

Patent Citations

  • Method and apparatus for distributed data storage

    CN114442912A

  • Data file storage method and device and electronic equipment

    CN116962428A

  • Power grid data management method and device, computer equipment and storage medium

    CN118096430A