OpenHarmony-based Data Transmission Method and Platform
By using distributed soft bus technology, zero-knowledge proof mechanism, dynamic routing table, Reed-Solomon encoding and business migration strategies in OpenHarmony system, the system's low data transmission efficiency and insufficient security in complex network environments is solved, and efficient and reliable data transmission and resource scheduling are achieved.
Patent Information
- Application Number
- CN202510273598.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-10
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2045-03-10
AI Technical Summary
In complex and changing network environments, the OpenHarmony system faces the problems of low data transmission efficiency, insufficient security, and low network resource utilization, and it is difficult to adapt to diversified network interfaces and dynamically changing network conditions.
The distributed soft bus technology and zero-knowledge proof mechanism are used to realize automatic discovery and security authentication of equipment, build dynamic routing tables and update them in real time, and use Reed-Solomon encoding to slice and redundantly encode the data. The migration strategy is formulated based on service type and QoS indicators, and the efficient utilization of parallel transmission and distributed cache of multi-network interfaces is realized.
It improves the security and reliability of the system, optimizes the data transmission path, improves network resource utilization and transmission efficiency, enhances the reliability and anti-interference ability of data transmission, realizes intelligent scheduling and load balancing of resources, and improves the overall performance and user experience of the system.
Smart Images

Figure CN119788742B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data transmission, and particularly to a data transmission method and platform based on OpenHarmony. Background Art
[0002] With the rapid development of the Internet of Things and distributed systems, OpenHarmony, as an open-source distributed operating system, has been widely used in the field of intelligent devices. However, in a complex and changeable network environment, the OpenHarmony system faces problems such as low data transmission efficiency, insufficient security, and low network resource utilization. Traditional data transmission methods are difficult to adapt to diverse network interfaces and dynamic network conditions, resulting in a decline in data transmission performance and an inability to meet the requirements of real-time services.
[0003] In addition, with the rise of edge computing, a large amount of data needs to be transmitted and processed between terminal devices. However, existing data transmission methods lack the recognition and optimized processing of service types and are unable to effectively perform resource scheduling and load balancing. At the same time, in an open network environment, security authentication and data encryption between devices also face severe challenges, and traditional authentication mechanisms are difficult to meet the security requirements of distributed systems. Summary of the Invention
[0004] The present invention provides a data transmission method and platform based on OpenHarmony, which can achieve automatic device discovery and security authentication, dynamic routing optimization, intelligent data fragmentation and encoding, service-aware resource scheduling, parallel transmission of multiple network interfaces, and efficient utilization of distributed caches.
[0005] In a first aspect, the present invention provides a data transmission method based on OpenHarmony, and the data transmission method based on OpenHarmony includes:
[0006] Using the distributed soft bus technology to automatically discover network devices, and performing identity authentication on the discovered devices based on the zero-knowledge proof mechanism to obtain a list of authenticated devices;
[0007] Constructing an initial dynamic routing table according to the list of authenticated devices, and updating the dynamic routing table based on the real-time network conditions to obtain an optimized routing table;
[0008] Performing fragmentation processing on the data to be transmitted, and using Reed-Solomon coding to perform redundant coding on the data fragments to obtain encoded transmission units;
[0009] Dividing services into real-time and non-real-time categories, constructing a state space based on the terminal operating state and the optimized routing table, and formulating a service migration strategy according to the QoS metrics;
[0010] Use multiple network interfaces to perform parallel transmission on the encoded transmission unit, and dynamically adjust the data allocation ratio based on the real-time monitored interface performance and the service migration strategy;
[0011] Deploy distributed cache nodes in the network, optimize data transmission based on the optimized routing table, the service migration strategy, and the data allocation ratio, and achieve efficient data transmission and recovery.
[0012] In a second aspect, the present invention provides a data transmission platform based on OpenHarmony, and the data transmission platform based on OpenHarmony includes:
[0013] An automatic discovery module, configured to automatically discover network devices by using the distributed soft bus technology, and authenticate the discovered devices based on the zero-knowledge proof mechanism to obtain a list of authenticated devices;
[0014] A construction module, configured to construct an initial dynamic routing table according to the list of authenticated devices, and update the dynamic routing table based on the real-time network condition to obtain an optimized routing table;
[0015] An encoding module, configured to perform fragmentation processing on the data to be transmitted, and perform redundant encoding on the data fragments by using Reed-Solomon encoding to obtain an encoded transmission unit;
[0016] A formulation module, configured to classify services into real-time and non-real-time categories, construct a state space based on the terminal operating state and the optimized routing table, and formulate a service migration strategy according to the QoS metrics;
[0017] An adjustment module, configured to use multiple network interfaces to perform parallel transmission on the encoded transmission unit, and dynamically adjust the data allocation ratio based on the real-time monitored interface performance and the service migration strategy;
[0018] An optimization module, configured to deploy distributed cache nodes in the network, optimize data transmission based on the optimized routing table, the service migration strategy, and the data allocation ratio, and achieve efficient data transmission and recovery.
[0019] In a third aspect of the present invention, a computer device is provided, including: a memory and at least one processor, wherein instructions are stored in the memory; the at least one processor calls the instructions in the memory to enable the computer device to execute the above-mentioned data transmission method based on OpenHarmony.
[0020] The fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when run on a computer, cause the computer to execute the above-mentioned data transmission method based on OpenHarmony.
[0021] In the technical solution provided by the present invention, through the adoption of the distributed soft bus technology and the zero-knowledge proof mechanism, automatic discovery and secure authentication of devices are achieved, improving the security and reliability of the system and simplifying the device access process at the same time. By using the dynamic routing table and real-time network condition monitoring, the data transmission path is optimized, improving the network resource utilization rate and transmission efficiency. The Reed-Solomon coding is used to fragment and redundantly encode the data, enhancing the reliability and anti-interference ability of data transmission and reducing the risk of data loss. Based on the service type and QoS metrics, a migration strategy is formulated to achieve intelligent scheduling and load balancing of resources, improving the overall performance of the system and the user experience. Through parallel transmission of multiple network interfaces and dynamic adjustment of the data allocation ratio, network resources are fully utilized, improving the data transmission speed and stability. Distributed cache nodes are deployed and optimized to achieve efficient data transmission and rapid recovery, improving the fault tolerance and availability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0023] Figure 1 It is a schematic diagram of the steps of the data transmission method based on OpenHarmony in the embodiments of the present invention;
[0024] Figure 2 It is a schematic diagram of the structure of the data transmission platform based on OpenHarmony in the embodiments of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0025] An embodiment of the present invention provides a data transmission method and platform based on OpenHarmony. The terms "first", "second", "third", "fourth", etc. (if any) in the specification, claims and the above-mentioned drawings of the present invention are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments described here can be implemented in an order different from that illustrated or described here. In addition, the term "comprising" or "having" and any variation thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0026] For ease of understanding, the specific process of the embodiment of the present invention will be described below. Please refer to Figure 1 , an embodiment of the data transmission method based on OpenHarmony in the embodiment of the present invention includes:
[0027] Step S1: Automatically discover network devices using the distributed soft bus technology, and authenticate the discovered devices based on the zero-knowledge proof mechanism to obtain a list of authenticated devices;
[0028] It can be understood that the execution subject of the present invention can be a data transmission platform based on OpenHarmony, or a terminal or a server. Specifically, it is not limited here. The embodiment of the present invention is described by taking the server as the execution subject as an example.
[0029] Specifically, in a local area network, a device discovery request is broadcast. This request contains the unique identifier and network address information of the sending device. In this way, other devices can receive the request and return device response information. The device response information is parsed to extract the device identifier, network address, and supported service types of the responding device, and an initial device list is constructed. To ensure the authenticity and reliability of the device's identity, an elliptic curve cryptography algorithm is used to generate a public-private key pair, and the public key and a randomly generated challenge value are packaged into an authentication request and sent to the devices in the initial device list. After the device to be authenticated receives the authentication request, it returns the signature result and a new challenge value to the requesting device. The requesting device uses the previously generated public key to verify the signature result. If the verification passes, the identity of the device is confirmed to be valid. Based on the device identity confirmation result, the requesting device then uses the private key to sign the new challenge value and sends the signature result to the device that has passed the identity verification, while waiting for the device to return the verification result. When the requesting device receives the verification result returned by the device that has passed the identity verification, it confirms that the device has completed two-way identity authentication and thus identifies it as a trusted device. After the two-way identity authentication is successful, to ensure the security and privacy of data transmission, the requesting device generates a temporary session key for the device that has successfully completed the two-way identity authentication and establishes an encrypted communication channel based on this key to ensure that the information in the subsequent data transmission process is not eavesdropped on or tampered with by the outside world. At the same time, the requesting device adds the device that has successfully completed the two-way identity authentication and its corresponding temporary session key information to the list of authenticated devices. In this way, the list of authenticated devices contains the device information of all devices that have completed two-way identity authentication and have an encrypted communication channel.
[0030] Step S2: Construct an initial dynamic routing table based on the list of authenticated devices and update the dynamic routing table based on the real-time network conditions to obtain an optimized routing table;
[0031] Specifically, based on the list of authenticated devices, extract the network topology information of each device, including the device identifier, network address, and connection status between devices, etc., to construct an initial network topology graph. The initial network topology graph is a basic graph describing the connection relationship between devices, showing the positions of each device in the network and their connection conditions with each other. Perform performance evaluation on each node in the initial network topology graph. The performance evaluation includes three main indicators: the processing capacity index of the node, which characterizes the ability of the node to process data packets and execute computing tasks; the storage capacity index, which reflects the size of the space that the node can use for caching and storing data; the network interface type index, which describes the network interface types supported by the node and their bandwidth upper limits. By performing weighted calculations on the above three indicators, obtain the comprehensive performance score of each node. Use network probing technology to measure the bandwidth, latency, and packet loss rate of each link in the initial network topology graph, reflecting the quality of the network link, including the maximum bandwidth that the link can provide, the time delay of data packets transmitted on the link, and the probability of data packet loss during transmission. Based on the measurement results, calculate the link quality index and obtain the link performance score. Based on the node performance score and the link performance score, use the minimum weight path algorithm to calculate the optimal path from the source node to the target node and construct the initial dynamic routing table. The initial dynamic routing table reflects the best communication path from each source node to each target node under the current network topology structure. To optimize the routing selection during data transmission, continuously monitor the network status. By adopting a sliding window mechanism, regularly collect real-time network performance data, including bandwidth utilization, end-to-end latency, and network congestion degree, etc. The sliding window mechanism can dynamically capture short-term changes in network performance and provide timely reference data for the update of the routing table. Input the real-time network performance data into a pre-trained machine learning model. The model predicts the change trend of network performance in the short term based on the input data and generates a network performance prediction result. Based on the network performance prediction result, adjust the weights of the routing entries in the initial dynamic routing table. Use the dynamic programming algorithm to recalculate the optimal path from the source node to the target node and update the path in the routing table according to the new calculation results. Each routing entry is accompanied by a latest update timestamp, which is used to record the most recent update time of the entry, and finally obtain the optimized routing table.
[0032] Step S3: Fragment the data to be transmitted and perform redundant encoding on the data fragments using Reed-Solomon encoding to obtain the encoded transmission unit;
[0033] Specifically, perform data feature analysis on the data to be transmitted, extract information such as the total size, data type, and priority of the data, and generate a data feature vector. At the same time, combine the current network conditions, including indicators such as network bandwidth, latency, and packet loss rate, and use an adaptive algorithm to calculate the optimal fragmentation size and determine the fragmentation parameters. Divide the data to be transmitted according to the fragmentation parameters, and split the entire data into several data segments. To ensure that each data segment can be accurately identified and processed during transmission, assign a unique serial number to each data segment and calculate its checksum to form an initial data segment set. The initial data segment set contains all the split data segments and their corresponding meta-information. Perform Reed-Solomon encoding on each data segment in the initial data segment set. Reed-Solomon encoding is an error-correcting coding technique that enhances the error resistance of data by generating redundant data blocks. During the encoding process, each initial data segment will generate several redundant data blocks, and these redundant data blocks together with the original data segment form the encoded data segment. To optimize the number of redundant data, according to the current network quality indicators, use a dynamic redundancy adjustment algorithm to calculate the optimal redundancy and determine the redundancy parameters. The reasonable setting of the redundancy parameters can achieve a balance between data reliability and transmission efficiency, minimizing the transmission volume of redundant data while ensuring data integrity. According to the calculated redundancy parameters, generate redundant data for the encoded data segments to obtain data segments with redundancy protection, making them have a high fault tolerance during transmission, and being able to effectively recover lost or damaged data segments even in poor network conditions. Package the data segments with redundancy protection into individual transmission units. Each transmission unit contains an original data segment and its corresponding redundant data, as well as the unique serial number and checksum of the segment. To improve the accuracy and efficiency of data management, construct a transmission unit mapping table to record the location information of the original data corresponding to each transmission unit, that is, the location of each transmission unit in the overall data structure and all the associated information, and finally obtain the encoded transmission units.
[0034] Step S4: Classify the services into real-time and non-real-time categories, construct a state space based on the terminal operating state and the optimized routing table, and formulate a service migration strategy according to the QoS indicators;
[0035] Specifically, conduct feature analysis on the services in the OpenHarmony system. By analyzing the type, priority, and resource requirement information of each service, the services are effectively divided into two categories: real-time services and non-real-time services. Real-time services are usually sensitive to latency, such as video calls or online games. Such services have strict requirements for network stability and low latency. Non-real-time services are not sensitive to latency, such as file transfer or data backup, etc., and pay more attention to transmission reliability and bandwidth utilization. Based on the optimized routing table, calculate the network distance from each terminal to the server to obtain the terminal-server distance matrix, which describes the connection quality between each terminal and the server, including key indicators such as latency, bandwidth, and packet loss rate. At the same time, real-time monitor parameters such as the CPU usage rate, memory occupancy rate, and storage space utilization rate of each terminal to construct a terminal resource status vector, which reflects the current hardware resource usage of each terminal. Combine the terminal-server distance matrix and the terminal resource status vector to construct a multi-dimensional state space model. In this model, each terminal is not only a network node but also a resource node. The distance between it and the server in the network and its resource utilization jointly determine its overall state. Based on the multi-dimensional state space model, formulate corresponding QoS (Quality of Service) index evaluation functions for different types of services, including two key indicators: available rate and latency. Through these QoS evaluation functions, give a comprehensive service QoS score to each service in the current state, quantitatively describing the quality and efficiency of the current service operation. Based on the multi-dimensional state space model and the service QoS score, use the reinforcement learning algorithm to train a service migration strategy model. The reinforcement learning algorithm can find the optimal policy path in the complex state space through continuous exploration and learning. During the training process, the algorithm learns the method of making optimal service migration decisions in different situations according to different state combinations and service scores, forming a general policy model. After the policy model training is completed, calculate the operation efficiency of each service on the current terminal and potential target terminals. The calculation of the operation efficiency takes into account not only factors such as the current network latency, bandwidth, and packet loss rate, but also factors such as computing power, storage capacity, and resource occupancy. Through calculation, obtain the service migration benefit matrix, which quantifies the potential benefits of each service migrating between different terminals. Input the service migration benefit matrix into the trained service migration strategy model. The model comprehensively considers the current network conditions and the resource status of each terminal, calculates the optimal migration plan for each service, and obtains the service migration strategy table. This strategy table can be dynamically adjusted to respond in real time to changes in network conditions and resource status, ensuring that the optimal service operation plan can be provided under various network conditions.
[0036] Step S5: Use multiple network interfaces to perform parallel transmission on the encoded transmission units, and dynamically adjust the data allocation ratio based on the real-time monitored interface performance and service migration strategy;
[0037] Specifically, scan all network interfaces supported by the device to identify all available network interface types, including different types such as Wi-Fi, cellular network, Bluetooth, etc. Each type of network interface has different performance characteristics and usage scenarios. Based on the network interface information obtained through scanning, construct a network interface list containing all available interfaces. Perform a performance evaluation on each interface in this network interface list. The evaluation metrics include aspects such as bandwidth, latency, stability, and energy consumption. By measuring the bandwidth, understand the maximum data transfer speed that each interface can support; by measuring the latency, judge the length of time from data transmission to reception; and stability involves the reliability performance of the interface during long-term use; the energy consumption metric reflects the power consumption of the interface on the device during the working state. Based on these measurement data, obtain the performance metric set for each interface. Use the fuzzy comprehensive evaluation method to calculate the transmission weight for each interface. The fuzzy comprehensive evaluation method can comprehensively consider multiple fuzzy factors to obtain the transmission weight value of each network interface in different situations. The calculated transmission weight value reflects the importance and priority of each network interface in data transmission. Based on the transmission weight value, form an initial interface weight allocation scheme. According to this scheme, reasonably allocate the data segments in the encoded transmission unit according to the weights of each interface. The data segments in the transmission unit are allocated to different network interfaces for parallel transmission, so as to make full use of the multiple network resources of the device and improve the data transmission efficiency. Real-time monitor the transmission performance of each network interface. The performance data for real-time monitoring includes throughput, response time, and error rate, etc. Throughput reflects the actual amount of data transmitted by each interface per unit time, the response time refers to the time required from the data request being sent to receiving a response, and the error rate indicates the frequency of data errors during transmission. By real-time monitoring these data, understand the current performance of each interface. Integrate the real-time interface performance data with the service migration strategy to construct a dynamic weight adjustment model. This model can combine the real-time monitoring data and service requirements to dynamically adjust the transmission weights of each interface and generate an interface-service weight matrix. Based on the interface-service weight matrix, use an adaptive load balancing algorithm to calculate the new data allocation ratio. The adaptive load balancing algorithm can dynamically adjust the data allocation scheme according to the changes in real-time data and the weight matrix. After obtaining the updated data allocation scheme, adjust the actual data transmission volume of each network interface according to the new allocation scheme. For the data segments with transmission failures, trigger the intelligent retransmission mechanism to automatically select the currently best-performing network interface for retransmission to ensure the integrity and reliability of data transmission. At the same time, dynamically adjust the data allocation ratio according to the changes in interface performance during the transmission process to effectively cope with the fluctuations and changes in the network state and ensure the stability and efficiency of data transmission.
[0038] Step S6: Deploy distributed cache nodes in the network, optimize data transmission based on the optimized routing table, service migration strategy, and data allocation ratio, and achieve efficient data transmission and recovery.
[0039] Specifically, analyze the network topology structure based on the optimized routing table to identify key nodes and data transmission hotspots in the network. Key nodes are nodes with concentrated data traffic and a large number of connected devices, while data transmission hotspots are areas with frequent data interactions. Perform performance evaluations on each candidate distributed cache node. The main evaluation metrics include storage capacity, processing power, and network connection quality, etc. Storage capacity determines the amount of data that a cache node can store, processing power affects the transmission and processing efficiency of data between nodes, and network connection quality determines the data transmission speed and stability between a node and other nodes. Through comprehensive consideration of the performance evaluation metrics, obtain the performance metric set of each cache node. According to the performance metric set of the cache nodes and the current service migration strategy, use a heuristic algorithm to calculate the association relationship between cache nodes and devices. The heuristic algorithm can flexibly determine which devices each cache node should serve and which data caching tasks it should undertake based on various factors such as the capabilities of cache nodes, the locations of devices, and service requirements, and obtain a cache node allocation plan, which describes the specific data caching tasks and service scopes of each cache node. Based on the cache node allocation plan, allocate the data to be transmitted to the corresponding distributed cache nodes according to the pre-set data allocation ratio. Each cache node is not only responsible for data storage and transmission tasks within its scope but can also relieve the transmission pressure on the network to a certain extent and improve the efficiency and stability of overall data transmission. Perform redundant backups on the data distributed on each cache node. Use the consistent hashing algorithm to determine the specific distribution of data among cache nodes. Through the consistent hashing algorithm, ensure the uniform distribution of data among multiple cache nodes and achieve redundant storage of data. At the same time, to ensure the effectiveness of data redundant distribution, continuously monitor the storage status and network connection quality of each cache node and obtain the performance data of cache nodes in real time. Combine the real-time cache performance data with the current service migration strategy and use the dynamic programming algorithm to optimize the distribution of data among cache nodes. The dynamic programming algorithm can maximize the efficiency of data transmission while ensuring data reliability through global optimization of the data distribution plan. Based on the optimization results, generate an updated data distribution plan and re-allocate the cached data according to the new plan. During the data re-allocation process, if it is found that some data fragments are lost or damaged during transmission between cache nodes, the Reed-Solomon coding technique is used for data recovery. Reed-Solomon coding is an error-correcting coding method that can recover lost or damaged data fragments through redundant information and ensure the integrity and reliability of data.
[0040] In the embodiments of the present invention, through the adoption of the distributed soft bus technology and the zero-knowledge proof mechanism, automatic device discovery and secure authentication are achieved, improving the security and reliability of the system, and at the same time simplifying the device access process. By using the dynamic routing table and real-time network status monitoring, the data transmission path is optimized, improving the network resource utilization rate and transmission efficiency. The Reed-Solomon coding is used to fragment and redundantly encode the data, enhancing the reliability and anti-interference ability of the data transmission and reducing the risk of data loss. Based on the service type and QoS metrics, a migration strategy is formulated to achieve intelligent resource scheduling and load balancing, enhancing the overall performance of the system and the user experience. Through parallel transmission of multiple network interfaces and dynamic adjustment of the data allocation ratio, network resources are fully utilized, improving the data transmission speed and stability. Distributed cache nodes are deployed and optimized to achieve efficient data transmission and fast recovery, enhancing the fault tolerance and availability of the system.
[0041] In a specific embodiment, the process of executing step S1 may specifically include the following steps:
[0042] Broadcast a device discovery request within the local area network. The device discovery request includes the unique identifier and network address information of the sending device, and obtain the device response information;
[0043] Parse the device response information, extract the device identifier, network address, and supported service types of the responding device, and construct an initial device list;
[0044] Generate a public-private key pair using the elliptic curve cryptography algorithm, pack the public key and a randomly generated challenge value into an authentication request, send it to the devices in the initial device list, receive the signature result and a new challenge value returned by the device to be authenticated, and verify the signature result using the corresponding public key to obtain the device identity confirmation result;
[0045] Based on the device identity confirmation result, sign the new challenge value using the private key, send the signature result to the device that has passed the authentication, and receive the verification result returned by the device that has passed the authentication to confirm the device that has successfully completed the two-way identity authentication;
[0046] Generate a temporary session key for the device that has successfully completed the two-way identity authentication, establish an encrypted communication channel, and add the device that has successfully completed the two-way identity authentication and its corresponding temporary session key information to the list of authenticated devices to obtain the list of authenticated devices.
[0047] Specifically, broadcast a device discovery request within the local area network. The device discovery request contains the unique identifier and network address information of the sending device. The unique identifier is the MAC address or device ID of the device, used to uniquely identify the device; while the network address information is the IP address or other reachable information of the device in the local area network currently. When other devices in the local area network receive the device discovery request, they decide whether to respond according to their own status, and send device response information when responding. The device response information includes the device identifier, network address, and supported service types of the responding device. The device identifier is used to identify the identity of the responding device, the network address is used for subsequent communication connections, and the supported service types describe the functions or services that the device can provide. Analyze the received device response information, extract key information such as the device identifier, network address, and supported service types from it, and construct an initial device list, which contains all the devices in the current network that have responded to the device discovery request and their related information, as the basic data for subsequent identity authentication. To ensure the security of communication between devices, authenticate the devices in the initial device list. During the identity authentication process, use the elliptic curve cryptography algorithm to generate a public-private key pair. The elliptic curve cryptography algorithm is an encryption algorithm based on the elliptic curve discrete logarithm problem, which can provide high-intensity security with a relatively short key length. Set the elliptic curve as mod where and are the parameters of the elliptic curve, is a large prime number, used to define the finite field. Assume that a point on the elliptic curve is selected as the base point, and the public key is calculated through the private key , where the calculation formula for the public key is:
[0048] ;
[0049] where is the randomly generated private key, is the base point on the elliptic curve, is the calculated public key. At this time, the private key is only retained in the local device, while the public key is publicly used for encrypted communication. After generating the public-private key pair, pack the public key and a randomly generated challenge value into an authentication request. The challenge value is a randomly generated number, used to prevent replay attacks, and it is sent to the devices in the initial device list together with the public key. When the devices in the initial device list receive the authentication request, use the public key and the challenge value Calculate the signature and return the signature result and a new challenge value to the sending device. The formula for calculating the signature result is:
[0050] mod ;
[0051] where is the hash value obtained by performing a hash calculation on the challenge value , and is the order of the elliptic curve. The signature result is used to verify the authenticity of the identity of the sending device. After receiving the signature result and the new challenge value from the device to be authenticated, the sending device uses the corresponding public key to verify the signature result. If the verification is successful, it indicates that the identity of the device to be authenticated has been confirmed. Based on the device identity confirmation result, the sending device uses its own private key to sign the new challenge value and returns the signature result to the device that has passed the identity verification. By performing a hash operation on the new challenge value and then calculating the signature result according to the private key. After the device to be authenticated receives the signature result , it uses the received public key to verify the signature result. If the verification passes, it confirms that the identity of the sending device is also trustworthy, thus completing the two-way identity authentication. After completing the two-way identity authentication, in order to ensure the security of subsequent communications, a temporary session key is generated for the devices that have successfully completed the two-way identity authentication. The generation of the temporary session key is achieved through the Diffie-Hellman key exchange protocol. Both parties calculate a shared session key based on their respective private keys and the public key of the other party. The specific calculation formula is:
[0052] ;
[0053] where is the private key of the sending device, is the public key of the device to be authenticated, and the calculated is the shared session key, which is used for the encryption of subsequent communications. After generating the temporary session key, the sending device adds the devices that have successfully completed the two-way identity authentication and their corresponding temporary session key information to the list of authenticated devices to obtain the final list of authenticated devices. This list contains all the devices that have passed the identity authentication and their corresponding session key information, ensuring secure data transmission between these devices through an encrypted communication channel.
[0054] In a specific embodiment, the process of executing step S2 may specifically include the following steps:
[0055] Extract the network topology information of each device based on the authenticated device list, including device identifiers, network addresses, and connection statuses, and construct an initial network topology map;
[0056] Perform a performance evaluation on each node in the initial network topology map, calculate the processing capacity index, storage capacity index, and network interface type index of the node, and obtain the node performance score;
[0057] Use network probing technology to measure the bandwidth, latency, and packet loss rate of each link in the initial network topology map, calculate the link quality index, and obtain the link performance score;
[0058] Based on the node performance score and the link performance score, calculate the minimum weight path from the source node to the target node, construct an initial dynamic routing table;
[0059] Adopt a sliding window mechanism to continuously monitor the network status, and regularly collect real-time network performance data, including bandwidth utilization rate, end-to-end latency, and congestion level;
[0060] Input the real-time network performance data into a pre-trained machine learning model to predict the short-term network performance change trend and obtain the network performance prediction result;
[0061] Based on the network performance prediction result, adjust the weights of the routing entries in the initial dynamic routing table, use the dynamic programming algorithm to recalculate the optimal path, update the recalculated optimal path to the dynamic routing table, and set the update timestamp to obtain an optimized routing table.
[0062] Specifically, the network topology information of each device is extracted from the list of certified devices, including the device identifier, network address, and connection status. The device identifier is the unique ID or MAC address of the device, which is used to identify the uniqueness of the device; the network address is usually the IP address of the device, which is used to determine the location of the device in the network; and the connection status describes the connection between the device and other devices, such as whether it is connected through a wired or wireless network, or whether there are multiple network interfaces. By extracting this information, an initial network topology diagram containing all certified devices is constructed to show the connection relationship between the devices in the network. The performance of each node in the initial network topology diagram is evaluated. The performance evaluation includes three indicators: processing power index, storage capacity index, and network interface type index. The processing power index reflects the computing power of the device and is quantified based on factors such as the device's CPU performance and available computing resources. The storage capacity index describes the storage capacity of the device, including the size of the available storage space and the read and write speed of the storage device. The network interface type index measures the network interface types supported by the device and their bandwidth limits. For example, if a device supports Wi-Fi 6 and 5G network interfaces, its network interface type index will be higher. Each indicator is assigned a weight value to indicate the importance of the indicator in the comprehensive performance score. Assume that the processing power index, storage capacity index, and network interface type index are , and , and their weights are , and , then the comprehensive performance score of the node Calculated by the following formula:
[0063] ;
[0064] in, , and It needs to be set according to the specific application scenario and meet the In this way, the performance scores of each node in the initial network topology map are obtained to quantify the overall performance level of each node. By adopting network probing technology, the performance of each link in the network topology map is evaluated. For each link, parameters such as its bandwidth, latency, and packet loss rate are measured to evaluate the quality of the link. Bandwidth reflects the data transmission capacity that the link can carry, latency refers to the time for data to be transmitted on the link, and the packet loss rate indicates the loss situation of data during transmission. Based on these measurement data, the quality index of the link is calculated to obtain the performance score of each link. Based on the performance scores of all nodes and links, the minimum-weight path from the source node to the target node in the network is calculated. Using the weighted shortest path algorithm, the optimal path between each pair of source nodes and target nodes is found, and based on this, the initial dynamic routing table is constructed to record the optimal path selection of each node to other nodes, including all node and link information on the path. The network condition is continuously monitored. The sliding window mechanism is adopted to effectively capture the changes in network performance. By regularly collecting real-time network performance data, including bandwidth utilization, end-to-end latency, and network congestion level, etc., the current state changes of the network can be timely reflected. The sliding window mechanism can retain the latest network state data within a limited time window, enabling the system to consider the recent data changes during calculation without being interfered by outdated information. The real-time network performance data is input into a pre-trained machine learning model to predict the short-term network performance change trend. This machine learning model is a time-series-based prediction model, such as LSTM (Long Short-Term Memory Network) or ARIMA (Autoregressive Integrated Moving Average Model). By learning from historical data, the model can predict the change trends of network bandwidth, latency, and congestion level in the future for a period of time to obtain the network performance prediction result. Based on the network performance prediction result, the weights of the routing entries in the initial dynamic routing table are adjusted. The dynamic programming algorithm is used to recalculate the optimal path, considering the current network state and future performance change trends, and select the path that is most likely to provide the best transmission effect. For each updated path entry, its new weight information and update timestamp are recorded for preferential reference in future routing selections. This enables the system to timely respond to the changes in network conditions, continuously optimize routing selections, and generate a dynamically updated optimized routing table.
[0065] In a specific embodiment, the process of executing step S3 may specifically include the following steps:
[0066] Perform data feature analysis on the data to be transmitted, extract the total data size, data type, and priority information to obtain a data feature vector, and based on the data feature vector and the current network condition, use an adaptive algorithm to calculate the optimal fragmentation size to obtain fragmentation parameters;
[0067] Split the data to be transmitted according to the sharding parameters, assign a unique sequence number and checksum to each data segment, and obtain the initial data segment set;
[0068] Perform Reed-Solomon encoding on each data segment in the initial data segment set to generate redundant data blocks, obtain the encoded data segments, and calculate the optimal redundancy based on the current network quality metrics using a dynamic redundancy adjustment algorithm to obtain the redundancy parameter;
[0069] Generate redundant data for the encoded data segments according to the redundancy parameter to obtain data segments with redundancy protection;
[0070] Pack the data segments with redundancy protection into transmission units, each transmission unit containing the original data segment, redundant data, sequence number, and checksum, and construct a transmission unit mapping table to record the original data position information corresponding to each transmission unit to obtain the encoded transmission units.
[0071] Specifically, perform data feature analysis on the data to be transmitted, and extract the basic attributes and transmission requirement information of the data. Data features include the total size of the data, data type, and priority information of the data. The total size of the data is usually in bytes, representing the size of the entire data packet; the data type is video, audio, text, etc., and they have different requirements for transmission real-time and reliability; the priority information determines the priority order during data transmission, and data with higher priority needs to be transmitted first when network resources are scarce. By extracting this information and combining it into a data feature vector, assuming the total size of the data is 、the data type is 、the priority information is ,then the data feature vector is expressed as 。Based on the data feature vector and the current network condition information, use an adaptive algorithm to calculate the optimal sharding size. The choice of sharding size will directly affect the efficiency and reliability of data transmission. If the sharding size is too large, when a single data segment is lost or damaged during transmission, a large amount of data needs to be retransmitted; while if the sharding size is too small, it will increase the transmission overhead and time. The adaptive algorithm needs to comprehensively consider data features and network conditions to determine the optimal sharding size. Assume the network condition vector ,where represents the current available bandwidth, represents the network delay, represents the packet loss rate. The sharding size is calculated through the following formula:
[0072] ;
[0073] where, and They are the weight coefficients of each factor, used to adjust the influence weights of data characteristics and network conditions in the calculation of shard size. A shard size that balances data characteristics and network conditions is calculated through this formula, and shard parameters are obtained. . The data to be transmitted is segmented according to the shard parameters, and the entire data is segmented into several data segments. A unique serial number is assigned to each data segment, and its checksum is calculated. The serial number is used to identify the order of the data segments, and the checksum is a check value obtained by processing the content of the data segment through a specific algorithm, used to detect the integrity of the data segment during transmission. For example, the CRC (Cyclic Redundancy Check) algorithm is used to calculate the checksum, obtaining the initial data segment set, and each data segment contains information such as data content, serial number, and checksum. Each data segment in the initial data segment set is subjected to Reed - Solomon coding. Reed - Solomon coding is an error - correcting coding technique that increases the redundancy of data by generating redundant data blocks, improving the reliability of data transmission. Assume that the original data length of each data segment is , and data blocks are generated through Reed - Solomon coding, where , which means that during transmission, even if up to data blocks are lost, the original data can still be recovered through the remaining data blocks. According to the current network quality indicators, such as packet loss rate and bandwidth utilization, the redundancy is dynamically adjusted, and the optimal redundancy parameter is calculated. Assume that the current redundancy is , that is, the proportion of redundant data blocks in the total data blocks generated by each data segment is r / k. The selection of the redundancy parameter is determined by the dynamic redundancy adjustment algorithm, which dynamically adjusts according to the changes in the current network packet loss rate and transmission delay , for example:
[0074] ;
[0075] where, and are the weight coefficients for redundancy adjustment. By dynamically adjusting , the overhead of redundant data is reduced while ensuring the reliability of data transmission. According to the calculated redundancy parameter , redundant data is generated for the encoded data segments to obtain data segments with redundancy protection. The data segments with redundancy protection are packed into individual transmission units. Each transmission unit contains information such as the original data segment, redundant data, sequence number, and checksum. To be able to correctly restore the transmitted data at the receiving end, a transmission unit mapping table is constructed to record the correspondence between each transmission unit and the position of the original data, including the sequence number of the data segment, the position of the original data, and the checksum information, etc. Through the transmission unit mapping table, the receiving end can accurately map the received transmission units back to the positions of the original data, thus achieving the accurate restoration of the data.
[0076] In a specific embodiment, the process of executing step S4 may specifically include the following steps:
[0077] Conduct feature analysis on the services in the OpenHarmony system, extract service type, priority, and resource requirement information, and classify the services into two categories: real-time and non-real-time;
[0078] Based on the optimized routing table, calculate the network distance from each terminal to the server to obtain the terminal-server distance matrix, and monitor the hardware resources of each terminal to obtain the CPU usage rate, memory occupancy rate, and storage space utilization rate, and construct a terminal resource status vector;
[0079] Combine the terminal-server distance matrix and the terminal resource status vector to construct a multi-dimensional state space model, and formulate a QoS metric evaluation function for each type of service, including two key metrics: available rate and latency, to obtain the service QoS score;
[0080] Based on the multi-dimensional state space model and the service QoS score, use the reinforcement learning algorithm to train the service migration strategy model;
[0081] Calculate the running efficiency of each service on the current terminal and potential target terminals, considering factors such as network latency, computing power, and storage capacity, to obtain the service migration benefit matrix, and input the service migration benefit matrix into the service migration strategy model to calculate the optimal migration plan to obtain the service migration strategy table.
[0082] Specifically, conduct feature analysis on the services in the OpenHarmony system, and extract key service attributes from each service. The features of each service mainly include service type, priority, and resource requirement information. The service type is used to describe the nature of the service, such as video conferencing, real-time messaging, file downloading, etc. According to the different service types, services are divided into two categories: real-time services and non-real-time services. Real-time services (such as video conferencing and voice calls) have very strict requirements for latency and usually need to complete data transmission and processing within milliseconds to ensure a good user experience; while non-real-time services (such as file transfer and software update) are not sensitive to latency and pay more attention to transmission reliability and resource utilization. The priority information indicates the importance of the service in resource competition. For example, some important services are set to high priority so that they can be processed first when resources are scarce. The resource requirement information describes the amount of system resources required by the service during operation, including the required CPU computing power, memory occupancy, and storage space, etc. Calculate the network distance from each terminal to the server based on the optimized routing table to obtain the terminal-server distance matrix. The network distance is measured by parameters such as latency and hop count. Assume that there are terminals and servers in the network, then the dimension of the terminal-server distance matrix is , where represents the network distance between the th terminal and the th server. This distance matrix can intuitively reflect the network connection quality between each terminal and the server. At the same time, monitor the hardware resource status of each terminal in real time. The resource status of the terminal includes indicators such as CPU usage rate, memory occupancy rate, and storage space utilization rate. Assume that the CPU usage rate of a certain terminal is , the memory occupancy rate is , and the storage space utilization rate is , then the resource status vector of this terminal is expressed as . The resource status vector can comprehensively describe the resource usage of the terminal at the current moment and help the system determine whether the terminal is suitable for carrying new services or migrating existing services. Combine the terminal-server distance matrix with the terminal resource status vector Combined, a multi-dimensional state space model is constructed. This model takes into account both the network conditions between each terminal and the server and the hardware resource status of the terminal, generating a state description for each combination of terminal and server. Based on the multi-dimensional state space model, a QoS (Quality of Service) metric evaluation function is formulated for each type of service. The QoS evaluation function is used to quantify the service quality level of the service in the current state, including two key metrics: available rate and latency. The available rate represents the maximum data transfer rate that the current service can achieve in the network, while the latency represents the time between the service request and the response. Suppose the available rate of a certain service in the current state is , and the latency is , then the QoS score of this service is calculated by the following formula:
[0083] ;
[0084] where and are the weight coefficients of the available rate and latency respectively, representing the relative importance of each metric in the QoS score. In this way, the QoS score of each service in the current state is calculated, thereby measuring its service quality level. Based on the multi-dimensional state space model and the service QoS score, a service migration strategy model is trained using the reinforcement learning algorithm. The reinforcement learning algorithm can gradually optimize the service migration strategy by continuously exploring and learning in different states, so as to make the optimal decision when encountering similar scenarios in the future. The algorithm tries different migration strategies in different states, observes their impacts on the overall system performance, and rewards or punishes them according to the effects of the strategies, gradually adjusting the parameters of the strategy model to find the optimal service migration strategy. After the service migration strategy model is trained, the running efficiency of each service on the current terminal and potential target terminals is calculated. The calculation of the running efficiency needs to comprehensively consider multiple factors such as network latency, computing power, and storage capacity. Suppose the running efficiency of a certain service on the current terminal is , and the running efficiency on the potential target terminal is , then the migration benefit of this service in the current state is expressed as:
[0085] ;
[0086] where is the migration benefit of the service, and are the running efficiencies of the target terminal and the current terminal respectively, For the cost of service migration, including the overhead of data transmission and the possible service interruption time. By calculating the migration benefits of each service between different terminals, a service migration benefit matrix is obtained, which describes the migration benefits of each service between different terminals. The service migration benefit matrix is input into the service migration strategy model, and the model calculates the optimal service migration plan according to the current state and the benefit matrix, obtaining a service migration strategy table, which records the target terminal that each service is most suitable to migrate to in the current state, as well as the expected benefits and service quality improvement after migration.
[0087] In a specific embodiment, the process of executing step S5 may specifically include the following steps:
[0088] Scan the network interfaces supported by the device, identify the available network interface types, obtain a network interface list, and based on the network interface list, evaluate the performance of each interface, measure the bandwidth, latency, stability, and energy consumption metrics, obtaining an interface performance metric set;
[0089] According to the interface performance metric set, use the fuzzy comprehensive evaluation method to calculate the transmission weight of each interface, obtaining an initial interface weight allocation plan, and based on the initial interface weight allocation plan, allocate the encoded transmission units, and allocate the data segments to different network interfaces;
[0090] Real-time monitor the transmission performance of each network interface, including throughput, response time, and error rate, obtain real-time interface performance data, and fuse the real-time interface performance data with the service migration strategy to construct a dynamic weight adjustment model, obtaining an interface-service weight matrix;
[0091] Based on the interface-service weight matrix, use the adaptive load balancing algorithm to calculate the new data allocation ratio, obtaining an updated data allocation plan, and according to the updated data allocation plan, dynamically adjust the data transmission volume of each network interface, and perform intelligent retransmission on the data segments with transmission failures, and dynamically adjust the data allocation ratio.
[0092] Specifically, scan the network interfaces supported by the device to identify all available network interface types, including Wi-Fi, Ethernet, Bluetooth, cellular networks (such as 4G or 5G), etc. Each interface type has different characteristics in terms of data transmission bandwidth, latency, stability, and energy consumption. By identifying the interface types, a complete list of network interfaces is obtained, which contains information such as the type of each interface, the current status (connected or enabled), and the interface address (such as MAC address or IP address). Perform a performance evaluation on each network interface. The performance evaluation metrics include bandwidth, latency, stability, and energy consumption. Bandwidth refers to the amount of data that can be transmitted by a network interface per unit time, usually measured in Mbps or Gbps; latency refers to the time interval from the sender to the receiver of the data, usually measured in milliseconds (ms); stability reflects the connection quality of the network interface during long-term operation, and is measured by indicators such as the number of connection disconnections or jitter; energy consumption refers to the consumption of the device's battery by the interface in the working state, usually expressed in watts (W). Calculate the performance score P of each interface through the formula:
[0093] ;
[0094] where, is the actual bandwidth of the interface, is the latency of the interface, is the jitter of the interface, is the energy consumption of the interface, 、 、 and are the maximum bandwidth, maximum latency, maximum jitter, and maximum energy consumption that can be achieved in the system, respectively. The weight coefficients 、 、 and respectively represent the importance of bandwidth, latency, jitter, and energy consumption in the performance score. Through the formula, the comprehensive performance score of each network interface is obtained, and the score information is integrated into the interface performance metric set. When obtaining the performance metric set of each network interface, the fuzzy comprehensive evaluation method is used to calculate the transmission weight of each interface. The fuzzy comprehensive evaluation method is a multi-factor decision-making method that combines the weights of multiple fuzzy factors to obtain a comprehensive evaluation result. To apply the fuzzy comprehensive evaluation method, membership functions are set for the performance metrics of each interface. The membership function maps the values of each metric to an interval of [0, 1], indicating the fuzzy membership degree of the metric at a specific value. According to the membership degree values and weight coefficients of each metric, the transmission weight of each network interface is calculated to obtain the initial interface weight allocation scheme. This scheme assigns the weight value of each network interface to the corresponding interface to guide the subsequent allocation of data segments. Based on the initial interface weight allocation scheme, the encoded data segments are allocated to different network interfaces for transmission. During the data allocation process, the data segments are proportionally allocated to each interface according to the weight value of each interface, maximizing the utilization of the device's multi-network interface resources and improving the efficiency and stability of data transmission. Suppose there are network interfaces, the weight of each interface is , the number of encoded data segments is , then the number of data segments allocated to the th interface is:
[0095] ;
[0096] where, round represents the rounding operation to ensure integer allocation of data segments. Each interface is allocated the corresponding data segments according to the proportion of its performance weight and starts parallel transmission. To adjust the data allocation strategy in real time, the transmission performance of each network interface is continuously monitored. The main monitoring metrics include throughput, response time, and error rate. Throughput refers to the amount of data actually transmitted by each interface per unit time, usually measured in Mbps; the response time is the time interval from the data request being sent to the response being received; the error rate reflects the packet loss or data corruption situation during data transmission. By monitoring these performance data in real time, the current status and transmission performance of each network interface are understood. The real-time interface performance data is combined with the current service migration strategy to build a dynamic weight adjustment model. This model dynamically adjusts the weight values of each interface by comprehensively considering the real-time performance of the interface and the requirements of the service, generating an interface-service weight matrix. Suppose the requirements of the service for different performance metrics are represented by the vector , and the real-time interface performance is represented by the vector , then the element in the interface-service weight matrix Expressed as:
[0097] ;
[0098] Wherein, represents the adaptation degree of the th interface to the th service. Through this matrix, the adaptation degree of each service on each interface is judged. Based on the interface-service weight matrix, an adaptive load balancing algorithm is used to calculate the new data allocation ratio. The adaptive load balancing algorithm dynamically adjusts the data allocation strategy by analyzing the changes in the transmission performance of each interface in real time, so as to achieve the purpose of balancing the load and maximizing the utilization of network resources. The adaptive load balancing algorithm calculates the optimal data allocation ratio in the current state according to the real-time transmission performance data of each interface, and dynamically adjusts the data transmission volume of each interface according to this ratio. Assuming that in the adjusted allocation scheme, the new data allocation ratio is , then the number of data segments allocated to the th interface is:
[0099] round ;
[0100] Through dynamic adjustment, it can effectively cope with the changes in the network state and ensure the stability and efficiency of data transmission. For the data segments lost or damaged during the transmission process, an intelligent retransmission mechanism is triggered. The intelligent retransmission mechanism selects the optimal interface to retransmit the lost data segments according to the performance state of the current interface. Assuming that at a certain moment, the packet loss rate of interface 1 is relatively high, while the performance of interface 2 and interface 3 is relatively stable, then the intelligent retransmission mechanism will preferentially select interface 2 or interface 3 for the retransmission operation of data segments. At the same time, according to the retransmission results and real-time interface performance data, the data allocation ratio is adjusted to avoid the decline of data transmission efficiency due to the poor performance of a certain interface.
[0101] In a specific embodiment, the process of executing step S6 may specifically include the following steps:
[0102] Based on the optimized routing table, analyze the network topology structure, identify key nodes and data transmission hotspots, determine the deployment locations of distributed cache nodes, and perform performance evaluation on the distributed cache nodes, calculate the storage capacity, processing ability and network connection quality, and obtain the cache node performance index set;
[0103] According to the cache node performance index set and the service migration strategy, use a heuristic algorithm to calculate the association relationship between the cache nodes and the devices, obtain the cache node allocation scheme, and based on the cache node allocation scheme, allocate the data to be transmitted to the corresponding distributed cache nodes according to the data allocation ratio;
[0104] Perform redundant backup on the data distributed on cache nodes, use the consistent hashing algorithm to determine the distribution of data among cache nodes, obtain a data redundant storage scheme, and continuously monitor the storage status and network connection quality of cache nodes to obtain real-time cache performance data;
[0105] Combine the real-time cache performance data with the service migration strategy, use the dynamic programming algorithm to optimize the distribution of data among cache nodes, obtain an updated data distribution scheme, reallocate the cache data based on the updated data distribution scheme, and use Reed-Solomon coding to recover lost or damaged data to ensure the integrity and reliability of the data.
[0106] Specifically, the optimized routing table contains the best path information between each node and other nodes, including key parameters such as the bandwidth, latency, and hop count between nodes. Through comprehensive analysis of this information, key nodes and data transmission hotspots in the network are identified. Key nodes are the concentration points of data traffic and undertake a large number of forwarding tasks; while data transmission hotspots are areas where data interactions are frequent and are important reference bases for deploying cache nodes. Identifying key nodes and data transmission hotspots determines the deployment locations of distributed cache nodes. The deployment locations of cache nodes need to comprehensively consider the network topology structure, data traffic distribution, and the load capacity of nodes to ensure that cache nodes can effectively share data traffic and improve the overall data transmission efficiency. Perform performance evaluation on distributed cache nodes. The key indicators for performance evaluation include storage capacity, processing capacity, and network connection quality. Storage capacity refers to the size of data that a cache node can store, usually in GB or TB; processing capacity reflects the ability of a cache node to process and manage data, and is measured by parameters such as the CPU performance and available memory of the node; while network connection quality involves indicators such as the bandwidth, latency, and packet loss rate between the node and other nodes, and these indicators directly affect the transmission efficiency of data between cache nodes. To quantify the comprehensive performance of cache nodes, calculate the performance score P of cache nodes through the following formula:
[0107] ;
[0108] where, represents the storage capacity of the node, represents the processing capacity of the node (such as CPU performance, memory size, etc.), represents the network connection quality of the node, 、 and are respectively the maximum storage capacity, maximum processing capacity, and maximum network connection quality that can be achieved in the system, and the weight coefficients 、 and Respectively represent the importance of storage capacity, processing power, and network connection quality in the comprehensive performance score. Through the formula, the performance score of each cache node is obtained, and the score information is integrated into the cache node performance metric set. According to the service migration strategy and the cache node performance metric set, a heuristic algorithm is used to calculate the association relationship between cache nodes and devices. By comprehensively analyzing the performance of cache nodes and the requirements of devices, the heuristic algorithm can quickly find a cache node allocation scheme that meets the needs of most services. This scheme will allocate one or more cache nodes to each device to maximize the utilization rate of cache nodes and data transfer efficiency. For example, if a device has a high data access frequency and is geographically close to a cache node, then this cache node should be preferentially allocated to this device for use. After the cache node allocation scheme is determined, the data to be transmitted is allocated to the corresponding distributed cache nodes according to the data allocation ratio. The allocation ratio is determined based on the performance metrics of cache nodes and service requirements to ensure that data can be evenly distributed among cache nodes and avoid the situation of a single node being overloaded. After the data allocation is completed, redundant backups are made for the data distributed on the cache nodes. To achieve efficient data distribution and redundant backup, the consistent hashing algorithm is used to determine the distribution of data among cache nodes. The consistent hashing algorithm maps all cache nodes to a circular hash space, and then maps data items to this circular space through hash values. Each data item finds the first cache node greater than or equal to its hash value on the ring as its primary storage node, and at the same time selects several subsequent nodes of this node as backup nodes to achieve redundant storage of data. Continuously monitor the storage status and network connection quality of cache nodes. The storage status includes information such as the storage usage and remaining storage space of cache nodes; the network connection quality includes data such as the real-time bandwidth, latency, and packet loss rate between nodes. By continuously monitoring this information, performance bottlenecks and network failures of cache nodes can be detected in a timely manner. Combine the real-time cache performance data with the service migration strategy and use the dynamic programming algorithm to optimize the distribution of data among cache nodes. The dynamic programming algorithm adjusts the current data distribution according to the real-time performance data to find a globally optimal cache data distribution scheme. The dynamic programming algorithm calculates the storage cost of each data item on different cache nodes based on the storage status, network connection quality, and service requirements of each cache node, and minimizes the sum of the storage costs to obtain a new data distribution scheme. Based on the updated data distribution scheme, reallocate the cache data. The reallocation process takes into account the movement cost and time of data, as well as the impact on existing services. To reduce the impact of data movement on system performance, select to migrate data in batches and at different time periods. At the same time, during the data migration process, Reed-Solomon coding is used to recover lost or damaged data.Reed-Solomon coding is an error-correcting coding technique that introduces redundant information into the data to recover the original data in case of partial data loss or corruption. Suppose each data item is divided into k data blocks and r redundant blocks are generated. Then, during transmission, up to r data blocks can be lost or corrupted. As long as the receiving end can receive at least k data blocks, the complete data can be recovered through Reed-Solomon decoding.
[0109] The above describes the data transmission method based on OpenHarmony in the embodiments of the present invention. Next, the data transmission platform based on OpenHarmony in the embodiments of the present invention will be described. Please refer to Figure 2 One embodiment of the data transmission platform based on OpenHarmony in the embodiments of the present invention includes:
[0110] An automatic discovery module, which is used to automatically discover network devices using the distributed soft bus technology and authenticate the discovered devices based on the zero-knowledge proof mechanism to obtain a list of authenticated devices;
[0111] A construction module, which is used to construct an initial dynamic routing table according to the list of authenticated devices and update the dynamic routing table based on the real-time network conditions to obtain an optimized routing table;
[0112] An encoding module, which is used to fragment the data to be transmitted and perform redundant encoding on the data fragments using Reed-Solomon coding to obtain encoded transmission units;
[0113] A formulation module, which is used to classify services into real-time and non-real-time categories, construct a state space based on the terminal operating state and the optimized routing table, and formulate a service migration strategy according to the QoS metrics;
[0114] An adjustment module, which is used to perform parallel transmission of the encoded transmission units using multiple network interfaces and dynamically adjust the data allocation ratio based on the real-time monitored interface performance and the service migration strategy;
[0115] An optimization module, which is used to deploy distributed cache nodes in the network and optimize the data transmission based on the optimized routing table, the service migration strategy, and the data allocation ratio to achieve efficient data transmission and recovery.
[0116] Through the collaborative cooperation of the above-mentioned various components, by adopting the distributed soft bus technology and the zero-knowledge proof mechanism, the automatic discovery and security authentication of devices are realized, the security and reliability of the system are improved, and at the same time, the device access process is simplified. By using the dynamic routing table and real-time network condition monitoring, the data transmission path is optimized, and the network resource utilization rate and transmission efficiency are improved. The Reed-Solomon coding is used to fragment and redundantly encode the data, enhancing the reliability and anti-interference ability of data transmission and reducing the risk of data loss. Based on the service type and QoS metrics, a migration strategy is formulated to achieve intelligent scheduling and load balancing of resources, improving the overall performance of the system and the user experience. Through parallel transmission of multiple network interfaces and dynamic adjustment of the data allocation ratio, network resources are fully utilized, and the data transmission speed and stability are improved. Distributed cache nodes are deployed and optimized to achieve efficient data transmission and fast recovery, enhancing the fault tolerance and availability of the system.
[0117] The present invention also provides a computer device, which includes a memory and a processor. Computer-readable instructions are stored in the memory. When the computer-readable instructions are executed by the processor, the processor executes the steps of the data transmission method based on OpenHarmony in the above-mentioned various embodiments.
[0118] The present invention also provides a computer-readable storage medium. The computer-readable storage medium can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions run on a computer, the computer executes the steps of the data transmission method based on OpenHarmony.
[0119] Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the above-described system, system, and unit can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0120] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.
[0121] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A data transmission method based on OpenHarmony, characterized in that: The method comprises: Distributed soft bus technology is used to automatically discover network devices, and the discovered devices are authenticated based on the zero-knowledge proof mechanism to obtain a list of authenticated devices; Constructing an initial dynamic routing table according to the authenticated device list, and updating the dynamic routing table based on real-time network conditions to obtain an optimized routing table; The data to be transmitted is segmented and redundantly encoded using Reed-Solomon coding to obtain encoded transmission units; The services are divided into real-time and non-real-time categories, a state space is constructed based on the terminal operation status and the optimized routing table, and a service migration strategy is formulated according to the QoS index; specifically, the following steps are performed: feature analysis is performed on the services in the OpenHarmony system, service type, priority and resource requirement information is extracted, and services are classified into real-time and non-real-time categories; based on the optimized routing table, the network distance from each terminal to the server is calculated to obtain a terminal-server distance matrix, and the hardware resources of each terminal are monitored to obtain CPU usage, memory occupancy and storage space utilization rate, and a terminal resource state vector is constructed; the terminal-server distance matrix and the terminal resource state vector are combined to construct a multi-dimensional state space model, and a QoS index evaluation function is formulated for each type of service, including two key indicators, namely, available rate and delay, to obtain a service QoS score; based on the multi-dimensional state space model and the service QoS score, a service migration strategy model is trained using a reinforcement learning algorithm; for each service, its operating efficiency on the current terminal and the potential target terminal is calculated, and network delay, computing power and storage capacity factors are considered to obtain a service migration benefit matrix, and the service migration benefit matrix is input into the service migration strategy model to calculate the optimal migration plan and obtain a service migration strategy table; Using multiple network interfaces to transmit the encoded transmission units in parallel, and dynamically adjusting the data allocation ratio based on real-time monitored interface performance and the service migration strategy; Distributed cache nodes are deployed in the network, and data transmission is optimized based on the optimized routing table, the service migration strategy and the data allocation ratio to achieve efficient data transmission and recovery.
2. The OpenHarmony-based data transmission method according to claim 1, characterized in that: The distributed soft bus technology is used to automatically discover network devices, and the discovered devices are authenticated based on the zero-knowledge proof mechanism to obtain a list of authenticated devices, including: Broadcasting a device discovery request in the local area network, wherein the device discovery request includes a unique identifier and network address information of the sending device, and obtaining device response information; Parsing the device response information, extracting the device identifier, network address and supported service type of the responding device, and constructing an initial device list; Generate a public-private key pair using an elliptic curve cryptography algorithm, package the public key and a randomly generated challenge value into an authentication request, send it to the device in the initial device list, receive the signature result and new challenge value returned by the device to be authenticated, verify the signature result using the corresponding public key, and obtain the device identity confirmation result; Based on the device identity confirmation result, use the private key to sign the new challenge value, send the signature result to the authenticated device, and receive the verification result returned by the authenticated device to confirm the device for which the two-way identity authentication is successful; A temporary session key is generated for the device that has successfully undergone the two-way identity authentication, an encrypted communication channel is established, and the device that has successfully undergone the two-way identity authentication and its corresponding temporary session key information are added to a list of authenticated devices to obtain a list of authenticated devices.
3. The OpenHarmony-based data transmission method according to claim 1, characterized in that: The initial dynamic routing table is constructed according to the authenticated device list, and the dynamic routing table is updated based on the real-time network status to obtain an optimized routing table, including: Extracting network topology information of each device based on the authenticated device list, including device identifier, network address and connection status, and constructing an initial network topology map; Performing performance evaluation on each node in the initial network topology diagram, calculating the processing capability index, storage capacity index and network interface type index of the node, and obtaining a node performance score; Using network detection technology to measure the bandwidth, delay and packet loss rate of each link in the initial network topology diagram, calculate the link quality index, and obtain a link performance score; Based on the node performance score and the link performance score, a minimum weight path from a source node to a target node is calculated to construct an initial dynamic routing table; A sliding window mechanism is used to continuously monitor network conditions and regularly collect real-time network performance data, including bandwidth utilization, end-to-end latency, and congestion levels; Inputting the real-time network performance data into a pre-trained machine learning model to predict the short-term network performance change trend and obtain a network performance prediction result; Based on the network performance prediction result, the weights of the routing entries in the initial dynamic routing table are adjusted, the optimal path is recalculated using a dynamic programming algorithm, and the recalculated optimal path is updated to the dynamic routing table, and an update timestamp is set to obtain an optimized routing table.
4. The OpenHarmony-based data transmission method according to claim 1, characterized in that: The method of performing segmentation processing on the data to be transmitted and performing redundant encoding on the data segments using Reed-Solomon encoding to obtain the encoded transmission units includes: Performing data feature analysis on the data to be transmitted, extracting the total data size, data type and priority information, obtaining a data feature vector, and calculating the optimal fragmentation size using an adaptive algorithm based on the data feature vector and the current network status, obtaining fragmentation parameters; Segment the data to be transmitted according to the segmentation parameters, assign a unique sequence number and checksum to each data segment, and obtain an initial data segment set; Performing Reed-Solomon encoding on each data segment in the initial data segment set to generate redundant data blocks to obtain encoded data segments, and calculating optimal redundancy using a dynamic redundancy adjustment algorithm based on current network quality indicators to obtain redundancy parameters; Generating redundant data for the encoded data segment according to the redundancy parameter to obtain a data segment with redundancy protection; The data fragments with redundant protection are packaged into transmission units, each transmission unit contains the original data fragments, redundant data, sequence number and checksum, and a transmission unit mapping table is constructed to record the original data position information corresponding to each transmission unit to obtain the encoded transmission unit.
5. The OpenHarmony-based data transmission method according to claim 1, characterized in that: The adopting of multiple network interfaces to transmit the encoded transmission units in parallel, and dynamically adjusting the data allocation ratio based on the real-time monitored interface performance and the service migration strategy, includes: Scan the network interfaces supported by the device, identify the available network interface types, obtain a network interface list, and based on the network interface list, perform performance evaluation on each interface, measure bandwidth, latency, stability, and energy consumption indicators, and obtain an interface performance indicator set; According to the interface performance indicator set, a fuzzy comprehensive evaluation method is used to calculate the transmission weight of each interface to obtain an initial interface weight allocation scheme, and based on the initial interface weight allocation scheme, the encoded transmission units are allocated to allocate data fragments to different network interfaces; Real-time monitoring of the transmission performance of each network interface, including throughput, response time and error rate, to obtain real-time interface performance data, and to integrate the real-time interface performance data with the service migration strategy to construct a dynamic weight adjustment model to obtain an interface-service weight matrix; Based on the interface-service weight matrix, an adaptive load balancing algorithm is used to calculate a new data allocation ratio to obtain an updated data allocation plan. According to the updated data allocation plan, the data transmission volume of each network interface is dynamically adjusted, and the data fragments that failed to be transmitted are intelligently retransmitted to dynamically adjust the data allocation ratio.
6. The OpenHarmony-based data transmission method according to claim 1, characterized in that: The distributed cache node is deployed in the network, and data transmission is optimized based on the optimized routing table, the service migration strategy and the data allocation ratio to achieve efficient data transmission and recovery, including: Analyze the network topology based on the optimized routing table, identify key nodes and data transmission hotspots, determine the deployment location of distributed cache nodes, and perform performance evaluation on the distributed cache nodes, calculate storage capacity, processing power and network connection quality, and obtain a cache node performance indicator set; According to the cache node performance indicator set and the service migration strategy, a heuristic algorithm is used to calculate the association relationship between the cache node and the device to obtain a cache node allocation scheme, and based on the cache node allocation scheme, the data to be transmitted is allocated to the corresponding distributed cache node according to the data allocation ratio; Redundantly back up the data distributed on the cache nodes, use the consistent hashing algorithm to determine the distribution of data among the cache nodes, obtain a data redundant storage solution, and continuously monitor the storage status and network connection quality of the cache nodes to obtain real-time cache performance data; The real-time cache performance data is combined with the business migration strategy, and a dynamic programming algorithm is used to optimize the distribution of data among cache nodes to obtain an updated data distribution plan. Based on the updated data distribution plan, the cache data is reallocated, and Reed-Solomon coding is used to recover lost or damaged data to ensure data integrity and reliability.
7. A data transmission platform based on OpenHarmony, characterized in that: Used to execute the OpenHarmony-based data transmission method according to any one of claims 1 to 6, the OpenHarmony-based data transmission platform comprising: The automatic discovery module is used to automatically discover network devices using distributed soft bus technology, and authenticate the discovered devices based on the zero-knowledge proof mechanism to obtain a list of authenticated devices; A construction module, used to construct an initial dynamic routing table according to the authenticated device list, and update the dynamic routing table based on the real-time network status to obtain an optimized routing table; The encoding module is used to perform fragmentation processing on the data to be transmitted and perform redundant encoding on the data fragments using Reed-Solomon encoding to obtain encoded transmission units; A formulation module for classifying services into real-time and non-real-time categories, constructing a state space based on the terminal operation status and the optimized routing table, and formulating a service migration strategy based on QoS indicators; An adjustment module, configured to use a plurality of network interfaces to transmit the encoded transmission units in parallel, and dynamically adjust the data allocation ratio based on the real-time monitored interface performance and the service migration strategy; The optimization module is used to deploy distributed cache nodes in the network, optimize data transmission based on the optimized routing table, the business migration strategy and the data allocation ratio, and realize efficient data transmission and recovery.
8. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor implements the OpenHarmony-based data transmission method according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the processor is enabled to execute the OpenHarmony-based data transmission method as claimed in any one of claims 1 to 6.
Citation Information
Patent Citations
Method for highly-reliably constructing a dynamic Ad-Hoc Network of multiple smart household devices
CN105007202A
Networking method, system and terminal based on distributed soft bus
CN119030823A