CN109697117A - Terminal control method, device and computer readable storage medium - Google Patents

Terminal control method, device and computer readable storage medium Download PDF

Info

Publication number
CN109697117A
CN109697117A CN201710981418.9A CN201710981418A CN109697117A CN 109697117 A CN109697117 A CN 109697117A CN 201710981418 A CN201710981418 A CN 201710981418A CN 109697117 A CN109697117 A CN 109697117A
Authority
CN
China
Prior art keywords
terminal
heartbeat
sets
threshold values
task
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.)
Granted
Application number
CN201710981418.9A
Other languages
Chinese (zh)
Other versions
CN109697117B (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.)
China Telecom Corp Ltd
Original Assignee
China Telecom Corp 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 China Telecom Corp Ltd filed Critical China Telecom Corp Ltd
Priority to CN201710981418.9A priority Critical patent/CN109697117B/en
Publication of CN109697117A publication Critical patent/CN109697117A/en
Application granted granted Critical
Publication of CN109697117B publication Critical patent/CN109697117B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a kind of terminal control method, device and computer readable storage mediums, are related to field of computer technology.Disclosed method includes: to open heartbeat counting function in response to establishing batch tasks to multiple terminals for multiple terminals;Using heartbeat counting function, heartbeat counting is carried out to multiple terminals respectively according to the heartbeat packet of the multiple terminals received;In the case where the heartbeat counting of terminal reaches corresponding heartbeat threshold value, corresponding task is issued to the terminal;Wherein, multiple terminals are divided at least one heartbeat sets of threshold values, and different heartbeat sets of threshold values correspond to different heartbeat threshold values.The scheme of the disclosure can be realized based on heartbeat mechanism to the gray-scale Control of great amount of terminals, and the probability of happening of tidal bore phenomenon can be greatly reduced, and reduce the load pressure of server-side, improve whole control efficiency.

Description

Terminal control method, device and computer readable storage medium
Technical field
This disclosure relates to field of computer technology, in particular to a kind of terminal control method, device and computer-readable Storage medium.
Background technique
With the development of internet and the communication technology, intelligent terminal is at indispensable tool in for people's lives.Intelligence The type of terminal is more and more, and quantity is increasing, also increasing for the control difficulty of a large amount of intelligent terminal.
The order that management platform is managed intelligent terminal is varied, for example, restarting equipment, firmware updating, liter Grade installation unloading plug-in unit, switching service platform, modification parameter configuration etc..When a large amount of intelligent terminals need to be implemented task, pipe Platform is usually to these terminals while transmitting order to lower levels.
Summary of the invention
Inventor's discovery: mode of the management platform to great amount of terminals while transmitting order to lower levels, it is likely that tidal bore phenomenon can be generated, Server-side load excessive is caused, server-side collapse is even resulted in, reduces whole control efficiency.
A disclosure technical problem to be solved is: how tidal bore phenomenon is reduced when managing to great amount of terminals Generation, improve whole control efficiency.
According to some embodiments of the present disclosure, a kind of terminal control method for providing, comprising: in response to being built to multiple terminals Vertical batch tasks open heartbeat counting function for multiple terminals;Using heartbeat counting function, according to the multiple terminals received Heartbeat packet carries out heartbeat counting to multiple terminals respectively;In the case where the heartbeat counting of terminal reaches corresponding heartbeat threshold value, Corresponding task is issued to the terminal;Wherein, multiple terminals are divided at least one heartbeat sets of threshold values, different heartbeat sets of threshold values Corresponding different heartbeat threshold value.
In some embodiments, opening heartbeat counting function for multiple terminals includes: for not setting up heartbeat counting function Terminal, labeled as the terminal of heartbeat counting function to be opened, when receiving the heartbeat packet of the terminal, according in heartbeat packet should The mark of terminal inquires the terminal for being marked as heartbeat counting function to be opened of the terminal, establishes for the terminal and opens the heart Hop count function, the heartbeat counting function include: the mark of the terminal, and heartbeat counting opens flag bit, Heart rate meters And heartbeat threshold value.
In some embodiments, terminal is divided into different heartbeat sets of threshold values using following methods: according to history terminal The type of the loading condition of server-side, the loading condition at current service end and present batch task when execution task, determination are worked as The quantity for the terminal that preceding server-side can load;The quantity for the terminal that can be loaded according to current service end and with the server-side The terminal of task to be issued corresponding from the server-side is divided into the different hearts by the quantity of the terminal of corresponding task to be issued Jump sets of threshold values.
In some embodiments, terminal is divided into different heartbeat sets of threshold values using following methods: chooses preset quantity The terminal heartbeat sets of threshold values minimum as heartbeat threshold value terminal;After the terminal of current heartbeat sets of threshold values reaches heartbeat threshold value Default eartbeat interval in, choose the terminal of next heartbeat sets of threshold values, until by terminal division finish, preset eartbeat interval be pre- If each heartbeat sets of threshold values terminal between heartbeat threshold value difference;Wherein, task is executed in the terminal of current heartbeat sets of threshold values When the not up to default load threshold of corresponding server-side load in the case where, the quantity of the terminal of next heartbeat sets of threshold values is equal to upper The quantity of the terminal of one heartbeat sets of threshold values and default the sum of value of progressively increasing, it is corresponding when the terminal of current heartbeat sets of threshold values executes task Server-side load reach default load threshold in the case where, the quantity of the terminal of next heartbeat sets of threshold values is equal to upper heartbeat threshold The quantity of the terminal of value group.
In some embodiments, in the case where terminal is not online, the statistics terminal not online time;It is not online in terminal When time reaches time threshold, then reduce the heartbeat threshold value of terminal according to preset step-length.
In some embodiments, issuing corresponding task to the terminal includes: to be sent according to the mark of terminal to database Job enquiry instruction;The job enquiry of database return is received as a result, issuing corresponding task to terminal.
In some embodiments, terminal control method further include: in the case where issuing successful situation, by the corresponding heart of terminal Hop count function is closed, and is re-issued in the case where issuing failure to task, is reached threshold value issuing the frequency of failure In the case of, judge the reason of issuing unsuccessfully, is determined according to failure cause and close heartbeat counting function or resetting heartbeat counting function.
According to some embodiments of the present disclosure, a kind of terminal control mechanism for providing, comprising: heartbeat counting opening module, For opening heartbeat counting function for multiple terminals in response to establishing batch tasks to multiple terminals;Heartbeat counting module, is used for Using heartbeat counting function, heartbeat counting is carried out to multiple terminals respectively according to the heartbeat packet of the multiple terminals received;Task Module is issued, in the case where reaching corresponding heartbeat threshold value for the heartbeat counting in terminal, corresponding is issued to the terminal Business;Wherein, multiple terminals are divided at least one heartbeat sets of threshold values, and different heartbeat sets of threshold values correspond to different heartbeat threshold values.
In some embodiments, heartbeat counting opening module is used for the terminal for not setting up heartbeat counting function, label For the terminal of heartbeat counting function to be opened, when receiving the heartbeat packet of the terminal, according to the mark of the terminal in heartbeat packet The terminal for being marked as heartbeat counting function to be opened for inquiring the terminal, establishes for the terminal and opens heartbeat counting function Can, heartbeat counting function includes: the mark of terminal, and heartbeat counting opens flag bit, Heart rate meters and heartbeat threshold value.
In some embodiments, the terminal control mechanism, further includes: first terminal division module, for according to history end Loading condition, the loading condition at current service end and the type of present batch task of server-side when holding execution task, determine The quantity for the terminal that current service end can load, the quantity for the terminal that can be loaded according to current service end and with the service The terminal of task to be issued corresponding from the server-side is divided into different by the quantity for holding the terminal of corresponding task to be issued Heartbeat sets of threshold values.
In some embodiments, the terminal control mechanism, further includes: second terminal division module, for choosing present count The terminal of the terminal of the amount heartbeat sets of threshold values minimum as heartbeat threshold value, reaches heartbeat threshold value in the terminal of current heartbeat sets of threshold values In default eartbeat interval afterwards, the terminal of next heartbeat sets of threshold values is chosen, until terminal division is finished, default eartbeat interval is The difference of heartbeat threshold value between preset each heartbeat sets of threshold values terminal;Wherein, it executes and appoints in the terminal of current heartbeat sets of threshold values When business in the case where the corresponding not up to default load threshold of server-side load, the quantity of the terminal of next heartbeat sets of threshold values is equal to The quantity of the terminal of upper heartbeat sets of threshold values and default the sum of value of progressively increasing, in the terminal execution task of current heartbeat sets of threshold values pair In the case that the server-side load answered reaches default load threshold, the quantity of the terminal of next heartbeat sets of threshold values is equal to a upper heartbeat The quantity of the terminal of sets of threshold values.
In some embodiments, terminal control mechanism, further includes: heartbeat adjusts module, for not online in terminal In the case of, the statistics terminal not online time then reduces according to preset step-length when line duration does not reach time threshold to terminal The heartbeat threshold value of terminal.
In some embodiments, mission dispatching module is used to send job enquiry to database according to the mark of terminal and refer to It enables, receives the job enquiry of database return as a result, issuing corresponding task to terminal.
In some embodiments, terminal control mechanism further include: heartbeat counting function adjusts module, for judging to end End issues whether task succeeds, and in the case where issuing successful situation, the corresponding heartbeat counting function of terminal is closed, failure is being issued In the case where task is re-issued, in the case where issuing the frequency of failure and reaching threshold value, the reason of judgement issues unsuccessfully, It is determined according to failure cause and closes heartbeat counting function or resetting heartbeat counting function.
According to some embodiments of the present disclosure, a kind of terminal control mechanism for providing, comprising: memory;And it is coupled to The processor of memory, processor are configured as executing such as any one aforementioned reality based on the instruction being stored in memory devices Apply the terminal control method in example.
According to some embodiments of the present disclosure, a kind of computer readable storage medium is provided, is stored thereon with computer journey Sequence, wherein the program realizes the terminal control method in any one aforementioned embodiment when being executed by processor.
The terminal for the task that needs to be implemented is divided at least one heartbeat sets of threshold values, different heartbeat sets of threshold values pair in the disclosure Different heartbeat threshold values is answered, and then heartbeat counting is carried out to each terminal according to the heartbeat packet of each terminal, when counting reaches the heart Corresponding task is issued to terminal when jumping threshold value.The scheme of the disclosure can realize the gray scale to great amount of terminals based on heartbeat mechanism Control, can greatly reduce the probability of happening of tidal bore phenomenon, reduce the load pressure of server-side, improve whole control efficiency.
By the detailed description referring to the drawings to the exemplary embodiment of the disclosure, the other feature of the disclosure and its Advantage will become apparent.
Detailed description of the invention
In order to illustrate more clearly of the embodiment of the present disclosure or technical solution in the prior art, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Disclosed some embodiments for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 shows the flow diagram of the terminal control method of some embodiments of the present disclosure.
Fig. 2 shows the flow diagrams of the terminal control method of other embodiments of the disclosure.
Fig. 3 shows the structural schematic diagram of the terminal control mechanism of some embodiments of the present disclosure.
Fig. 4 shows the structural schematic diagram of the terminal control mechanism of other embodiments of the disclosure.
Fig. 5 shows the structural schematic diagram of the terminal control mechanism of the other embodiment of the disclosure.
Fig. 6 shows the structural schematic diagram of the terminal control mechanism of the still other embodiments of the disclosure.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present disclosure, the technical solution in the embodiment of the present disclosure is carried out clear, complete Site preparation description, it is clear that described embodiment is only disclosure a part of the embodiment, instead of all the embodiments.Below Description only actually at least one exemplary embodiment be it is illustrative, never as to the disclosure and its application or making Any restrictions.Based on the embodiment in the disclosure, those of ordinary skill in the art are not making creative work premise Under every other embodiment obtained, belong to the disclosure protection range.
For management platform to the mode of great amount of terminals while transmitting order to lower levels, it is likely that tidal bore phenomenon can be generated, cause to take End load excessive of being engaged in proposes this programme the problem of even resulting in server-side collapse, reduce whole control efficiency.
Below with reference to some embodiments of the present disclosure, the terminal control method of the disclosure is described.
Fig. 1 is the flow chart of some embodiments of disclosure terminal control method.As shown in Figure 1, the method for the embodiment It include: step S102~S106.
Step S102 opens heartbeat counting function in response to establishing batch tasks to multiple terminals for multiple terminals.
Administrator or management system can establish batch tasks according to actual needs for multiple terminals, and each terminal is corresponding Task can store in the database.It can first determine whether the quantity for needing to be implemented the terminal of task reaches gray-scale Control Threshold value, if reaching the threshold value of gray-scale Control, for each terminal open heartbeat counting function.
Heartbeat counting module can be set in terminal control mechanism (management platform), for carrying out heartbeat to each terminal It counts.Heartbeat counting function can be respectively set for each terminal in heartbeat counting module, heartbeat counting function includes: terminal Mark, heartbeat counting opens flag bit, Heart rate meters and heartbeat threshold value.The MAC of the mark of terminal for example, terminal (Media Access Control, media access control) address.Since each terminal can not necessarily send heartbeat packet on time (such as terminal fault), therefore, respectively each terminal setting Heart rate meters are more accurate.
For the terminal of heartbeat counting function has been established, then heartbeat counting function is directly opened, such as heartbeat counting is opened Opening mark position is 1.For not setting up the terminal of heartbeat counting function, labeled as the terminal of heartbeat counting function to be opened, when When receiving the heartbeat packet of the terminal, the heart to be opened is marked as according to what the mark of the terminal in heartbeat packet inquired the terminal Heartbeat counting function is established for the terminal and opened to the terminal of hop count function,
Step S104, using heartbeat counting function, according to the heartbeat packet of the multiple terminals received respectively to multiple terminals Carry out heartbeat counting.
In some embodiments, corresponding heartbeat counting function is searched according to the terminal iidentification carried in the heartbeat packet received Energy will according to the mark of the terminal in the case where being that the terminal establishes heartbeat counting function and opens heartbeat counting function The corresponding Heart rate meters of the terminal adds one;In the case where not being that the terminal establishes heartbeat counting function, for terminal foundation Heartbeat counting function, and heartbeat counting function is opened, the corresponding Heart rate meters of the terminal is added one.
Step S106 issues correspondence to the terminal in the case where the heartbeat counting of terminal reaches corresponding heartbeat threshold value Task.
In some embodiments, job enquiry instruction is sent to database according to the mark of terminal, receives database and returns Terminal task, issue the task to terminal.The corresponding task to be issued of terminal is stored in database, a terminal can Can corresponding multiple tasks, multiple tasks, which correspond to, different executes sequence.Heartbeat counting reaches the triggering of this condition of heartbeat threshold value eventually Behavior of the control device (management platform) to data base querying terminal task is held, may further be appointed further according to terminal in database The sequence of business issues task to terminal.
Multiple terminals can be divided at least one heartbeat sets of threshold values, and different heartbeat sets of threshold values correspond to different heartbeat thresholds Value.Terminal control mechanism (management platform) can show control interface to administrator, manage the letter that each terminal is shown in interface Breath, such as the various information such as task definition, terminal models, geographical location, according to actual needs draw terminal by administrator Point, and different heartbeat threshold values is set for each heartbeat sets of threshold values.For example, administrator can draw terminal according to geographical location It is divided into different heartbeat sets of threshold values, lower heartbeat threshold value is arranged to the terminal of Beijing area, preferentially triggers mission dispatching.
Terminal control mechanism (management platform) can be with the division rule of preset configuration terminal, according to the automatic root of division rule Different heartbeat sets of threshold values is divided to terminal according to the information of each terminal, and different heartbeat threshold values is set.It is described below Embodiment.
In some embodiments, the loading condition of server-side when executing task according to history terminal, current service end it is negative The type for carrying situation and present batch task, determines the quantity for the terminal that current service end can load;According to current service The quantity for holding the quantity for the terminal that can be loaded and the terminal of task to be issued corresponding with the server-side, will be with the server-side The terminal of corresponding task to be issued is divided into different heartbeat sets of threshold values.
Different terminals can correspond to different pending tasks, and different tasks may correspond to different server-sides. Such as some terminals need firmware updating, some terminals need to modify configuration parameter, respectively correspond different server-sides.
Load of each server-side of terminal control mechanism (management platform) available history when terminal executes task Situation.Terminal control mechanism (management platform) can determine corresponding server-side according to the type of present batch task, according to going through History terminal executes the stock number occupied when the task of the type, and the current corresponding remaining stock number of server-side determines current corresponding The quantity of terminal that can load of server-side.Further, by the quantity of the terminal of task to be issued divided by corresponding server-side The terminal that can be loaded quantity obtain terminal division heartbeat sets of threshold values number, also just obtained each heartbeat sets of threshold values The quantity of middle terminal.If above-mentioned quotient is non-integer, round up.
If the terminal of pending task respectively corresponds multiple and different server-sides, terminal is drawn for each server-side After being divided into different heartbeat sets of threshold values, the terminal quantity of the same heartbeat sets of threshold values of each server-side can be merged again, really The terminal quantity of fixed each heartbeat sets of threshold values.
When the quantity for the terminal that above-mentioned determining server-side can load, if the multiple-task of the server-side counterpart terminal, Then considering loading condition when needing to consider multiple terminals when server-side load while executing multiple-task respectively.For example, terminal Firmware updating and modification configuration parameter require to occupy the resource of a certain server-side, and task currently to be issued includes firmware updating It needs to refer to multiple terminals when then referring to the loading condition of the history server-side with modification configuration parameter while executing upgrading respectively The stock number of occupancy when firmware and modification two kinds of tasks of configuration parameter, and then determine the number for the terminal that the server-side can load Amount.
In some embodiments, the different server-side of terminal control mechanism (management platform) middle setting can correspond to different Task.The whole of terminal control mechanism when history terminal executes same task (management platform) is obtained according to the task currently wait issue Body occupation condition, in conjunction with history entirety occupation condition, the resource of present terminal control device (management platform) is used The quantity of the terminal of situation and task to be issued divides different heartbeat sets of threshold values to terminal.
Previous embodiment can be combined with each other, that is, referring also to terminal while referring to the loading condition of each server-side The overall load situation of control device (management platform) determines the heartbeat sets of threshold values of terminal.
In the case where historic load situation or current load situation are inconvenient to estimate, it can use and incrementally increase per wholeheartedly The mode for jumping the quantity of the terminal of sets of threshold values progressivelyes reach the balance that server-side load issues rate with terminal task.It is specific real Existing mode can refer to following embodiment.
In some embodiments, the terminal of the terminal heartbeat sets of threshold values minimum as heartbeat threshold value of preset quantity is chosen; Reach in the default eartbeat interval after heartbeat threshold value in the terminal of current heartbeat sets of threshold values, chooses the end of next heartbeat sets of threshold values The difference of heartbeat threshold value of the eartbeat interval between preset each heartbeat sets of threshold values terminal is preset until terminal division is finished in end Value;Wherein, the corresponding not up to default load threshold of server-side load when the terminal of current heartbeat sets of threshold values executes task In the case of, the quantity of the terminal of next heartbeat sets of threshold values is equal to the quantity of the terminal of upper heartbeat sets of threshold values and default progressively increase is worth it With, in the case that when the terminal of current heartbeat sets of threshold values executes task, corresponding server-side load reaches default load threshold, The quantity of the terminal of next heartbeat sets of threshold values is equal to the quantity of the terminal of upper heartbeat sets of threshold values.
For example, setting 1000 for the terminal of the minimum heartbeat sets of threshold values of heartbeat threshold value first, presetting eartbeat interval is 5 A heartbeat, default value of progressively increasing is 500.When 5 heartbeats of heartbeat threshold value of first minimum heartbeat sets of threshold values of heartbeat threshold value reach, Task is issued to the terminal of first heartbeat sets of threshold values, in subsequent 5 heartbeats, monitors the terminal pair of first heartbeat sets of threshold values The load for the server-side answered.If not up to default load threshold, sets the terminal quantity of second heartbeat sets of threshold values to 1500, correspondingly, the corresponding heartbeat threshold value of the terminal of second heartbeat sets of threshold values is then 10 heartbeats, and so on, monitoring The load of server-side when the terminal of each heartbeat sets of threshold values executes task, if reaching default load threshold, after not being further added by The quantity of terminal in continuous heartbeat sets of threshold values.
The method of above-described embodiment can also be used as assessment of the test phase to server-side load capacity, actually use When, the quantity of terminal when the server-side that the above method is measured reaches default load threshold, current service end loading condition, with And terminal is divided into different heartbeat sets of threshold values by the terminal quantity of task to be issued.
The method of the various embodiments described above is mainly used for determining the quantity of terminal in each heartbeat sets of threshold values, each heartbeat threshold value Terminal in group can randomly select, can also be with the various information of reference terminal (such as region, manufacturer, device model and use Family information) determine terminal in each heartbeat sets of threshold values, it is determined that and the heartbeat sets of threshold values of terminal, which has determined to issue terminal, appoints The sequencing of business has determined the height of terminal heartbeat threshold value.Some embodiments are described below.
In some embodiments, according to the priority of the corresponding task of each terminal, the heartbeat threshold value of each terminal is determined, it is right The priority of answering for task is higher, and the heartbeat threshold value of terminal is lower.The priority of task can be configured according to actual needs, Such as the priority etc. of the corresponding user of task urgency level, task.
Optionally, terminal is divided into different task group first, according to the priority of task, each task groups is arranged Sequence.Since the task groups of highest priority, to the terminal in task groups, it can be divided into using the method in previous embodiment Different heartbeat sets of threshold values, and the mission dispatching to terminal in the task groups is completed according to the heartbeat threshold value of each heartbeat sets of threshold values (i.e. step S102~S104).After terminal task in one task groups issues, into the worked of next task group Journey successively executes the process of above-mentioned mission dispatching to the terminal in each task groups.Terminal phase in the preceding task groups that sort For the terminal in the posterior task groups that sort, heartbeat threshold value is low, i.e. the high terminal heartbeat threshold value of task priority is low.
Dividing task groups can also be according to region, manufacturer, device model and use other than the priority of reference task The information of the various terminals such as family information can be divided according to actual needs, and the sequence of each task groups can also join It examines the information of various terminals and is determined according to actual needs.
Optionally, when a variety of tasks wait issue can be handled simultaneously, the root in the low heartbeat sets of threshold values of heartbeat threshold value According to the load capacity of the corresponding server-side of task, the high terminal of preferred selection task priority as much as possible.For example, first Heartbeat sets of threshold values is the minimum heartbeat sets of threshold values of heartbeat threshold value, and each heartbeat sets of threshold values terminal quantity is 1000, it is assumed that server-side Can handle two kinds of different priorities of the task, in the case where server-side, which loads, to be allowed, in first heartbeat sets of threshold values and The high terminal of the priority of corresponding task is preferentially chosen in preceding several heartbeat sets of threshold values.
Optionally, the interval of the heartbeat threshold value of different heartbeat sets of threshold values is adjusted according to the priority of task.For example, task is excellent First grade is high, and the interval of the heartbeat threshold value of different heartbeat sets of threshold values is short.
The terminal of task to be issued is divided at least one heartbeat sets of threshold values, different heartbeats in the method for above-described embodiment Sets of threshold values corresponds to different heartbeat threshold values, and then carries out heartbeat counting to each terminal according to the heartbeat packet of each terminal, works as meter Number issues corresponding task to terminal when reaching heartbeat threshold value.The method of above-described embodiment can be realized based on heartbeat mechanism to big The gray-scale Control for measuring terminal, can greatly reduce the probability of happening of tidal bore phenomenon, reduce the load pressure of server-side, improve whole Manage efficiency.In addition, the method for above-described embodiment will not influence the fortune of history batch tasks when issuing batch tasks to terminal Row further increases whole control effect relative to the continuous scheme closed history batch tasks and avoid server load excessive.
The case where according to the heartbeat packet for receiving terminal, it can be determined that whether terminal is online, for terminal not online for a long time Its adjustable heartbeat threshold value.In some embodiments, in the case where terminal is not online, the statistics terminal not online time; When line duration does not reach time threshold to terminal, then reduce the heartbeat threshold value of terminal according to preset step-length.
For example, the heartbeat threshold value of a terminal script is 10 heartbeats, but the terminal continuous three days all no online, then Its heartbeat threshold value is reset to 3.Because online probability is not relatively low again for online equipment for a long time, and its online behavior is logical It is often random, is generally not in tidal bore.
The method of above-described embodiment carries out task to terminal using heartbeat mechanism and issues, it can be found that terminal does not exist Linear state reduces the polling procedure to terminal, saves signal resource, improves whole control efficiency.
Other embodiments of disclosure terminal control method are described below with reference to Fig. 2.
Fig. 2 is the flow chart of some embodiments of disclosure terminal control method.As shown in Fig. 2, the method for the embodiment It include: step S202~S220.
Step S202 opens heartbeat counting function in response to establishing batch tasks to terminal for terminal.
The terminal for establishing batch tasks has multiple, and step S202~S220 is the terminal for each task to be issued The step of needing to be implemented.
Step S204 carries out heartbeat counting to terminal according to the heartbeat packet of the terminal received using heartbeat counting function.
Multiple terminals are divided at least one heartbeat sets of threshold values, and different heartbeat sets of threshold values correspond to different heartbeat threshold values.
Step S206, judges whether the heartbeat counting of terminal reaches corresponding heartbeat threshold value, if so, thening follow the steps S208, otherwise, weight step S204 are repeated.
Step S208 sends job enquiry instruction to database according to the mark of terminal.
Step S210 receives the job enquiry of database return as a result, issuing corresponding task to terminal.
Step S212, judges whether task issues success, if so, thening follow the steps S214, otherwise, executes step S216。
Step S214 closes the heartbeat counting function of terminal.
Step S216, judgement issue whether the frequency of failure reaches threshold value.If so, thening follow the steps S218, otherwise, execute Step S220.
The reason of step S218, judgement issues unsuccessfully, determines according to failure cause and closes heartbeat counting function or the resetting heart Hop count function.
For example, recording terminal abnormal situation, and close heartbeat counting in the case where terminal abnormal (such as returning to failure code) Function waits subsequent processing.In terminal not online (during heartbeat counting offline) or in the case where without response, by the heart of terminal Hop counter resets to 0, restarts to count, and waits when reaching heartbeat threshold value next time, again to issue the task of failure to Terminal is issued, can also the heartbeat threshold value according to actual needs to terminal not online or without response modify, such as Reduce heartbeat threshold value.
Step S220, re-issues task.Return step S212 restarts to execute.
The disclosure also provides a kind of terminal control mechanism, is described below with reference to Fig. 3.
Fig. 3 is the structure chart of some embodiments of disclosure terminal control mechanism.As shown in figure 3, terminal control mechanism 30 It include: heartbeat counting opening module 302, heartbeat counting module 304 and mission dispatching module 306.
Heartbeat counting opening module 302, for opening the heart for multiple terminals in response to establishing batch tasks to multiple terminals Hop count function.Heartbeat counting opening module 302 can for example execute the step S102 of above-described embodiment.
In some embodiments, heartbeat counting opening module 302 is used for the terminal for not setting up heartbeat counting function, mark It is denoted as the terminal of heartbeat counting function to be opened, when receiving the heartbeat packet of the terminal, according to the mark of the terminal in heartbeat packet Know the terminal for being marked as heartbeat counting function to be opened for inquiring the terminal, is established for the terminal and open heartbeat counting function Can, heartbeat counting function includes: the mark of terminal, and heartbeat counting opens flag bit, Heart rate meters and heartbeat threshold value.
Heartbeat counting module 304, for utilizing the heartbeat counting function, according to the heartbeat packet of the multiple terminals received Heartbeat counting is carried out to multiple terminals respectively.Heartbeat counting module 304 can for example execute the step S104 of above-described embodiment.
Mission dispatching module 306, in the case where reaching corresponding heartbeat threshold value for the heartbeat counting in terminal, to the end End issues corresponding task.Mission dispatching module 306 can for example execute the step S106 of above-described embodiment.
Multiple terminals are divided at least one heartbeat sets of threshold values, and different heartbeat sets of threshold values correspond to different heartbeat threshold values.
In some embodiments, mission dispatching module 306 is used to send job enquiry to database according to the mark of terminal Instruction receives the job enquiry of database return as a result, issuing corresponding task to terminal.
Other embodiments of disclosure terminal control mechanism are described below with reference to Fig. 4,
Fig. 4 is the structure chart of other embodiments of disclosure terminal control mechanism.As shown in figure 4, terminal control mechanism 40 include: heartbeat counting opening module 402, heartbeat counting module 404 and mission dispatching module 406, first terminal division module 408。
Heartbeat counting is opened in heartbeat counting opening module 402, heartbeat counting module 404 and mission dispatching module 406 and Fig. 3 Module 302 is opened, heartbeat counting module 304 and the function of mission dispatching module 306 are similar respectively.
First terminal division module 408, the loading condition of server-side, current clothes when for executing task according to history terminal The loading condition at business end and the type of present batch task, determine the quantity for the terminal that current service end can load, according to The quantity of the terminal of the quantity for the terminal that current service end can load and task to be issued corresponding with the server-side, will be with The terminal of the corresponding task to be issued of the server-side is divided into different heartbeat sets of threshold values.
In some embodiments, it can use second terminal division module 410 and replace first terminal division module 408.
Second terminal division module 410, terminal for the choosing preset quantity heartbeat threshold value minimum as heartbeat threshold value The terminal of group reaches in the default eartbeat interval after heartbeat threshold value in the terminal of current heartbeat sets of threshold values, chooses next heartbeat threshold The terminal of value group presets heartbeat of the eartbeat interval between preset each heartbeat sets of threshold values terminal until terminal division is finished The difference of threshold value.
The corresponding not up to default load threshold of server-side load when the terminal of current heartbeat sets of threshold values executes task In the case of, the quantity of the terminal of next heartbeat sets of threshold values is equal to the quantity of the terminal of upper heartbeat sets of threshold values and default progressively increase is worth it With, in the case that when the terminal of current heartbeat sets of threshold values executes task, corresponding server-side load reaches default load threshold, The quantity of the terminal of next heartbeat sets of threshold values is equal to the quantity of the terminal of upper heartbeat sets of threshold values.
In some embodiments, terminal control mechanism 40 can also include: heartbeat adjustment module 412, for terminal not In the case where online, the statistics terminal not online time, when line duration does not reach time threshold to terminal, then according to default step The long heartbeat threshold value for reducing terminal.
In some embodiments, terminal control mechanism 40 can also include: heartbeat counting function adjustment module 414, be used for Judge to issue whether task succeeds to terminal, in the case where issuing successful situation, the corresponding heartbeat counting function of terminal is closed, Task is re-issued in the case where issuing failure, in the case where issuing the frequency of failure and reaching threshold value, judgement issues mistake The reason of losing determines according to failure cause and closes heartbeat counting function or resetting heartbeat counting function.
Terminal control mechanism in embodiment of the disclosure can realize respectively by various calculating equipment or computer system, under Face combines Fig. 5 and Fig. 6 to be described.
Fig. 5 is the structure chart of some embodiments of disclosure terminal control mechanism.As shown in figure 5, the device of the embodiment 50 include: memory 510 and the processor 520 for being coupled to the memory 510, and processor 520 is configured as being based on being stored in Instruction in memory 510 executes the terminal control mechanism method in the disclosure in any some embodiments.
Wherein, memory 510 is such as may include system storage, fixed non-volatile memory medium.System storage Device is for example stored with operating system, application program, Boot loader (Boot Loader), database and other programs etc..
Fig. 6 is the structure chart of other embodiments of disclosure terminal control mechanism.As shown in fig. 6, the dress of the embodiment Setting 60 includes: memory 610 and processor 620, similar with memory 510 and processor 520 respectively.It can also include defeated Enter output interface 630, network interface 640, memory interface 650 etc..These interfaces 630,640,650 and memory 610 and place It can for example be connected by bus 660 between reason device 620.Wherein, input/output interface 630 is display, mouse, keyboard, touching It touches the input-output equipment such as screen and connecting interface is provided.Network interface 640 provides connecting interface for various networked devices, such as can be with It is connected to database server or cloud storage server etc..Memory interface 650 is that the external storages such as SD card, USB flash disk mention For connecting interface.
The disclosure also provides a kind of computer readable storage medium, is stored thereon with computer program, wherein the program quilt Processor realizes the terminal control method in any one aforementioned embodiment when executing.
Those skilled in the art should be understood that embodiment of the disclosure can provide as method, system or computer journey Sequence product.Therefore, complete hardware embodiment, complete software embodiment or combining software and hardware aspects can be used in the disclosure The form of embodiment.Moreover, it wherein includes the calculating of computer usable program code that the disclosure, which can be used in one or more, Machine can use the meter implemented in non-transient storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) The form of calculation machine program product.
The disclosure is referring to method, the process of equipment (system) and computer program product according to the embodiment of the present disclosure Figure and/or block diagram describe.It is interpreted as to be realized by computer program instructions each in flowchart and/or the block diagram The combination of process and/or box in process and/or box and flowchart and/or the block diagram.It can provide these computer journeys Sequence instruct to general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices processor with A machine is generated, so that the instruction generation executed by computer or the processor of other programmable data processing devices is used for Realize the dress for the function of specifying in one or more flows of the flowchart and/or one or more blocks of the block diagram It sets.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
The foregoing is merely the preferred embodiments of the disclosure, not to limit the disclosure, all spirit in the disclosure and Within principle, any modification, equivalent replacement, improvement and so on be should be included within the protection scope of the disclosure.

Claims (16)

1. a kind of terminal control method, comprising:
In response to establishing batch tasks to multiple terminals, heartbeat counting function is opened for the multiple terminal;
Using the heartbeat counting function, according to the heartbeat packet of the multiple terminal received respectively to the multiple terminal into Row heartbeat counting;
In the case where the heartbeat counting of terminal reaches corresponding heartbeat threshold value, corresponding task is issued to the terminal;
Wherein, the multiple terminal is divided at least one heartbeat sets of threshold values, and different heartbeat sets of threshold values correspond to different heartbeats Threshold value.
2. terminal control method according to claim 1, wherein described to open heartbeat counting function for the multiple terminal Include:
For not setting up the terminal of heartbeat counting function, labeled as the terminal of heartbeat counting function to be opened, when receiving the end When the heartbeat packet at end, heartbeat counting function to be opened is marked as according to what the mark of the terminal in heartbeat packet inquired the terminal Terminal, heartbeat counting function is established and opened for the terminal, the heartbeat counting function includes: the mark of the terminal, the heart Hop count opens flag bit, Heart rate meters and heartbeat threshold value.
3. terminal control method according to claim 1, wherein
Terminal is divided into different heartbeat sets of threshold values using following methods:
The loading condition of server-side, the loading condition at current service end and present batch are appointed when executing task according to history terminal The type of business determines the quantity for the terminal that current service end can load;
The terminal of the quantity and task to be issued corresponding with the server-side for the terminal that can be loaded according to current service end The terminal of task to be issued corresponding from the server-side is divided into different heartbeat sets of threshold values by quantity.
4. terminal control method according to claim 1, wherein
Terminal is divided into different heartbeat sets of threshold values using following methods:
The terminal of the terminal of the selection preset quantity heartbeat sets of threshold values minimum as heartbeat threshold value;
Reach in the default eartbeat interval after heartbeat threshold value in the terminal of current heartbeat sets of threshold values, chooses next heartbeat sets of threshold values Terminal, until terminal division is finished, heartbeat threshold of the default eartbeat interval between preset each heartbeat sets of threshold values terminal The difference of value;
Wherein, when the terminal of current heartbeat sets of threshold values heartbeat sets of threshold values executes task, corresponding server-side load is not up to default In the case where load threshold, the quantity of the terminal of next heartbeat sets of threshold values heartbeat sets of threshold values is equal to upper heartbeat sets of threshold values heartbeat threshold The quantity of the terminal of value group and default the sum of value of progressively increasing, in the terminal execution task of current heartbeat sets of threshold values heartbeat sets of threshold values pair In the case that the server-side load answered reaches default load threshold, the quantity etc. of the terminal of next heartbeat sets of threshold values heartbeat sets of threshold values The quantity of the terminal of Yu Shangyi heartbeat sets of threshold values heartbeat sets of threshold values.
5. terminal control method according to claim 1-4, wherein
In the case where terminal is not online, the statistics terminal not online time;
When line duration does not reach time threshold to the terminal, then reduce the heartbeat threshold value of the terminal according to preset step-length.
6. terminal control method according to claim 1-4, wherein
The described pair of terminal issues corresponding task
Job enquiry instruction is sent to database according to the mark of terminal;
The job enquiry of database return is received as a result, issuing corresponding task to terminal.
7. terminal control method according to claim 1-4, further includes:
Judge to issue whether task succeeds to terminal;
In the case where issuing successful situation, the corresponding heartbeat counting function of terminal is closed;
Task is re-issued in the case where issuing failure, in the case where issuing the frequency of failure and reaching threshold value, judgement The reason of issuing unsuccessfully, is determined according to failure cause and close heartbeat counting function or resetting heartbeat counting function.
8. a kind of terminal control mechanism, comprising:
Heartbeat counting opening module, for opening heartbeat for the multiple terminal in response to establishing batch tasks to multiple terminals Tally function;
Heartbeat counting module, for utilizing the heartbeat counting function, according to the heartbeat packet of the multiple terminal received point It is other that heartbeat counting is carried out to the multiple terminal;
Mission dispatching module in the case where reaching corresponding heartbeat threshold value for the heartbeat counting in terminal, issues the terminal Corresponding task;
Wherein, the multiple terminal is divided at least one heartbeat sets of threshold values, and different heartbeat sets of threshold values correspond to different heartbeats Threshold value.
9. terminal control mechanism according to claim 8, wherein
The heartbeat counting opening module is used for the terminal for not setting up heartbeat counting function, is labeled as heartbeat counting to be opened The terminal of function inquires the quilt of the terminal according to the mark of the terminal in heartbeat packet when receiving the heartbeat packet of the terminal Labeled as the terminal of heartbeat counting function to be opened, heartbeat counting function, the heartbeat counting function are established and opened for the terminal It can include: the mark of the terminal, heartbeat counting opens flag bit, Heart rate meters and heartbeat threshold value.
10. terminal control mechanism according to claim 8, further includes:
First terminal division module, the loading condition of server-side when for executing task according to history terminal, current service end The type of loading condition and present batch task determines the quantity for the terminal that current service end can load, according to current clothes The quantity of the terminal of the quantity and task to be issued corresponding with the server-side for the terminal that business end can load, will be with the service The terminal of corresponding task to be issued is held to be divided into different heartbeat sets of threshold values.
11. terminal control mechanism according to claim 8, further includes:
Second terminal division module, the end of terminal for the choosing preset quantity heartbeat sets of threshold values minimum as heartbeat threshold value End reaches in the default eartbeat interval after heartbeat threshold value in the terminal of current heartbeat sets of threshold values, chooses next heartbeat sets of threshold values Terminal, until terminal division is finished, heartbeat threshold of the default eartbeat interval between preset each heartbeat sets of threshold values terminal The difference of value;
Wherein, the corresponding not up to default load threshold of server-side load when the terminal of current heartbeat sets of threshold values executes task In the case of, the quantity of the terminal of next heartbeat sets of threshold values is equal to the quantity of the terminal of upper heartbeat sets of threshold values and default progressively increase is worth it With, in the case that when the terminal of current heartbeat sets of threshold values executes task, corresponding server-side load reaches default load threshold, The quantity of the terminal of next heartbeat sets of threshold values is equal to the quantity of the terminal of upper heartbeat sets of threshold values.
12. according to the described in any item terminal control mechanisms of claim 8-11, further includes:
Heartbeat adjusts module, for the statistics terminal not online time, not existing in the terminal in the case where terminal is not online When the line time reaches time threshold, then reduce the heartbeat threshold value of the terminal according to preset step-length.
13. according to the described in any item terminal control mechanisms of claim 8-12, wherein
The mission dispatching module is used to send job enquiry instruction to database according to the mark of terminal, receives database and returns Job enquiry as a result, issuing corresponding task to terminal.
14. according to the described in any item terminal control mechanisms of claim 8-12, further includes:
Heartbeat counting function adjusts module, issues whether task succeeds to terminal for judging, will in the case where issuing successful situation The corresponding heartbeat counting function of terminal is closed, and is re-issued in the case where issuing failure to task, secondary issuing unsuccessfully In the case that number reaches threshold value, the reason of issuing unsuccessfully is judged, determined according to failure cause and close heartbeat counting function or resetting Heartbeat counting function.
15. a kind of terminal control mechanism, comprising:
Memory;And
It is coupled to the processor of the memory, the processor is configured to based on the finger being stored in the memory devices It enables, executes such as the described in any item terminal control methods of claim 1-7.
16. a kind of computer readable storage medium, is stored thereon with computer program, wherein when the program is executed by processor The step of realizing any one of claim 1-7 the method.
CN201710981418.9A 2017-10-20 2017-10-20 Terminal control method, terminal control device and computer-readable storage medium Active CN109697117B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710981418.9A CN109697117B (en) 2017-10-20 2017-10-20 Terminal control method, terminal control device and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710981418.9A CN109697117B (en) 2017-10-20 2017-10-20 Terminal control method, terminal control device and computer-readable storage medium

Publications (2)

Publication Number Publication Date
CN109697117A true CN109697117A (en) 2019-04-30
CN109697117B CN109697117B (en) 2021-03-09

Family

ID=66225157

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710981418.9A Active CN109697117B (en) 2017-10-20 2017-10-20 Terminal control method, terminal control device and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN109697117B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110572292A (en) * 2019-10-30 2019-12-13 北京永亚普信科技有限责任公司 high availability system and method based on unidirectional transmission link
CN113612624A (en) * 2021-06-29 2021-11-05 济南浪潮数据技术有限公司 Method and device for processing heartbeat between nodes
WO2023174043A1 (en) * 2022-03-14 2023-09-21 华为技术有限公司 Power line communication system, and in-network state detection method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105808334A (en) * 2016-03-04 2016-07-27 山东大学 MapReduce short job optimization system and method based on resource reuse
US20170032300A1 (en) * 2015-07-31 2017-02-02 International Business Machines Corporation Dynamic selection of resources on which an action is performed
CN106874487A (en) * 2017-02-21 2017-06-20 国信优易数据有限公司 A kind of distributed reptile management system and its method
US9766942B2 (en) * 2013-11-01 2017-09-19 Sony Corporation Control device, processing device, and information processing method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9766942B2 (en) * 2013-11-01 2017-09-19 Sony Corporation Control device, processing device, and information processing method
US20170032300A1 (en) * 2015-07-31 2017-02-02 International Business Machines Corporation Dynamic selection of resources on which an action is performed
CN105808334A (en) * 2016-03-04 2016-07-27 山东大学 MapReduce short job optimization system and method based on resource reuse
CN106874487A (en) * 2017-02-21 2017-06-20 国信优易数据有限公司 A kind of distributed reptile management system and its method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110572292A (en) * 2019-10-30 2019-12-13 北京永亚普信科技有限责任公司 high availability system and method based on unidirectional transmission link
CN113612624A (en) * 2021-06-29 2021-11-05 济南浪潮数据技术有限公司 Method and device for processing heartbeat between nodes
CN113612624B (en) * 2021-06-29 2023-01-06 济南浪潮数据技术有限公司 Method and device for processing heartbeat between nodes
WO2023174043A1 (en) * 2022-03-14 2023-09-21 华为技术有限公司 Power line communication system, and in-network state detection method and device

Also Published As

Publication number Publication date
CN109697117B (en) 2021-03-09

Similar Documents

Publication Publication Date Title
CN108776934B (en) Distributed data calculation method and device, computer equipment and readable storage medium
CN105900064B (en) The method and apparatus for dispatching data flow task
CN108322345A (en) A kind of dissemination method and server of fault restoration data packet
CN109118097B (en) Reliability maintainability guarantee assessment method and device
CN104834602B (en) A kind of program dissemination method, device and program delivery system
CN110162388A (en) A kind of method for scheduling task, system and terminal device
CN111404838A (en) Message processing method, device and equipment
CN109933405A (en) Virtual machine creation method and device, electronic equipment, storage medium
CN110308980A (en) Batch processing method, device, equipment and the storage medium of data
CN109697117A (en) Terminal control method, device and computer readable storage medium
CN109800204A (en) Data distributing method and Related product
CN109766172A (en) A kind of asynchronous task scheduling method and device
CN110389822A (en) The node scheduling method, apparatus and server of execution task
CN108616553B (en) Method and device for resource scheduling of cloud computing resource pool
CN114706680A (en) Data processing method and device and computer equipment
CN114461407B (en) Data processing method, data processing device, distribution server, data processing system, and storage medium
CN109086289A (en) A kind of media data processing method, client, medium and equipment
CN116307546A (en) Task intelligent decision system based on robot community
CN115658311A (en) Resource scheduling method, device, equipment and medium
CN105471938A (en) Server load management method and server load management device
CN110083506A (en) The method and device of cluster resource amount optimization
CN115509931A (en) System-based performance test method and device, electronic equipment and storage medium
CN114880079A (en) Kubernetes cluster scale adjustment method, system and equipment based on reinforcement learning
CN113641688A (en) Node updating method, related device and computer program product
CN112925640A (en) Cluster training node distribution method and electronic equipment

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