CN107454176B - Task processing method, electronic device and computer readable storage medium - Google Patents

Task processing method, electronic device and computer readable storage medium Download PDF

Info

Publication number
CN107454176B
CN107454176B CN201710696595.2A CN201710696595A CN107454176B CN 107454176 B CN107454176 B CN 107454176B CN 201710696595 A CN201710696595 A CN 201710696595A CN 107454176 B CN107454176 B CN 107454176B
Authority
CN
China
Prior art keywords
electronic device
hoc network
task
electronic equipment
processing result
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710696595.2A
Other languages
Chinese (zh)
Other versions
CN107454176A (en
Inventor
张焜翔
周军
张振雄
邓文华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
EQUES TECHNOLOGY CO LTD
Original Assignee
EQUES TECHNOLOGY CO LTD
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by EQUES TECHNOLOGY CO LTD filed Critical EQUES TECHNOLOGY CO LTD
Priority to CN201710696595.2A priority Critical patent/CN107454176B/en
Publication of CN107454176A publication Critical patent/CN107454176A/en
Application granted granted Critical
Publication of CN107454176B publication Critical patent/CN107454176B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/12Arrangements for remote connection or disconnection of substations or of equipment thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0225Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal
    • H04W52/0235Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal where the received signal is a power saving command
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/18Self-organising networks, e.g. ad-hoc networks or sensor networks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The invention relates to the technical field of communication, and discloses a task processing method, electronic equipment and a computer readable storage medium. The task processing method comprises the following steps: the method comprises the steps that a first electronic device determines a task needing to be processed, divides the task needing to be processed into at least two segments, and dispatches the segments to a second electronic device which is idle in an ad hoc network for processing until all the segments are dispatched; the first electronic equipment determines a processing result of a task needing to be processed; when determining that the ad hoc network function needs to be closed according to a processing result of a task needing to be processed, the first electronic device sends an ad hoc network closing instruction to all electronic devices in the ad hoc network, and controls all electronic devices in the ad hoc network to close the ad hoc network function. According to the task processing method, the electronic device and the computer-readable storage medium provided by the embodiment of the invention, the processing efficiency of the task is greatly improved under the conditions that the electronic device does not increase the preparation cost and does not occupy too much network bandwidth.

Description

Task processing method, electronic device and computer readable storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a task processing method, an electronic device, and a computer-readable storage medium.
Background
The electronic cat eye is also called as a visual doorbell, integrates the functions of the cat eye and the doorbell, overcomes the defects and potential safety hazards of the traditional optical cat eye, increases the monitoring effect, is widely applied to the doorways of families and high-grade hotels at present, is an upgrading and replacing product of the traditional optical cat eye, and along with the development of electronic technology and communication technology, the intelligent home becomes more and more popular, the electronic cat eye also becomes more intelligent, has multiple functions of memory, analysis, processing and the like gradually, and is greatly convenient for the life of people.
However, the inventors found that at least the following problems exist in the prior art: although, the life of people has been made things convenient for greatly to the intellectuality of electron cat eye, but along with the function that electron cat eye possesses more and more, the data that electron cat eye will be handled is also bigger and bigger, but present electron cat eye all is independent work in the use, if will guarantee the normal work of electron cat eye, can occupy the bigger network bandwidth of family undoubtedly and just can accomplish the processing work of various data to under the condition that does not increase electron cat eye preparation cost, present hardware equipment can seriously influence the treatment effeciency of electron cat eye again.
Disclosure of Invention
An object of embodiments of the present invention is to provide a task processing method, an electronic device, and a computer-readable storage medium, so that the efficiency of processing a task is greatly improved without increasing the manufacturing cost and power consumption of the electronic device and occupying too much network bandwidth.
In order to solve the above technical problem, an embodiment of the present invention provides a task processing method applied to a first electronic device, where the first electronic device is an electronic device that creates an ad hoc network, and the task processing method includes: the method comprises the steps that a first electronic device determines a task needing to be processed, divides the task needing to be processed into at least two segments, and dispatches the segments to a second electronic device which is idle in an ad hoc network for processing until all the segments are dispatched; the second electronic equipment is any electronic equipment except the first electronic equipment in the ad hoc network; the first electronic equipment determines a processing result of a task needing to be processed; the processing result of the task needing to be processed is determined according to the processing result of the second electronic equipment on the segment; when determining that the ad hoc network function needs to be closed according to a processing result of a task needing to be processed, the first electronic device sends an ad hoc network closing instruction to all electronic devices in the ad hoc network, and controls all electronic devices in the ad hoc network to close the ad hoc network function.
In order to solve the above technical problem, an embodiment of the present invention further provides an electronic device, including: at least one processor; and a memory and communication module communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor, the instructions are executed by the at least one processor to enable the at least one processor to execute the task processing method in any embodiment of the invention, and the communication module is used for establishing communication connection with other electronic devices in the ad hoc network under the control of the at least one processor.
In order to solve the above technical problem, an embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program can implement a task processing method according to any embodiment of the present invention.
Compared with the prior art, the embodiment of the invention provides a method for cooperatively processing tasks by using electronic devices in an ad hoc network, and specifically, when a first electronic device, namely the electronic device for creating the ad hoc network determines that a task needs to be processed, the task is divided into at least two segments, the divided segments are distributed to a second electronic device which is idle in the ad hoc network, namely any electronic device except the first electronic device in the ad hoc network, the second electronic device which is idle at the current moment in the ad hoc network is used for processing until all the segments divided by the first electronic device are processed, then the first electronic device determines the processing result of the whole task needing to be processed according to the processing task of the segment fed back by each second electronic device, so that the mode of cooperatively processing tasks by using the electronic devices in the ad hoc network is utilized under the condition of not changing the hardware of the electronic devices, the processing efficiency of the tasks is greatly improved, and the tasks to be processed are divided into a plurality of small segments to be processed by different electronic devices, so that each electronic device does not occupy excessive network bandwidth, and the use of other devices of users on the network bandwidth is not influenced. In addition, when the first electronic device determines that the ad hoc network function needs to be closed according to the processing result of the task needing to be processed, the first electronic device controls all the electronic devices in the ad hoc network to close the ad hoc network function by sending an ad hoc network closing instruction to all the electronic devices in the ad hoc network, so that the ad hoc network is started at any time, the time for starting the ad hoc network function by the electronic devices is greatly shortened, and the consumption of electric energy is effectively reduced.
In addition, before the first electronic device determines the task that needs to be processed, the task processing method further includes: the method comprises the steps that a first electronic device creates an ad hoc network in advance and waits for a third electronic device to join the ad hoc network; the method comprises the steps that a first electronic device receives a network access request sent by a third electronic device; the first electronic equipment sends a feedback signal allowing network access to the third electronic equipment; the first electronic equipment receives a network access response which is sent by the third electronic equipment and receives the feedback signal, allows the third electronic equipment to join the ad hoc network, and synchronizes the information of the ad hoc network to the ad hoc network information management platform; the ad hoc network information management platform is used for controlling all electronic equipment in the ad hoc network to start the ad hoc network function when any electronic equipment in the ad hoc network has a task to be processed. After the ad hoc network is created and other electronic devices are allowed to join the ad hoc network, the information of the ad hoc network is synchronized to the ad hoc network information management platform, so that when a task needs to be processed and the ad hoc network is in a closed state, all electronic devices in the ad hoc network can be controlled to start the ad hoc network function through the ad hoc network information management platform, the purpose that the ad hoc network is started when the ad hoc network needs to be used is achieved, and the loss of the electronic devices to electric quantity is greatly reduced.
In addition, before the first electronic device creates the ad hoc network in advance, the task processing method further includes: the first electronic equipment starts an equipment searching function; if the first electronic device does not search any electronic device which also starts the device searching function, the first electronic device is determined to be the electronic device used for creating the ad hoc network.
In addition, the first electronic device is an electronic device that is not in the ad hoc network and is searched by the fourth electronic device through the device search function before the ad hoc network is created.
In addition, the first electronic device determines a task to be processed, and specifically includes: the first electronic equipment receives a task needing to be processed, which is provided by fifth electronic equipment in the ad hoc network; the fifth electronic device is any one of the electronic devices in the ad hoc network except the first electronic device. According to the task processing method provided by the invention, the first electronic device for creating the ad hoc network can not only divide the task required to be processed by itself into multiple segments, but also control other idle electronic devices in the ad hoc network to cooperatively work to help process the task, and can also receive the task required to be processed provided by any electronic device in the ad hoc network, and then control other idle electronic devices to cooperatively work to complete the task processing work, so that the electronic devices in the whole ad hoc network can request other idle electronic devices to cooperate, the task required to be processed by itself can be quickly processed, the utilization rate of each electronic device and the task processing efficiency are greatly improved.
In addition, after the first electronic device divides the task to be processed into at least two segments and sends the segments to the idle second electronic device in the ad hoc network for processing, the task processing method further includes: the first electronic equipment sends the indication information of the processing result receiving object to the second electronic equipment; and the second electronic equipment receives the indication information feedback processing result of the object according to the processing result, wherein the processing result at least comprises the processing result of the fragment and the target information obtained after the fragment is processed. After the first electronic device sends the divided fragments to the idle second electronic device, the content needing to be fed back and the object needing to be fed back are issued to the second electronic device receiving the fragments, so that the electronic devices in the ad hoc network can rapidly and effectively cooperate to process the same task according to requirements, and the task processing efficiency is further improved.
In addition, the indication information of the processing result receiving object is to feed back the processing result to the first electronic device or to feed back the processing result to the fifth electronic device; when the indication information of the processing result receiving object is to feed back the processing result to the first electronic device, the first electronic device determines the processing result of the task to be processed, and the method specifically includes: the first electronic equipment receives the processing result of the fragment fed back by the second electronic equipment, and determines the processing result of the task needing to be processed according to the received processing result of the fragment; when the indication information of the processing result receiving object is to feed back the processing result to the fifth electronic device, the determining, by the first electronic device, the processing result of the task that needs to be processed specifically includes: the first electronic equipment receives a processing result of the task needing to be processed, which is fed back by the fifth electronic equipment; and the processing result of the task needing to be processed is determined by the fifth electronic equipment according to the processing result of the fragment fed back by the second electronic equipment. The invention provides two different determining modes of the task processing result, so that each electronic device in the ad hoc network can select a proper mode as required to carry out cooperative operation on the same task, and the task processing mode is more flexible.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the figures in which like reference numerals refer to similar elements and which are not to scale unless otherwise specified.
FIG. 1 is a flowchart of a task processing method according to a first embodiment of the present invention;
FIG. 2 is a flowchart of a task processing method according to a second embodiment of the present invention;
fig. 3 is a block diagram of an electronic device according to a third embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present application in various embodiments of the present invention. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments.
The first embodiment of the invention relates to a task processing method which is mainly applied to first electronic equipment. It should be noted that, the first electronic device in this embodiment specifically refers to an electronic device for creating an ad hoc network, and the electronic device may be an intelligent household appliance, such as an intelligent cat eye, an intelligent refrigerator, an intelligent television, or a user terminal, such as a mobile phone, a tablet computer, a wearable device, and so on, which are not listed here, and the second electronic device is any other electronic device in the ad hoc network except for the first electronic device.
It should be noted that, in order to ensure the smooth execution of the task processing method, before executing the task processing method, it is necessary to determine whether an ad hoc network has already been created, and if not, it is necessary to create an ad hoc network in advance by the first electronic device, and wait for a third electronic device (an electronic device that needs to join the ad hoc network, which may be multiple devices in a specified area, and is referred to as a second electronic device after joining) to join the ad hoc network. Specifically, the method comprises the following steps: after the first electronic device creates the ad hoc network, if a third electronic device requests to join the ad hoc network, that is, the first electronic device can receive the network access request sent by the third electronic device, the first electronic device needs to send a feedback signal for allowing network access to the third electronic device sending the network access request after receiving the network access request, that is, the ad hoc network which the third electronic device currently requests to join is informed to allow the joining, so that the third electronic device can make a corresponding response according to the feedback signal of allowing the network to join in the ad hoc network, after the ad hoc network is created, the first electronic device needs to synchronize the information of the ad hoc network to the ad hoc network information management platform and update the information of the ad hoc network to the ad hoc network information management platform according to a preset period, therefore, the information of the newly added electronic equipment can be ensured to be stored in the ad hoc network information management platform.
Specifically, the ad hoc network information management platform in this embodiment is a service platform, which is mainly used to store and manage relevant information of an ad hoc network, and control all electronic devices in the ad hoc network to start an ad hoc network function when any electronic device in any managed ad hoc network has a task that needs to be processed.
For example, when an intelligent cat eye a in an ad hoc network has a task to be processed, a request for starting the ad hoc network needs to be sent to an ad hoc network information management platform, after the ad hoc network information management platform receives the request for starting the ad hoc network, the ad hoc network where the ad hoc network is located is determined according to the information of the intelligent cat eye a sending the request, and an instruction for starting an ad hoc network function is sent to all intelligent cat eyes in the ad hoc network where the intelligent cat eye a is located, so that all the cat eyes in the ad hoc network are controlled to start the ad hoc network function.
In addition, it is worth mentioning that the information of the ad hoc network synchronized to the service platform in this embodiment specifically includes information of the electronic device creating the ad hoc network, that is, information of the first electronic device and information of other electronic devices added in the ad hoc network except the first electronic device.
In addition, it is worth mentioning that, in practical applications, the determination of the first electronic device for creating the ad hoc network may be specifically determined in the following manner:
one electronic device is designated as the first electronic device at will, namely each electronic device can be considered as the first electronic device in the initial state, then the device search function of the electronic device is started, specifically, the bluetooth communication module is selected, in the embodiment, the bluetooth communication module with low power consumption is selected, and therefore after the bluetooth communication module is started, excessive power consumption cannot be increased.
If the electronic device does not search any electronic device which also starts the device search function, the electronic device is determined to be a real first electronic device, namely the electronic device used for creating the ad hoc network.
If the electronic device searches for an electronic device that also starts a device search function, it needs to further determine whether the searched electronic device is already in an ad hoc network, and if the searched electronic device is not in the ad hoc network, the searched electronic device is determined to be the first electronic device.
If the searched electronic device is already in the ad hoc network, the fourth electronic device needs to obtain a real creator of the ad hoc network from the searched electronic device in the ad hoc network, use the creator as the first electronic device, and then request to join the ad hoc network.
In addition, in the process of requesting to join the ad hoc network, if a response made by the first electronic device in the current ad hoc network is not received, it indicates that the number of the electronic devices allowed to join the ad hoc network is full, or the network access request requesting to join the ad hoc network does not reach the first electronic device at all, so the electronic device applying to join the ad hoc network needs to resend the network access request, and if no response is received for many times, other first electronic devices are searched again.
In the embodiment of the present invention, the task processing method is mainly applied to a smart cat eye, and for convenience of understanding, the following detailed description is provided, and a specific flow is shown in fig. 1.
In step 101, the first electronic device determines a task that needs to be processed.
Specifically, in this embodiment, the first electronic device, i.e. the creator of the ad hoc network, is mainly used to divide the task to be processed and communicate with the second electronic device (any electronic device except itself in the ad hoc network) that is idle in the ad hoc network, such as sending the divided segments, receiving the response of the second electronic device that processes the segments, and determining the final processing result of the whole task, that is, the first electronic device plays a role in the ad hoc network as a control center for coordinating the operations of the electronic devices in the ad hoc network. Therefore, in the ad hoc network, tasks that need to be cooperatively processed by the idle second electronic device need to be determined by the first electronic device.
In addition, it is worth mentioning that, in practical applications, a plurality of electronic devices are usually disposed in the same ad hoc network, and therefore, the task that needs to be processed determined by the first electronic device serving as the control center may specifically be a task that needs to be processed and provided by a fifth electronic device in the ad hoc network, or may also be a task that needs to be processed and provided by the first electronic device itself.
It should be noted that the fifth electronic device in this embodiment is also any electronic device in the current ad hoc network except the first electronic device, that is, the fifth electronic device may be the same as the second electronic device, or may be an electronic device different from the second electronic device in the ad hoc network.
For example, in the same residential building, there are three households on the same floor, the smart cat eye a, the smart cat eye B, and the smart cat eye C are installed in each household, the three smart cat eyes are in the same ad hoc network, and the ad hoc network is created by the smart cat eye a, that is, the smart cat eye a is the first electronic device, and the smart cat eye B and the smart cat eye C are equivalent to the second electronic device, so when the task to be processed determined by the smart cat eye a is not from itself, the determined task to be processed may be from the smart cat eye B or from the smart cat eye C, at this time, the smart cat eye to be processed is provided as the fifth electronic device, in this embodiment, the definition of each electronic device does not affect each electronic device, but for easy understanding, the technical solution of the present invention is not limited.
In addition, in practical applications, if the signal of the device performing wireless communication is good enough, the range of the ad hoc network may be large enough, that is, the range may be extended from a floor to a residential building, even a cell, and specifically, the setting may be performed according to practical situations, and is not limited herein.
It should be noted that, the above is only an example, in practical applications, different electronic devices may be set according to needs, and the electronic devices may also be of different types, for example, taking a home as a unit, various intelligent home appliances in the home may all join in the same ad hoc network, and perform a cooperative processing task, which is not described herein again.
In addition, it should be noted that the tasks to be processed in this embodiment specifically refer to tasks that need to consume resources of the electronic device, such as tasks that occupy memory and a processor processes more resources, and specifically may be operations of uploading a file, downloading a file, or analyzing and processing a file, which are not listed here.
In addition, it should be noted that, in practical applications, in order to avoid that the ad hoc network is forced to be disassembled after the first electronic device actively or passively exits the ad hoc network due to network abnormality or other factors, and the work of other electronic devices in the ad hoc network is affected, the other electronic devices may be preset as standby first electronic devices, or default except the first electronic device, the first electronic device that is added into the ad hoc network is used as standby first electronic devices, that is, after the first electronic device that creates the ad hoc network exits the ad hoc network, the preset electronic device becomes the first electronic device, and continues to be used as a control center of the whole ad hoc network, and controls the ad hoc network, so as to ensure that each electronic device can cooperatively operate and smoothly perform task processing.
In addition, in practical application, it may also be configured that an actual creator of the ad hoc network withdraws from the ad hoc network, and recovers the identity of the first electronic device after rejoining the ad hoc network, or the identity of the first electronic device may not be recovered and only be used as the second electronic device, and the specific setting may be performed according to actual needs, which is not limited herein.
In step 102, the first electronic device divides the task to be processed into at least two segments.
Specifically, in this embodiment, the number of segments divided by the first electronic device may be divided according to the number of the second electronic devices currently idle in the ad hoc network, that is, the divided segments are equal to the number of the second electronic devices currently idle, so that each second electronic device idle in the ad hoc network may be effectively utilized.
In addition, in practical application, in order to further improve processing efficiency, the first electronic device can be timely dispatched to the idle second electronic device, and when the first electronic device divides a task to be processed into segments, the first electronic device can divide the task into segments according to the actual size of the task, that is, each byte can be divided into one segment, or a plurality of bytes can be divided into one segment. In addition, if the task to be processed is the audio and video file, each frame of the audio and video file can be divided into one segment. The specific dividing manner may be preset according to actual needs, and is not limited herein.
In step 103, the first electronic device sends the segment to the idle second electronic device in the ad hoc network for processing.
Specifically, since communication connections are established among the electronic devices in the ad hoc network, after dividing a task to be processed into a plurality of segments, the first electronic device may first send a request to all the second electronic devices in the ad hoc network, and receive a response from which second electronic device indicates that the second electronic device is idle, and may receive the segments for processing, and at this time, the first electronic device issues the divided segments to the idle second electronic devices until all the segments are dispatched.
It should be noted that, in practical application, when the first electronic device dispatches the divided segments to the idle second electronic devices, the segments need to be dispatched according to a preset dispatching rule, for example, if the number of the segments divided by the first electronic device is equal to the number of the idle second electronic devices in the ad hoc network, one segment may be dispatched to each idle second electronic device in sequence, that is, one segment corresponds to one second electronic device.
For example, if the number of the segments divided by the first electronic device is far greater than the number of the idle second electronic devices in the ad hoc network, the multiple segments may be distributed to the same second electronic device for processing as needed, the multiple segments distributed to the same second electronic device may be related, for example, the divided segments 1 to 3 are distributed to the second electronic device a, the segments 4 to 6 are distributed to the second electronic device B, and the like, or one divided segment may be sequentially distributed to the idle second electronic devices, and after all the idle second electronic devices are distributed, one divided segment is sequentially distributed to each idle second electronic device from the beginning until all the segments are distributed, and a specific distribution manner is not limited herein.
In addition, it should be noted that, since the task to be processed determined by the first electronic device may be from a third electronic device in the ad hoc network, that is, any electronic device in the ad hoc network except the first electronic device, in order to enable the second electronic device to feed back the processing result obtained after processing the segment to the specified electronic device, thereby further improving the overall processing efficiency of the task, for example, the processing result is directly fed back to the third electronic device providing the task to be processed, instead of feeding back to the first electronic device first and then feeding back to the third electronic device providing the task to be processed uniformly by the first electronic device, the first electronic device is required to send the indication information of the processing result receiving object to the second electronic device processing the segment after the segment is sent to the idle second electronic device, so that the second electronic device can process the segment after the segment is finished, the processing result of the response can be fed back according to the instruction information of the processing result receiving object.
Specifically, in this embodiment, the indication information of the processing result receiving object sent by the first electronic device to the second electronic device is specifically used to inform the second electronic device of what contents need to be fed back after the second electronic device processes the segment, such as a processing result (success or failure, etc.) of the segment and target information obtained after processing the segment (if the task is downloading a file from a network, the target information is the downloaded content corresponding to the segment).
In step 104, the first electronic device determines a processing result of a task that needs to be processed.
Specifically, in this embodiment, the processing result of the task that needs to be processed (i.e., whether the entire task is completed) determined by the first electronic device is specifically determined according to the processing result of the segment by the second electronic device.
It should be noted that, since the task that needs to be processed and determined by the first electronic device may be provided by the fifth electronic device in the ad hoc network or may be provided by the first electronic device itself, the manner of determining the processing result of the task that needs to be processed by the first electronic device is also different, and for facilitating understanding of the following, a detailed description is made:
if the task to be processed is determined to be provided by the first electronic device, the first electronic device sends the fragment to the idle second electronic device, and the indication information of the processing result receiving object sent to the second electronic device processing the fragment is specifically to feed back the processing result to the first electronic device. That is, the first electronic device can receive the processing result of the segment fed back by the second electronic device that processes the segment and the target information obtained after processing for the segment. Therefore, the first electronic device may directly determine the processing result of the task that needs to be processed according to the processing result of the received segment, and determine whether it is necessary to combine all the received target information obtained after processing the segment according to the processing result, so as to obtain the final target result corresponding to the task. Specifically, if the received processing results of all the segments indicate that the segment processing work of the segment has been successfully completed, the task processing result to be processed is finally determined to be that the task has been successfully completed, and at this time, the first electronic device may combine all the received target information obtained after the segment processing, so as to obtain a final target result corresponding to the task.
If the task needing to be processed is provided by the fifth electronic device in the ad hoc network, the first electronic device sends the fragment to the idle second electronic device, and then receives the instruction information of the object to be processed, wherein the instruction information is sent to the second electronic device for processing the fragment, and the instruction information indicates that the processing result is fed back to the fifth electronic device. That is, the electronic device that receives the processing result of the fragment fed back by the second electronic device that processes the fragment and the target information obtained after processing for the fragment is the fifth electronic device, not the first electronic device. Therefore, the operation of determining whether the task is completed or not, and the operation of combining the target information obtained after the segment processing to obtain the final target result corresponding to the task need to be completed by the fifth electronic device, and then the fifth electronic device notifies the first electronic device of the final processing result, that is, the processing result of the task that needs to be processed, which is determined by the first electronic device, is determined by the fifth electronic device according to the processing result of the segment fed back by the second electronic device.
It should be noted that, if the processing result of the task that needs to be processed is determined by the first electronic device to be that the task is not completed, the first electronic device further needs to continue to send unprocessed segments to the idle second electronic device for processing until the entire task is processed.
In addition, when the processing result of the task to be processed is determined by the fifth electronic device according to the processing result of the segment fed back by the second electronic device, in order to ensure that the first electronic device can know the current processing condition of the task, the fifth electronic device needs to inform the first electronic device after receiving the processing result fed back by the second electronic device each time, so that the first electronic device can know the processing condition of each segment, so as to perform corresponding remediation when an abnormality occurs, and specifically, the setting can be performed according to actual needs, which is not limited herein.
In step 105, the first electronic device sends an ad hoc network closing instruction to all electronic devices in the ad hoc network, and controls all electronic devices in the ad hoc network to close the ad hoc network function.
Specifically, the operation that the first electronic device sends the ad hoc network closing instruction to all the electronic devices in the ad hoc network needs to be determined according to the processing result of the task needing to be processed, that is, when the processing result is that the task is completely processed, the first electronic device sends the ad hoc network closing instruction to all the electronic devices in the ad hoc network, controls all the electronic devices in the ad hoc network to close the ad hoc network function, and if the processing result is that the task needing to be processed is not processed yet, the idle second electronic device continues to be controlled to process the divided segments and receive feedback until the task is determined to be processed.
Compared with the prior art, the task processing method provided in this embodiment adds a plurality of electronic devices in the same area to the same ad hoc network, so that when any one electronic device in the ad hoc network has a task to be processed, the task can be cooperatively completed by using other idle electronic devices, and therefore, the task processing efficiency is greatly improved without changing hardware of the electronic device. In addition, when the first electronic device determines that the ad hoc network function needs to be closed according to the processing result of the task needing to be processed, the first electronic device controls all the electronic devices in the ad hoc network to close the ad hoc network function by sending an ad hoc network closing instruction to all the electronic devices in the ad hoc network, so that the ad hoc network is started at any time, the time for starting the ad hoc network function by the electronic devices is greatly shortened, and the consumption of electric energy is effectively reduced.
A second embodiment of the present invention relates to a task processing method. The embodiment is further improved on the basis of the first embodiment, and the specific improvements are as follows: the method includes the steps that a first electronic device determines a task needing to be processed, divides the task needing to be processed into at least two segments, sends the segments to a second electronic device which is idle in an ad hoc network for processing, monitors whether the first electronic device receives a response of the second electronic device within a preset time, and determines whether the segments which are sent to the second electronic device before need to be sent to another idle second electronic device for processing according to a monitoring result, and the specific flow is shown in fig. 2.
Specifically, the present embodiment includes steps 201 to 207, wherein steps 201 to 203 are substantially the same as steps 101 to 103 in the first embodiment, and steps 206 and 207 are substantially the same as steps 104 and 105 in the first embodiment, which are not repeated herein, and the following differences are mainly introduced:
in step 204, the first electronic device monitors whether a response from the second electronic device is received within a preset time.
Specifically, if the first electronic device does not receive a response from the second electronic device within the preset time, step 205 is performed; otherwise, the second electronic device is considered to receive the dispatched segment and start processing, and the first electronic device only needs to execute a processing result for determining the task needing to be processed.
In step 205, the first electronic device re-dispatches the segment to another idle second electronic device for processing.
Specifically, if the first electronic device does not receive a response from the second electronic device within a preset time, the first electronic device re-dispatches the segment that is not dispatched to the second electronic device that does not respond to the second electronic device to another idle second electronic device for processing, so as to ensure that all the divided segments can be executed.
In addition, it should be noted that, in practical applications, in order to accelerate data processing, the first electronic device divides tasks to be processed into relatively small pieces, so that the number of the pieces is relatively large, and may be much larger than the number of second electronic devices currently idle in the ad hoc network, and therefore, in order to ensure that each piece can be accurately and timely processed and avoid omission, it is usually set that the first electronic device continues to dispatch the remaining pieces to the second electronic device for processing after receiving a response that the second electronic device completes processing and receiving a processing result of the piece until all pieces are dispatched.
Compared with the prior art, in the task processing provided in this embodiment, after the first electronic device sends the divided segments to the second electronic device that is idle in the ad hoc network for processing, whether the second electronic device that processes the segments gives a response to the first electronic device within the predetermined time is further monitored, so that the first electronic device can timely determine whether the sent segments are received by the second electronic device, or whether the second electronic device can complete the processing of the segments within the predetermined time after receiving the segments. In addition, when the response of the second electronic device is not received within the preset time, the first electronic device re-distributes the segment to another idle second electronic device, so that all the divided segments can be timely processed by the second electronic device, and the electronic device providing the task to be processed can timely acquire a final processing result.
The steps of the above methods are divided for clarity, and the implementation may be combined into one step or split some steps, and the steps are divided into multiple steps, so long as the steps contain the same logical relationship, which is within the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
A third embodiment of the present invention relates to an electronic device, which includes a memory, a communication module, and a processor, where a preset program is stored in the memory, the processor reads the program stored in the memory, and executes a task processing method according to the program, and the communication module is configured to establish a communication connection with another electronic device in an ad hoc network under the control of the processor.
Specifically, the structure of the electronic device is shown in fig. 3.
The electronic device includes: a memory 301, a communication module 302, and one or more processors 303, one processor 303 being exemplified in fig. 3. The memory 301, the communication module 302 and the processor 303 may be connected by a bus or other means, and the bus connection is taken as an example in fig. 3. Memory 301, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as rules that partition tasks that need to be processed in any of the method embodiments of the invention, are stored in memory 301. The communication module 302 may specifically be a wireless bluetooth communication module, and in this embodiment, a bluetooth low energy module is used, and the bluetooth low energy module is controlled by the processor 303 to implement matching with bluetooth low energy modules of other electronic devices in the ad hoc network, so that the two electronic devices establish communication connection. The processor 303 executes various functional applications and data processing of the device, i.e., implements the task processing method described in any of the method embodiments, by executing the nonvolatile software program, instructions, and modules stored in the memory 301.
The memory 301 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store a list of options, etc. Further, the memory 301 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, the memory 301 may optionally include memory located remotely from the processor 303, which may be connected to an external device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One or more modules are stored in the memory 301 and, when executed by the one or more processors 303, perform the task processing methods described in any of the method embodiments above.
The product can execute the method provided by the embodiment of the application, has corresponding functional modules and beneficial effects of the execution method, does not have detailed technical details in the embodiment, and can refer to the task processing method related to any method implementation of the invention.
A fourth embodiment of the present invention relates to a computer-readable storage medium storing a computer program. It will be understood by those skilled in the art that all or part of the processes of the above method embodiments may be implemented by a computer program to instruct relevant hardware, and the computer program stored in a computer readable storage medium in a practical application may include the processes of any of the above method embodiments. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific embodiments for practicing the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.

Claims (8)

1. A task processing method is applied to first electronic equipment, wherein the first electronic equipment is electronic equipment for creating an ad hoc network; the task processing method comprises the following steps:
the first electronic equipment creates the ad hoc network in advance and waits for a third electronic equipment to join the ad hoc network; when the first electronic equipment receives a network access request sent by the third electronic equipment, sending a feedback signal allowing network access to the third electronic equipment; the first electronic equipment receives a network access response which is sent by the third electronic equipment and receives the feedback signal, allows the third electronic equipment to join the ad hoc network, and synchronizes the information of the ad hoc network to an ad hoc network information management platform; the ad hoc network information management platform is used for controlling all electronic equipment in the ad hoc network to start an ad hoc network function when any electronic equipment in the ad hoc network has a task to be processed;
the first electronic device determines a task needing to be processed, divides the task needing to be processed into at least two segments, wherein the divided segments are equal to the number of idle second electronic devices in the ad hoc network, the second electronic devices are any electronic devices except the first electronic device in the ad hoc network, the first electronic device sends a request to all the second electronic devices in the ad hoc network, and the second electronic device returning a response to the request is determined to be the idle second electronic device;
distributing the fragments to second electronic equipment which is idle in the ad hoc network for processing until all the fragments are distributed;
the first electronic equipment sends indication information of a processing result receiving object to the second electronic equipment; the second electronic equipment receives indication information of an object according to the processing result and feeds back the processing result, wherein the processing result at least comprises the processing result of the fragment and target information obtained after the fragment is processed; the receiving object comprises a first electronic device or a third electronic device; when the task needing to be processed is determined to be from a third electronic device in the ad hoc network by the first electronic device, sending a processing result receiving object to the second electronic device as the third electronic device; after the second electronic device processes the fragments, directly feeding back a processing result to the third electronic device; the first electronic equipment determines a processing result of the task needing to be processed; wherein the processing result of the task needing to be processed is determined by the receiving object according to the processing result of the second electronic device on the segment;
and when determining that the ad hoc network function needs to be closed according to the processing result of the task needing to be processed, the first electronic equipment sends an ad hoc network closing instruction to all the electronic equipment in the ad hoc network, and controls all the electronic equipment in the ad hoc network to close the ad hoc network function.
2. The task processing method according to claim 1, wherein before the first electronic device creates the ad hoc network in advance, the task processing method further comprises:
the first electronic equipment starts an equipment searching function;
and if any electronic equipment which also starts the equipment searching function is not searched by the first electronic equipment, determining that the first electronic equipment is the electronic equipment for creating the ad hoc network.
3. The task processing method according to claim 2, wherein the first electronic device is an electronic device that is not in the ad hoc network and is searched by a fourth electronic device through a device search function before the ad hoc network is created.
4. The task processing method according to claim 3, wherein the determining, by the first electronic device, the task that needs to be processed specifically includes:
the first electronic equipment receives the task needing to be processed from fifth electronic equipment in the ad hoc network; the fifth electronic device is any one of the electronic devices in the ad hoc network except the first electronic device.
5. The task processing method according to claim 4, wherein the indication information of the processing result receiving object is to feed back the processing result to the first electronic device or to feed back the processing result to the fifth electronic device;
when the indication information of the processing result receiving object is to feed back the processing result to the first electronic device, the determining, by the first electronic device, the processing result of the task to be processed specifically includes:
the first electronic equipment receives the processing result of the fragment fed back by the second electronic equipment, and determines the processing result of the task needing to be processed according to the received processing result of the fragment;
when the indication information of the processing result receiving object is to feed back the processing result to the fifth electronic device, the determining, by the first electronic device, the processing result of the task to be processed specifically includes:
the first electronic equipment receives a processing result of the task needing to be processed, which is fed back by the fifth electronic equipment; and the processing result of the task needing to be processed is determined by the fifth electronic device according to the processing result of the fragment fed back by the second electronic device.
6. The task processing method according to claim 5, wherein after the first electronic device divides the task to be processed into at least two segments and sends the segments to a second electronic device that is idle in the ad hoc network for processing, the task processing method further comprises:
and if the first electronic equipment does not receive the response of the second electronic equipment within the preset time, re-dispatching the segment dispatched to the second electronic equipment to another idle second electronic equipment for processing.
7. An electronic device, comprising: at least one processor; and a memory and communication module communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the task processing method according to any one of claims 1 to 6, and the communication module is configured to establish a communication connection with other electronic devices in an ad hoc network under the control of the at least one processor.
8. A computer-readable storage medium storing a computer program characterized in that the computer program is executed by a processor to implement the task processing method according to any one of claims 1 to 6.
CN201710696595.2A 2017-08-15 2017-08-15 Task processing method, electronic device and computer readable storage medium Active CN107454176B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710696595.2A CN107454176B (en) 2017-08-15 2017-08-15 Task processing method, electronic device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710696595.2A CN107454176B (en) 2017-08-15 2017-08-15 Task processing method, electronic device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN107454176A CN107454176A (en) 2017-12-08
CN107454176B true CN107454176B (en) 2020-11-03

Family

ID=60491141

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710696595.2A Active CN107454176B (en) 2017-08-15 2017-08-15 Task processing method, electronic device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN107454176B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111756604B (en) * 2019-03-29 2022-04-12 华为技术有限公司 Equipment coordination method, device and system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103685416A (en) * 2012-09-20 2014-03-26 联想(北京)有限公司 Distributed task allocation and claim method and electronic devices
CN104394604A (en) * 2014-11-26 2015-03-04 武汉理工大学 Wireless ad hoc network based electronic price biding system and communication method
CN104639409A (en) * 2015-02-13 2015-05-20 广东欧珀移动通信有限公司 Method and device for automatically adding sound box to sound box ad-hoc network
CN105228131A (en) * 2015-11-05 2016-01-06 上海斐讯数据通信技术有限公司 The assist process method of operational data, system and terminal equipment
CN105338595A (en) * 2015-10-20 2016-02-17 广东欧珀移动通信有限公司 Intelligent terminal joining method, apparatus and system based on intelligent terminal system
CN105516441A (en) * 2014-09-25 2016-04-20 联想(北京)有限公司 Information processing method and device
CN105729491A (en) * 2016-04-01 2016-07-06 纳恩博(北京)科技有限公司 Executing method, device and system for robot task
CN105786603A (en) * 2016-02-29 2016-07-20 青岛海尔智能家电科技有限公司 High-concurrency service processing system and method based on distributed mode

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103685416A (en) * 2012-09-20 2014-03-26 联想(北京)有限公司 Distributed task allocation and claim method and electronic devices
CN105516441A (en) * 2014-09-25 2016-04-20 联想(北京)有限公司 Information processing method and device
CN104394604A (en) * 2014-11-26 2015-03-04 武汉理工大学 Wireless ad hoc network based electronic price biding system and communication method
CN104639409A (en) * 2015-02-13 2015-05-20 广东欧珀移动通信有限公司 Method and device for automatically adding sound box to sound box ad-hoc network
CN105338595A (en) * 2015-10-20 2016-02-17 广东欧珀移动通信有限公司 Intelligent terminal joining method, apparatus and system based on intelligent terminal system
CN105228131A (en) * 2015-11-05 2016-01-06 上海斐讯数据通信技术有限公司 The assist process method of operational data, system and terminal equipment
CN105786603A (en) * 2016-02-29 2016-07-20 青岛海尔智能家电科技有限公司 High-concurrency service processing system and method based on distributed mode
CN105729491A (en) * 2016-04-01 2016-07-06 纳恩博(北京)科技有限公司 Executing method, device and system for robot task

Also Published As

Publication number Publication date
CN107454176A (en) 2017-12-08

Similar Documents

Publication Publication Date Title
US10264424B2 (en) Information processing method and central control device
JP2019537322A (en) Network connection method for home appliances, network connection method for home appliances and home systems
CN107409270B (en) Method and apparatus for establishing a connection between devices
US20130271672A1 (en) Television manipulation method, handheld device, television, and television manipulation system
WO2019153488A1 (en) Service configuration management method, apparatus, storage medium and server
CN105093945A (en) System and method for safely controlling smart household apparatuses based on smart cloud
CN106851799B (en) Method and device for sending heartbeat packet in long connection
WO2016165242A1 (en) Method of adjusting number of nodes in system and device utilizing same
CN106100949A (en) A kind of control system for intelligent home device
CN111865736A (en) Equipment control method and device
CN104243266A (en) Method and device for network access
CN107094102A (en) The transmission method and equipment of information
CN103685530A (en) Automatic upgrade control method and system for WLAN current network APs
CN109951311B (en) Method, device, equipment and storage medium for network slice instantiation
CN107454176B (en) Task processing method, electronic device and computer readable storage medium
CN107580197B (en) Task processing method, electronic device and computer readable storage medium
CN105262604A (en) Virtual machine migration method and equipment
CN114765565A (en) Control method of intelligent device, cloud server, terminal device and storage medium
WO2023098055A1 (en) Low-power-consumption mode starting method and apparatus, storage medium, and electronic apparatus
CN110875945B (en) Method, apparatus and medium for task processing on a generic service entity
CN114630391B (en) Communication method, device and system under network co-establishment sharing scene and sharing base station
CN106961368A (en) A kind of household electrical appliances Cloud Server method of work and household electrical appliances cloud server system method of work
WO2019024173A1 (en) Batch management method for saving power of internet of things terminal devices, and relay device
CN108931923B (en) Device control method and apparatus, storage medium, and electronic apparatus
CN113300919A (en) Intelligent household appliance control method based on social software group function and intelligent household appliance

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant