Communication method, device and system, storage medium and chip
By introducing the distinction mechanism between master nodes and slave nodes in the subnet, the complex problem of computing resource discovery and routing paths in the P2P network is solved, and more efficient computing task execution and simplified transmission paths are achieved.
Patent Information
- Application Number
- CN202311279606.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-28
- Publication Date
- 2025-03-28
AI Technical Summary
In P2P network, the discovery and routing paths of computing resources are relatively complex, resulting in inefficient execution of computing tasks.
By introducing a distinction mechanism between master and slave nodes in the subnet, slave nodes send computing tasks and parameters to higher performance master nodes, which are executed by master nodes and return results, thereby simplifying the discovery and routing path of computing resources.
It effectively avoids the complex problems of computing resource discovery in P2P networks, simplifies transmission paths, improves the execution efficiency of computing tasks, and supports the joining and leaving of dynamically sensed nodes.
Smart Images

Figure CN119728703A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technology, and in particular to a communication method, device, system, storage medium and chip. Background Art
[0002] In the related art, tasks and workloads are distributed among multiple peer nodes to form a peer-to-peer network (P2P network). A P2P network can be called a point-to-point or end-to-end network. In a P2P network, each peer node is in an equal position. A peer node can act as a requester of network services and respond to requests from other peer nodes.
[0003] However, in P2P networks, the discovery and routing paths of computing resources are relatively complex. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the present disclosure provides a communication method, device, system, storage medium and chip.
[0005] According to a first aspect of an embodiment of the present disclosure, a communication method is provided, which is executed by a master node and includes:
[0006] Receiving a first computing task and computing parameters sent by a first slave node;
[0007] Obtaining a calculation result according to the first calculation task and the calculation parameters;
[0008] The calculation result is sent to the first slave node; wherein the master node and the first slave node are located in the same subnet, the master node and the first slave node are edge devices, and the performance value of the master node is greater than the performance value of the first slave node.
[0009] Optionally, obtaining a calculation result according to the calculation task and the calculation parameter includes:
[0010] When the second slave node and the first slave node are the same slave node, and the first computing task and the second computing task are the same computing task, a computing result is obtained according to the computing task and the computing parameters; wherein the second slave node is used to subscribe to the computing resources of the master node to perform the second computing task.
[0011] Optionally, obtaining a calculation result according to the first calculation task and the calculation parameter includes: inputting the calculation parameter into the first calculation task to obtain the calculation result.
[0012] Optionally, the master node establishes a communication connection with an online device, and the method further includes: when it is determined that the online device meets a preset condition corresponding to the created business scenario, using the online device as a node in the subnet.
[0013] Optionally, the master node establishes a communication connection with an online device, and the method further includes:
[0014] receiving a joining request sent by an online device, wherein the joining request is used to request to join the subnet;
[0015] When it is determined that the online device meets the preset conditions corresponding to the created business scenario, a pass feedback is sent to the online device, and the online device is used as a node in the subnet; wherein the pass feedback is used to indicate that the online device is allowed to join the subnet.
[0016] Optionally, the method further comprises:
[0017] When the device is in a connectable state, the device is used as the online device.
[0018] Optionally, the method further comprises:
[0019] Receiving a performance value of the online device;
[0020] When the performance value of the online device is greater than the performance value of the master node, the online device is used as a new master node in the subnet.
[0021] Optionally, all nodes in the subnet have the ability to detect that other nodes leave or join the subnet.
[0022] According to a second aspect of an embodiment of the present disclosure, there is provided a communication method, which is performed by a slave node and includes:
[0023] Sending the first computing task and computing parameters to the master node;
[0024] Receive a calculation result returned by the master node; the calculation result is obtained by the master node according to the first computing task and the computing parameters, the master node and the slave node are located in the same subnet, the master node and the slave node are edge devices, and the performance value of the master node is greater than the performance value of the slave node.
[0025] Optionally, the method further comprises:
[0026] Subscribe to the computing resources of the master node, where the computing resources of the master node are used to calculate the second computing task.
[0027] According to a third aspect of an embodiment of the present disclosure, a communication device is provided, including:
[0028] The master node receiving module is configured to receive a first computing task and computing parameters sent by a first slave node;
[0029] a calculation module, configured to obtain a calculation result according to the first calculation task and the calculation parameters;
[0030] The master node sending module is configured to send the calculation result to the first slave node; wherein the master node and the first slave node are located in the same subnet, the master node and the first slave node are edge devices, and the performance value of the master node is greater than the performance value of the first slave node.
[0031] According to a fourth aspect of an embodiment of the present disclosure, a communication device is provided, including:
[0032] A slave node sending module configured to send a first computing task and computing parameters to a master node;
[0033] The slave node receiving module is configured to receive the calculation result returned by the master node; the calculation result is obtained by the master node according to the first calculation task and the calculation parameter, the master node and the slave node are located in the same subnet, the master node and the slave node are edge devices, and the performance value of the master node is greater than the performance value of the slave node.
[0034] According to a fifth aspect of an embodiment of the present disclosure, a communication device is provided, including:
[0035] processor;
[0036] a memory for storing processor-executable instructions;
[0037] Wherein, the processor is configured to:
[0038] Execute the steps of the communication method provided in the first aspect of the embodiment of the present disclosure, or execute the steps of the communication method provided in the second aspect of the present disclosure.
[0039] According to a sixth aspect of an embodiment of the present disclosure, a communication system is provided, the system comprising a master node and a slave node, the master node and the slave node are located in the same subnet, the master node and the slave node are edge devices, and a performance value of the master node is greater than a performance value of the slave node;
[0040] The slave node is used to send the first computing task and computing parameters to the master node;
[0041] The master node is used to obtain a calculation result according to the first calculation task and the calculation parameter, and send the calculation result to the slave node.
[0042] According to the seventh aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the communication method provided in the first aspect of the present disclosure are implemented, or when executed, the steps of the communication method provided in the second aspect of the present disclosure are implemented.
[0043] According to an eighth aspect of an embodiment of the present disclosure, a chip is provided, comprising a processor and an interface; the processor is used to read instructions to execute the steps of the communication method provided in the first aspect of the present disclosure, or to execute the steps of the communication method provided in the second aspect of the present disclosure.
[0044] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0045] Since there is a distinction between master nodes and slave nodes in the subnet proposed in the present application, the slave node can send its first computing task and computing parameters to be performed to the master node with higher computing power. The master node will replace the slave node to perform the first computing task according to the computing parameters, and finally feed back the computing results to the slave node. There is no need to define which node is to perform the computing task as in the P2P network architecture, thereby avoiding the problem of complex discovery of computing resources.
[0046] Since the transmission path in the subnet is also between the slave node and the master node and does not involve the transmission path between multiple nodes, the transmission path is relatively simple, thereby making the transmission path of the entire subnet relatively simple.
[0047] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0049] Figure 1 The present invention is a flow chart showing a communication method according to an exemplary embodiment.
[0050] Figure 2 It is a schematic diagram showing a client server architecture according to an exemplary embodiment.
[0051] Figure 3 It is a schematic diagram of a P2P network architecture according to an exemplary embodiment.
[0052] Figure 4 The diagram is a schematic diagram of interaction between a watch as a slave node and a mobile phone as a master node according to an exemplary embodiment.
[0053] Figure 5 The present invention is a schematic diagram of interaction between a watch and an air conditioner as slave nodes and a mobile phone as a master node according to an exemplary embodiment.
[0054] Figure 6 It is a schematic diagram showing a watch subscribing to computing resources of a master node to perform different computing tasks according to an exemplary embodiment.
[0055] Figure 7 The diagram is a schematic diagram of subnets corresponding to different service scenarios according to an exemplary embodiment.
[0056] Figure 8 The present invention is a flow chart showing a communication method according to an exemplary embodiment.
[0057] Fig. 9 The invention is a schematic diagram of a communication system according to an exemplary embodiment.
[0058] Fig.10 The present invention is a schematic diagram of a communication device according to an exemplary embodiment.
[0059] Fig.11 The present invention is a schematic diagram of a communication device according to an exemplary embodiment.
[0060] Fig.12 The present invention is a schematic diagram of a communication device according to an exemplary embodiment. DETAILED DESCRIPTION
[0061] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0062] It should be noted that all actions of acquiring signals, information or data in the present disclosure are carried out in compliance with the relevant data protection laws and policies of the country where the device is located and with the authorization given by the owner of the corresponding device.
[0063] For related technologies, see Figure 2 As shown, there is a client-server architecture, in which devices with limited computing resources act as clients, and devices with rich resources or cloud servers act as centralized servers. The client sends a request to the server, and the server processes the client's request and returns a response. However, this architecture has many defects:
[0064] The first defect is that when the server receives a large number of client requests, due to the limited computing resources of the server, some clients will have to wait for a long time to get a response from the server.
[0065] The second defect is that the client needs to interact with the server through the network, and it cannot interact with the server through other communication methods without the network.
[0066] The third defect is that the server cannot dynamically sense the joining and leaving of clients. The server can only respond when receiving requests from clients. In this client-server architecture, the server cannot actively maintain the client's connection status. Since the server cannot sense the joining and leaving of clients, it will not be able to allocate computing resources to clients in a timely manner when facing a large number of clients sending requests, causing the entire system to crash; and since the server cannot sense the joining and leaving of clients, it will not be able to synchronize updated status information to clients in a timely manner.
[0067] In related technologies, there is also a P2P network architecture, see Figure 3 As shown in the figure, in a P2P network, all nodes are equal, regardless of priority, which leads to the following defects:
[0068] The first defect is that the discovery of computing resources is relatively complicated. For example, there are five peer nodes A to E in the P2P network. When executing computing task A, it is necessary to discover that the computing resources of peer node A are suitable for executing computing task A; when executing computing task B, it is necessary to discover that the computing resources of peer node B are suitable for executing computing task B. It can be seen that when executing each computing task, it is necessary to traverse all peer nodes in the P2P network to determine which peer node's computing resources can execute the computing task.
[0069] The second defect is that the data transmission path is relatively complicated. For example, there are five peer nodes A to E in the P2P network. Peer node A is the starting node of data transmission, and peer node J is the ending node of data transmission. The protocol needs to define the transmission path between peer node A and peer node E. For example, the transmission path can be peer node A-peer node E, peer node A-peer node B-peer node E, or peer node A-peer node C-peer node E. As for which transmission path needs to be used, it needs to be calculated, which makes the determination of the data transmission path relatively complicated.
[0070] The third defect is that it is complicated to perceive the joining and leaving of nodes. For example, when a new node joins the P2P network, the protocol needs to define which nodes in the P2P network need to know that the new node has joined the P2P network and which nodes do not need to know that the new node has joined the P2P network.
[0071] Based on this, Figure 1 is a flow chart of a communication method according to an exemplary embodiment. Figure 1 As shown, the communication method is executed by a master node, which is an edge device, such as a mobile phone, a tablet, a PC (personal computer), a bracelet, a washing machine or a TV, and includes the following steps.
[0072] In step S11, a first computing task and computing parameters sent by a first slave node are received.
[0073] The master node and the slave node form a subnet, which is a local area network composed of the master node and at least one slave node. The performance value of the master node is greater than the performance value of the slave node. The slave nodes in the subnet include two types, the first type is a first slave node that sends a first computing task to the master node, and the second type is a second slave node that subscribes to the computing resources of the master node to perform a second computing task. The first slave node and the second slave node can be the same slave node or different slave nodes.
[0074] Both the master node and the slave node can be edge devices. Edge devices refer to devices at the edge of the network, which can be mobile phones, tablets, PCs, bracelets, TVs, washing machines, air conditioners, microwave ovens, smart speakers, cameras and other devices.
[0075] Both the master node and the slave node are equipped with a communication component, which can realize any one of network connection, Bluetooth connection, NFC (Near Field Communication) connection and USB (Universal Serial Bus) connection, so that the master node and the slave node are not limited to network connection, but can also be connected through Bluetooth, USB data cable connection, NFC connection, etc. For example, a mobile phone and a bracelet can be connected through Bluetooth, and a mobile phone and an air conditioner can also be connected through Bluetooth, etc.
[0076] The performance value of the master node is greater than the performance value of the slave node, including at least one of the following: the computing power value (CPU) of the master node is greater than the computing power value of the slave node, the display capability value (GPU) of the master node is greater than the display capability value of the slave node, the screen size of the master node is greater than the screen size of the slave node, etc.
[0077] When determining the performance value of the master node and the performance value of the slave node, the weight coefficient corresponding to the performance value can be determined according to different business scenarios, and then the different performance values are weighted averaged to obtain the performance values of the master node and the slave node.
[0078] For example, if the master node is a mobile phone and the slave node is a bracelet, if the user wants to perform map navigation on the bracelet, the bracelet will request navigation data from the mobile phone, and the mobile phone will return the navigation data to the bracelet. In this business scenario, computing power is more important, and the weight coefficient of the computing power value > the weight coefficient of the display power value > the weight coefficient of the screen size. Therefore, the weight coefficient of the computing power value can be set to 0.7, the weight coefficient of the display power value can be set to 0.2, and the weight coefficient of the screen size can be set to 0.1. The final performance value = computing power value*0.7+display power value*0.2+screen size*0.1.
[0079] For example, if the master node is a mobile phone and the slave node is a TV, if the user wants to watch a video played on the mobile phone on the TV, the TV will request the video data from the mobile phone, and the mobile phone will return the video data to the TV. In this business scenario, the display capability of the screen is more important. The weight coefficient of the display capability value > the weight coefficient of the computing capability value > the weight coefficient of the screen size. Therefore, the weight coefficient of the display capability value can be set to 0.5, the weight coefficient of the computing capability value can be set to 0.4, and the weight coefficient of the screen size can be set to 0.1. The final performance value = display capability value*0.5+computing capability value*0.4+screen size*0.1.
[0080] The first computing task refers to a specific execution operation that needs to be calculated or processed. The first computing task can be executing an algorithm, processing data, running an application, etc. The computing parameters refer to the parameters required when executing the first computing task. For example, the first slave node sends the first computing task "addition algorithm" and the computing parameters "2 and 2".
[0081] The master node and slave node in the subnet are both equipped with a discovery component, which is used to discover whether a device has joined or left the subnet. The discovery component can be an MDNS (Multicast DNS) component, which can perform service discovery and host name resolution in the subnet, allowing other nodes in the subnet to be automatically discovered by broadcasting and communicate through host names when there is no dedicated server in the subnet.
[0082] For example, when the master node is a mobile phone and the slave nodes are a bracelet, a speaker and a washing machine, the mobile phone, the bracelet, the speaker and the washing machine form a subnet. The bracelet can use its own discovery component to discover whether the mobile phone, the speaker or the washing machine has left the subnet. Similarly, the speaker can also use its own discovery component to discover whether the mobile phone, the bracelet or the washing machine has left the subnet.
[0083] In step S12, a calculation result is obtained according to the first calculation task and the calculation parameters.
[0084] The master node can input the calculation parameters into the first calculation task to obtain the calculation result. For example, if the first slave node sends the first calculation task "addition algorithm" and the calculation parameters "2 and 2", the master node can bring the calculation parameters "2 and 2" into the "addition algorithm" to obtain the calculation result 4.
[0085] Since the performance value of the master node is greater than the performance value of the slave node, the slave node can transfer the work of executing the first computing task to the master node, and the master node can obtain the computing result more quickly according to the first computing task and the computing parameters.
[0086] In step S13, the calculation result is sent to the first slave node.
[0087] After obtaining the calculation result, the master node can send the calculation result to the first slave node through a wired connection or a wireless connection. The wired connection includes: USB connection, cable connection; the wireless connection includes: Bluetooth connection, WIFI connection, NFC connection, etc.
[0088] The present disclosure has the following advantages:
[0089] First, since there is no server in the subnet, the slave node in the subnet will send the first computing task to the master node, which will perform the calculation and feed the calculation result back to the slave node, thereby making full use of the computing power of the master node without having to send the first computing task to the server for execution, thereby avoiding the situation where the slave node needs to wait for a long time to get a response from the server.
[0090] Secondly, the master node and slave nodes in the subnet are not limited to being connected through the network, but can also be connected through USB, Bluetooth, etc., and data interaction can be carried out without a network, that is, the computing power of the master node can be used to meet the computing task requirements of the slave node without a network.
[0091] Thirdly, each node in the subnet can dynamically sense the joining and leaving of nodes in the subnet, so that when the master node finds that a slave node has left the subnet, it can promptly allocate the computing resources occupied by the slave node to the remaining subnodes in the subnet, avoiding the remaining slave nodes from waiting for a long time to get a response; after sensing that a new slave node has joined the subnet, the master node can also promptly synchronize the updated status information to the slave node.
[0092] Fourthly, since there is a distinction between master nodes and slave nodes in the subnet proposed in this application, the slave node can send its first computing task and computing parameters to the master node with higher computing power. The master node will replace the slave node to perform the first computing task according to the computing parameters, and finally feed back the computing results to the slave node. There is no need to define which node will perform the computing task as in the P2P network architecture, thereby avoiding the problem of complex discovery of computing resources.
[0093] Fifthly, since the transmission path in the subnet is also between the slave node and the master node and does not involve the transmission path between multiple nodes, its transmission path is relatively simple, which makes the transmission path of the subnet relatively simple.
[0094] Sixthly, since each node in the subnet is configured with a discovery component, it is possible to use the discovery component to discover which devices have joined the subnet or which nodes have left the subnet. In other words, each node in the subnet has the ability to discover other nodes leaving or joining the subnet, without the need for a protocol to define which nodes need to know that a new node has joined the subnet and which nodes do not need to know that a new node has joined the subnet. The subnet structure is simpler.
[0095] The optional embodiments and specific embodiments involved in the above steps S11 to S13 are introduced below.
[0096] In order to ensure that the computing resources of the master node can be reasonably allocated to each slave node, the present disclosure proposes a subscription function, and the slave node can subscribe to the computing resources of the master node to perform the second computing task. For example, the memory of the master node is 8G, and the eight slave nodes A~H can subscribe to the computing resources of the 1G memory of the master node respectively to perform the computing tasks of the slave nodes A~H respectively.
[0097] Since the second slave node that subscribes to the computing resources of the master node to perform the second computing task may be the same as or different from the first slave node that sent the first computing task, the master node can judge the consistency of the computing task and the slave node, and then send the calculation result to the accurate slave node.
[0098] When the second slave node and the first slave node are the same slave node, and the first computing task and the second computing task are the same computing task, a computing result is obtained according to the computing task and the computing parameters; wherein the second slave node is used to subscribe to the computing resources of the master node to perform the second computing task.
[0099] The first slave node and the second slave node may be the same node or different nodes.
[0100] See also Figure 4As shown, taking the first slave node and the second slave node as the same slave node as an example, the first slave node and the second slave node are both the same wristband, the master node is the mobile phone, and the wristband can first subscribe to the computing resources of the mobile phone to execute the second computing task of "running map navigation software"; when the mobile phone receives the first computing task of "running map navigation software" and computing parameters sent by the wristband, the mobile phone determines that the second slave node that subscribes to computing resources to execute the second computing task and the first slave node that sends the first computing task are both wristbands, and determines that the first computing task and the second computing task are both "running map navigation software", then it will use the computing resources subscribed by the second slave node, execute the computing task of "running map navigation software" according to the computing parameters, and return the navigation result to the wristband.
[0101] See also Figure 5 As shown, taking the first slave node and the second slave node as different slave nodes as an example, the first slave node is a bracelet, the second slave node is an air conditioner, the master node is a mobile phone, and the bracelet subscribes to the computing resources of the mobile phone to execute the second computing task "running map navigation software". Due to business scenarios, the bracelet may not immediately send the first computing task "running map navigation software" to the mobile phone.
[0102] When the mobile phone receives the first computing task "control the air conditioner to cooling mode" and computing parameters sent by the air conditioner, the mobile phone can determine that the second slave node that subscribes to computing resources to execute the second computing task is the wristband, while the first slave node that sends the first computing task "control the air conditioner to cooling mode" is the air conditioner. The two are not the same slave node, and the first computing task of "controlling the air conditioner to cooling mode" is different from the second computing task of "running map navigation software", so the calculation result will not be returned to the air conditioner, thereby avoiding the air conditioner using the computing resources of the mobile phone without subscribing to the computing resources of the mobile phone; it also avoids the wristband not using the computing resources of the mobile phone when it has subscribed to the computing resources of the mobile phone.
[0103] After receiving the computing resource subscription from the second slave node, the master node will also record the mapping relationship between the second slave node and the second computing task. In addition to receiving the computing parameters sent by the first master node, the master node also needs to receive the first computing task sent by the first slave node. Only then will the master node execute the first computing task accurately without erroneous execution of the computing task.
[0104] For example, the first slave node is the same as the second slave node, the first slave node and the second slave node are both wristbands, and the master node is a mobile phone. Figure 6As shown, in addition to subscribing to the computing resources of the mobile phone to execute the second computing task "running the map navigation software", the bracelet also subscribes to the computing resources of the mobile phone to execute the second computing task "running the music player software". If the bracelet only sends the computing parameters to the mobile phone, the mobile phone does not know whether it should execute "running the map navigation software" or "running the music player software", which will cause the mobile phone to incorrectly execute the second computing task.
[0105] Therefore, please refer to Figure 6 As shown, when the bracelet sends calculation parameters, it can also send a second calculation task "run map navigation software" to the mobile phone. The mobile phone can then determine that the first slave node and the second slave node are both bracelets, and the second calculation task and the first calculation task are "run map navigation software". Only then will the correct calculation task be executed and the correct calculation result be returned to the bracelet.
[0106] Through the above technical solution, on the first hand, the master node can accept the subscription request of the slave node, and allocate a certain share of computing resources to the slave node based on the subscription request, so that the computing resources of the master node can be reasonably allocated; on the second hand, the master node will determine whether the slave node that subscribes to the computing resources to execute the second computing task is the same node as the slave node that sends the first computing task. If they are the same node, and the first computing task and the second computing task to be executed are the same, the computing resources subscribed by the slave node will be used to execute the first computing task, and the calculation result will be returned to the slave node; if they are not the same node, the calculation result will not be returned to the slave node that sent the first computing task, thereby avoiding the slave node that has not subscribed to the computing resources to obtain the calculation result.
[0107] Devices outside the subnet can be added to the subnet dynamically. There are two ways to use online devices as nodes in the subnet.
[0108] In the first way, the master node in the subnet uses the online device as a node in the subnet according to preconfigured preset conditions: when the master node in the subnet determines that the online device meets the preset conditions, the master node in the subnet uses the online device as a node in the subnet.
[0109] When it is determined that the online device meets the preset conditions corresponding to the created business scenario, the online device is used as a node in the subnet. One business scenario corresponds to one subnet, so the device can join the subnet corresponding to the business scenario only when it meets the preset conditions corresponding to the business scenario.
[0110] The preset conditions include: memory greater than the preset memory value, CPU greater than the preset CPU, support for Bluetooth, equipped with an infrared sensor, equipped with a speaker, equipped with a screen, screen size greater than the preset size, etc. The preset conditions vary with different business scenarios. For example, in a video business scenario, the preset conditions include: the online device has audio and video playback capabilities, and the online device has a screen; in a scenario of detecting the distance between objects, the preset conditions include: the online device has an infrared sensor.
[0111] Taking the creation of a video service scenario as an example, the mobile phone creates a video service scenario, and the preset condition corresponding to the video service scenario is "the online device is equipped with a screen". Since there is only one node, the mobile phone, in the video service scenario when the mobile phone creates the video service scenario, the mobile phone is the master node; when the mobile phone finds that the online devices include a TV, a speaker, and a wristband, the mobile phone determines whether these online devices meet the preset condition of "the online device is equipped with a screen" for joining the video service scenario, and then determines that the TV and the wristband are equipped with a screen, while the speaker is not equipped with a screen. Therefore, the mobile phone will actively use the TV and the wristband as slave nodes in the subnet, and the TV, the wristband and the mobile phone form a subnet, which is used to implement the video service scenario.
[0112] In the second method, the online device actively searches for the subnet and requests to join the subnet: the master node in the subnet receives the joining request sent by the online device, and the joining request is used to request to join the subnet; when it is determined that the online device meets the preset conditions corresponding to the created business scenario, a pass feedback is sent to the online device, and the online device is used as a node in the subnet; wherein the pass feedback is used to indicate consent for the online device to join the subnet.
[0113] Online devices can actively search for subnets and display the master nodes where the subnets are located to users. After the user selects one of the master nodes, the online device sends a joining request to the master node; the master node determines whether the online device can join the subnet based on the preset conditions of the business scenario. If the online device meets the preset conditions, it sends a pass feedback to the online device, agreeing that the online device can join the subnet.
[0114] Taking the creation of a video service scenario as an example, mobile phone A creates a video service scenario, and the preset condition corresponding to the video service scenario is "the online device is equipped with a screen". When the online device "TV" searches for mobile phones A to C, the user can select the subnet where mobile phone A is located as the subnet to be joined, and the TV will send a joining request to mobile phone A; mobile phone A determines that the TV is equipped with a screen and meets the preset conditions, so it will agree to let the TV join the subnet where mobile phone A is located.
[0115] In the above two methods, a master node in one subnet can be a slave node in another subnet, and a slave node in one subnet can also be a master node in another subnet.
[0116] For example, see Figure 7 As shown in the figure, the mobile phone creates a video service scenario. In the subnet A corresponding to the video service scenario, the mobile phone is the master node, and the TV and the wristband are slave nodes. Another example is that the wristband creates a rice cooker control scenario. In the subnet B corresponding to the rice cooker control scenario, the wristband is the master node, and the rice cooker is the slave node. It can be seen that in these two service scenarios, the wristband is a slave node in subnet A and a master node in subnet B.
[0117] In the above two methods, an online device refers to a device that can be connected to a node in the subnet, and the connectable state refers to a state that can be discovered by the discovery component of the node. For example, a mobile phone is a node in the subnet, and a headset is connected to the mobile phone via Bluetooth. If the two are not connected via Bluetooth, the headset is an offline device; when the headset is connected to the mobile phone via Bluetooth and is within the Bluetooth detection range covered by the mobile phone, it means that the headset is an online device.
[0118] In the above two methods, the performance value of the master node in the subnet is the largest. Therefore, in order to ensure this characteristic of the master node, the master node needs to receive the performance value sent by the online device, and compare the performance value of each online device that joins. When the performance value of the online device is greater than the performance value of the master node, the online device is used as the new master node in the subnet; when the performance value of the online device is less than the performance value of the master node, the online device is used as a slave node.
[0119] For example, when mobile phone A creates a video playback scene, the preset condition for the video playback scene is "the online device is equipped with a screen". Since only mobile phone A exists in the subnet corresponding to the video playback scene, mobile phone A is used as the main node; when mobile phone A finds online devices such as wristbands, TVs, washing machines, and mobile phone B, it finds that wristbands, TVs, and mobile phone B are equipped with screens, so it will use wristbands, TVs, and mobile phone B as nodes in the subnet corresponding to the video playback scene.
[0120] For the wristband, when it joins the subnet, it will send the performance value of the wristband to mobile phone A. Mobile phone A determines that the performance value of the wristband is less than that of mobile phone A, so it will use the wristband as a slave node in the subnet; for the TV, mobile phone A determines that the performance value of the TV is less than that of mobile phone A, so it will also use the TV as a slave node in the subnet; for mobile phone B, mobile phone A determines that the performance value of mobile phone B is greater than that of mobile phone A, so it will use mobile phone B as the new master node in the subnet. Mobile phone A, wristband and TV in the subnet corresponding to the video playback scene can all subscribe to the computing resources of mobile phone B and use the computing resources of mobile phone B to execute the computing tasks they want to achieve.
[0121] Figure 8 A communication method is proposed according to an exemplary embodiment. The communication method is executed by a slave node, which is an edge device, such as a mobile phone, a tablet, a PC (personal computer), a bracelet or a TV, and includes the following steps.
[0122] In step S21, a first computing task and computing parameters are sent to a master node.
[0123] The principle of this step can be found in the above step S11 and will not be described in detail here.
[0124] In step S22, the calculation result returned by the master node is received; the calculation result is obtained by the master node based on the first computing task and the computing parameters, the master node and the slave node are located in the same subnet, the master node and the slave node are edge devices, and the performance value of the master node is greater than the performance value of the slave node.
[0125] The principle of this step can be found in the above step S12, which will not be described in detail here.
[0126] Through the above technical solution, the slave node can use the computing resources of the master node to implement the computing tasks it wants to implement. On the one hand, when the computing power of the slave node is weak and cannot execute the first computing task, the master node can be used to execute the first computing task to ensure that the slave node can complete the first computing task; on the other hand, when the computing power of the slave node is weak and executing the first computing task will cause the slave node to freeze, the master node can be used to execute the first computing task, thereby reducing the phenomenon of slave node freezing.
[0127] The slave node can subscribe to the computing resources of the master node to execute the second computing task. Subscription can be understood as the slave node reserving the computing resources of the master node to execute the second computing task. After reserving the computing resources, the other slave nodes cannot use the computing resources, thereby ensuring that the master node can reserve computing resources to implement the second computing task to be executed by the slave node.
[0128] It is understandable that when the computing resources of the master node are less than the preset computing resources, the slave nodes cannot continue to subscribe to the computing resources of the master node. When the computing resources of the master node are less than the preset computing resources, it means that the remaining computing resources of the master node can only support the computing of the master node itself, and cannot meet the computing of the redundant slave nodes. Therefore, in order to ensure the user experience of using the master node, computing resources can be not allocated to the remaining slave nodes that subscribe to computing resources.
[0129] Before the online device is transformed into a slave node, it can also join the subnet where the master node is located by actively searching for the master node. Specifically, when the online device searches for the master node, it sends a joining request to the master node, and the joining request is used to request to join the subnet; in response to the pass feedback returned by the master node, the online device joins the subnet where the master node is located as a slave node or a new master node; wherein the pass feedback is used to indicate that the master node agrees that the online device joins the subnet.
[0130] Fig. 9 A communication system is proposed according to an exemplary embodiment, the communication system comprising a master node and a slave node, the master node and the slave node are located in the same subnet, the master node and the slave node are edge devices, and the performance value of the master node is greater than the performance value of the slave node;
[0131] The slave node is used to send the first computing task and computing parameters to the master node;
[0132] The master node is used to obtain a calculation result according to the first calculation task and the calculation parameter, and send the calculation result to the slave node;
[0133] The slave node is also used to receive the calculation result.
[0134] The slave nodes include a first slave node and a second slave node. The first slave node is used to send a first computing task and computing parameters to the master node, and the second slave node is used to subscribe to the computing resources of the master node to perform the second computing task; the master node is used to obtain the computing result according to the computing task and the slave node when the first computing task and the second computing task are the same computing task and the first slave node and the second slave node are the same slave node; and return the computing result to the slave node. Since the first computing task and the second computing task are the same here, the first computing task and the second computing task are not distinguished, and are uniformly represented by computing tasks; since the first slave node and the second slave node are the same, the first slave node and the second slave node are not distinguished, and are uniformly represented by slave nodes.
[0135] Fig.10 is a block diagram of a communication device according to an exemplary embodiment. Fig.10The communication device 1000 includes: a master node receiving module 1020, a calculation module 1030 and a master node sending module 1040.
[0136] The master node receiving module 1020 is configured to receive a first computing task and computing parameters sent by a first slave node;
[0137] A calculation module 1030 is configured to obtain a calculation result according to the first calculation task and the calculation parameter;
[0138] The master node sending module 1040 is configured to send the calculation result to the first slave node; wherein the master node and the first slave node are located in the same subnet, the master node and the first slave node are edge devices, and the performance value of the master node is greater than the performance value of the first slave node.
[0139] Optionally, the calculation module 1030 includes:
[0140] The first computing submodule is configured to obtain a computing result according to the computing task and the computing parameters when the second slave node and the first slave node are the same slave node and the first computing task and the second computing task are the same computing task; wherein the second slave node is used to subscribe to the computing resources of the master node to perform the second computing task.
[0141] Optionally, the calculation module 1030 includes:
[0142] The second calculation submodule is configured to input the calculation parameters into the first calculation task to obtain the calculation result.
[0143] Optionally, the communication device 1000 includes:
[0144] The judgment module is configured to use the online device as a node in the subnet when it is determined that the online device meets a preset condition.
[0145] Optionally, the master node establishes a communication connection with an online device, and the communication device 1000 includes:
[0146] The judgment module is configured to use the online device as a node in the subnet when it is determined that the online device meets the preset conditions corresponding to the created business scenario.
[0147] Optionally, the master node establishes a communication connection with an online device, and the communication device 1000 includes:
[0148] The master node receiving module 1020 is configured to receive a joining request sent by an online device, wherein the joining request is used to request to join the subnet;
[0149] The master node sending module 1040 is configured to send a pass feedback to the online device when it is determined that the online device meets the preset conditions corresponding to the created business scenario, and use the online device as a node in the subnet; wherein the pass feedback is used to indicate consent for the online device to join the subnet.
[0150] Optionally, the communication device 1000 includes:
[0151] The online device determination module is configured to treat the device as the online device when the device is in a connectable state.
[0152] Optionally, the communication device 1000 includes:
[0153] The master node receiving module 1020 is configured to receive the performance value of the online device;
[0154] The new master node judgment module is configured to use the online device as a new master node in the subnet when the performance value of the online device is greater than the performance value of the master node.
[0155] Optionally, all nodes in the subnet have the ability to detect that other nodes leave or join the subnet.
[0156] Fig.11 is a block diagram of a communication device according to an exemplary embodiment. Fig.11 The communication device 1100 includes: a slave node sending module 1120 and a slave node receiving module 1130.
[0157] The slave node sending module 1120 is configured to send the first computing task and computing parameters to the master node;
[0158] The slave node receiving module 1130 is configured to receive the calculation result returned by the master node; the calculation result is obtained by the master node according to the first calculation task and the calculation parameters, the master node and the slave node are located in the same subnet, the master node and the slave node are edge devices, and the performance value of the master node is greater than the performance value of the slave node.
[0159] Optionally, the communication device 1100 includes:
[0160] The subscription module is configured to subscribe to the computing resources of the master node, and the computing resources of the master node are used to calculate the second computing task.
[0161] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0162] The present disclosure also provides a computer-readable storage medium having computer program instructions stored thereon, and the program instructions, when executed by a processor, implement the steps of the communication method provided by the present disclosure.
[0163] Fig.12 1 is a block diagram of a device 1200 for communication according to an exemplary embodiment. For example, the device 1200 may be a mobile phone, a computer, a digital broadcast terminal, a message transceiver, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or an IoT device such as a wristband, a washing machine, an air conditioner, a microwave oven, a rice cooker, a speaker, and a sweeping robot.
[0164] Reference Fig.12 , the device 1200 may include one or more of the following components: a processing component 1202 , a memory 1204 , a power component 1206 , a multimedia component 1208 , an audio component 1210 , an input / output interface 1212 , a sensor component 1214 , and a communication component 1216 .
[0165] The processing component 1202 generally controls the overall operation of the device 1200, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1202 may include one or more processors 1220 to execute instructions to complete all or part of the steps of the above-mentioned communication method. In addition, the processing component 1202 may include one or more modules to facilitate the interaction between the processing component 1202 and other components. For example, the processing component 1202 may include a multimedia module to facilitate the interaction between the multimedia component 1208 and the processing component 1202.
[0166] The memory 1204 is configured to store various types of data to support the operation of the device 1200. Examples of such data include instructions for any application or method operating on the device 1200, contact data, phone book data, messages, pictures, videos, etc. The memory 1204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0167] The power supply component 1206 provides power to the various components of the device 1200. The power supply component 1206 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device 1200.
[0168] The multimedia component 1208 includes a screen that provides an output interface between the device 1200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1208 includes a front camera and / or a rear camera. When the device 1200 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0169] The audio component 1210 is configured to output and / or input audio signals. For example, the audio component 1210 includes a microphone (MIC), and when the device 1200 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1204 or sent via the communication component 1216. In some embodiments, the audio component 1210 also includes a speaker for outputting audio signals.
[0170] The input / output interface 1212 provides an interface between the processing component 1202 and the peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0171] The sensor assembly 1214 includes one or more sensors for providing various aspects of the status assessment of the device 1200. For example, the sensor assembly 1214 can detect the open / closed state of the device 1200, the relative positioning of components, such as the display and keypad of the device 1200, the sensor assembly 1214 can also detect the position change of the device 1200 or a component of the device 1200, the presence or absence of user contact with the device 1200, the orientation or acceleration / deceleration of the device 1200, and the temperature change of the device 1200. The sensor assembly 1214 can include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1214 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1214 can also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0172] The communication component 1216 is configured to facilitate wired or wireless communication between the device 1200 and other devices. The device 1200 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1216 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1216 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0173] In an exemplary embodiment, the device 1200 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above-mentioned communication method.
[0174] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1204 including instructions, and the instructions can be executed by the processor 1220 of the device 1200 to complete the above communication method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0175] In addition to being an independent electronic device, the above-mentioned device can also be a part of an independent electronic device. For example, in one embodiment, the device can be an integrated circuit (IC) or a chip, wherein the integrated circuit can be an IC or a collection of multiple ICs; the chip can include but is not limited to the following types: GPU (Graphics Processing Unit), CPU (Central Processing Unit), FPGA (Field Programmable Gate Array), DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), SOC (System on Chip, SoC, system on chip or system-level chip), etc. The above-mentioned integrated circuit or chip can be used to execute executable instructions (or codes) to implement the above-mentioned communication method. The executable instructions can be stored in the integrated circuit or chip, or can be obtained from other devices or equipment, such as the integrated circuit or chip includes a processor, a memory, and an interface for communicating with other devices. The executable instruction may be stored in the memory, and when the executable instruction is executed by the processor, the above-mentioned communication method is implemented; alternatively, the integrated circuit or chip may receive the executable instruction through the interface and transmit it to the processor for execution, so as to implement the above-mentioned communication method.
[0176] In another exemplary embodiment, a computer program product is also provided. The computer program product includes a computer program executable by a programmable device, and the computer program has a code portion for executing the above communication method when executed by the programmable device.
[0177] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the present disclosure. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0178] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A communication method, characterized in that: Executed by the master node, including: Receiving a first computing task and computing parameters sent by a first slave node; Obtaining a calculation result according to the first calculation task and the calculation parameters; The calculation result is sent to the first slave node; wherein the master node and the first slave node are located in the same subnet, the master node and the first slave node are edge devices, and the performance value of the master node is greater than the performance value of the first slave node.
2. The method according to claim 1, characterized in that The obtaining of a calculation result according to the calculation task and the calculation parameter includes: When the second slave node and the first slave node are the same slave node, and the first computing task and the second computing task are the same computing task, a computing result is obtained according to the computing task and the computing parameters; wherein the second slave node is used to subscribe to the computing resources of the master node to perform the second computing task.
3. The system according to claim 1, characterized in that The obtaining a calculation result according to the first calculation task and the calculation parameter includes: The calculation parameters are input into the first calculation task to obtain the calculation result.
4. The method according to claim 1, characterized in that: The master node establishes a communication connection with the online device, and the method further includes: When it is determined that the online device meets the preset condition corresponding to the created business scenario, the online device is used as a node in the subnet.
5. The method according to claim 1, characterized in that The master node establishes a communication connection with the online device, and the method further includes: receiving a joining request sent by an online device, wherein the joining request is used to request to join the subnet; When it is determined that the online device meets the preset conditions corresponding to the created business scenario, a pass feedback is sent to the online device, and the online device is used as a node in the subnet; wherein the pass feedback is used to indicate consent for the online device to join the subnet.
6. The method according to claim 4 or 5, characterized in that: The method further comprises: When the device is in a connectable state, the device is used as the online device.
7. The method according to claim 4 or 5, characterized in that: The method further comprises: Receiving a performance value of the online device; When the performance value of the online device is greater than the performance value of the master node, the online device is used as a new master node in the subnet.
8. The method according to any one of claims 1 to 5, characterized in that: The nodes in the subnet all have the ability to discover that other nodes leave or join the subnet.
9. A communication method, characterized in that: Executed by slave nodes, including: Sending the first computing task and computing parameters to the master node; Receive a calculation result returned by the master node; the calculation result is obtained by the master node according to the first calculation task and the calculation parameters, the master node and the slave node are located in the same subnet, the master node and the slave node are edge devices, and the performance value of the master node is greater than the performance value of the slave node.
10. The method according to claim 9, characterized in that The method further comprises: Subscribe to the computing resources of the master node, where the computing resources of the master node are used to calculate the second computing task.
11. A communication device, characterized in that: include: The master node receiving module is configured to receive a first computing task and computing parameters sent by a first slave node; a calculation module, configured to obtain a calculation result according to the first calculation task and the calculation parameters; The master node sending module is configured to send the calculation result to the first slave node; wherein the master node and the first slave node are located in the same subnet, the master node and the first slave node are edge devices, and the performance value of the master node is greater than the performance value of the first slave node.
12. A communication device, characterized in that: include: A slave node sending module configured to send a first computing task and computing parameters to a master node; A slave node receiving module is configured to receive the calculation result returned by the master node; The calculation result is obtained by the master node according to the first calculation task and the calculation parameters, the master node and the slave node are located in the same subnet, the master node and the slave node are edge devices, and the performance value of the master node is greater than the performance value of the slave node.
13. A communication device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to: Execute the steps of the method according to any one of claims 1 to 8 or claims 9 to 10.
14. A communication system, characterized in that: The system includes a master node and a slave node, the master node and the slave node are located in the same subnet, the master node and the slave node are edge devices, and the performance value of the master node is greater than the performance value of the slave node; The slave node is used to send the first computing task and computing parameters to the master node; The master node is used to obtain a calculation result according to the first calculation task and the calculation parameter, and send the calculation result to the slave node; The slave node is also used to receive the calculation result.
15. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the steps of the method described in any one of claims 1 to 8 or claims 9 to 10 are implemented.
16. A chip, characterized in that: The method comprises a processor and an interface; the processor is used to read instructions to execute the method according to any one of claims 1 to 8 or claims 9 to 10.