CN109347918A - Call method, calling device, server, terminal and computer readable storage medium - Google Patents

Call method, calling device, server, terminal and computer readable storage medium Download PDF

Info

Publication number
CN109347918A
CN109347918A CN201811081305.4A CN201811081305A CN109347918A CN 109347918 A CN109347918 A CN 109347918A CN 201811081305 A CN201811081305 A CN 201811081305A CN 109347918 A CN109347918 A CN 109347918A
Authority
CN
China
Prior art keywords
delayed tasks
server
client
delayed
sent
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.)
Pending
Application number
CN201811081305.4A
Other languages
Chinese (zh)
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.)
Wuba Co Ltd
Original Assignee
Wuba 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 Wuba Co Ltd filed Critical Wuba Co Ltd
Priority to CN201811081305.4A priority Critical patent/CN109347918A/en
Publication of CN109347918A publication Critical patent/CN109347918A/en
Pending legal-status Critical Current

Links

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
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • 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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • 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
    • 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/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • 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
    • 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
    • H04L67/62Establishing a time schedule for servicing the requests

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (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)

Abstract

The invention discloses a kind of call method, calling device, server, terminal and computer readable storage mediums, wherein call method includes the following steps: to receive the delayed tasks that each client is sent;The delayed tasks received are stored, and monitor the calling opportunity of the delayed tasks;According to the calling opportunity, delayed tasks described in the client executing are called.Delayed tasks in client by being stored in server-side by the present invention, timing monitoring is carried out to delayed tasks using server-side, when arrival timing time, task then is sent to client using server-side and executes the notice of task, it realizes server-side and uniformly calls client, solve it is existing in the prior art due to cannot uniformly call client executing task, and caused by load imbalance the problem of.

Description

Call method, calling device, server, terminal and computer readable storage medium
Technical field
The present invention relates to field of communication technology more particularly to a kind of call method, calling device, server, terminal and meters Calculation machine readable storage medium storing program for executing.
Background technique
Local scheduling system (such as: quartz, crontab, timer) when local memory executes scheduler task, pass through Crtontab similar expression formula deadline configuration, passes through the specified method finishing service demand executed.
However in the prior art, the load balancing that cannot complete distributed system, due to quartz, crontab etc. can only Realize that local calling, all business can only all be executed in the machine of addition scheduling, be caused in task execution in a distributed system Single machine load is too high, or can only add and dispatch in all machines of distributed type assemblies, and maintenance complexity in this way can be higher.
As it can be seen that there is the problem of cannot uniformly calling client, thereby resulting in load imbalance in existing dispatching method.
Summary of the invention
The embodiment of the present invention provides a kind of call method, calling device, server, terminal and storage medium, to solve It is existing in the prior art uniformly to call client, and caused by load imbalance the problem of.
In a first aspect, the embodiment of the present invention provides a kind of call method, the described method comprises the following steps:
Receive the delayed tasks that each client is sent;
The delayed tasks received are stored, and monitor the calling opportunity of the delayed tasks;
According to the calling opportunity, delayed tasks described in the client executing are called.
Optionally, the delayed tasks for receiving each client and sending, specifically include: receiving the process that each client is sent Serializing treated delayed tasks, and unserializing processing is carried out to the delayed tasks received and obtains task definition.
Optionally, described to call delayed tasks described in the client executing according to the calling opportunity, it specifically includes: according to According to the calling opportunity, to corresponding in the way of the long connection of transmission control protocol TCP or using Enterprise Service Bus ESB Client sends the delayed tasks and executes the notice of the delayed tasks.
Second aspect, the embodiment of the present invention provide a kind of call method, comprising the following steps:
Determine delayed tasks;
The delayed tasks are sent to server-side;
When being called by the server-side, the delayed tasks are executed.
Optionally, the determining delayed tasks, specifically include: determining according to the access record of user and the demand of business side Delayed tasks.
Optionally, the delayed tasks are sent to server-side, specifically included: the delayed tasks are carried out at serializing Reason, then will treated that task is sent to server-side by serializing.
Optionally, described when being called by the server-side, the delayed tasks are executed, are specifically included:
Receive the delayed tasks and the notice for executing the delayed tasks that server-side is sent;
According to the notice, the task definition is executed.
Optionally, described to receive the delayed tasks and the notice for executing the delayed tasks that server-side is sent, it specifically includes:
Receive the delayed tasks and the notice for executing the delayed tasks that server-side is sent in the way of TCP long connection;
Alternatively, receiving the delayed tasks and execute the delayed tasks that server-side is sent using ESB Enterprise Service Bus Notice.
The third aspect, the embodiment of the present invention provide a kind of calling device, comprising: receiving module, monitoring module and calling mould Block
The receiving module, the delayed tasks sent for receiving each client;
The monitoring module, for storing the delayed tasks received, and when monitoring the calling of the delayed tasks Machine;
The calling module calls delayed tasks described in the client executing according to the calling opportunity.
Optionally, the receiving module is specifically used for when receiving the delayed tasks that each client is sent: receiving each visitor Family end send by serializing treated delayed tasks, and unserializing processing is carried out to the delayed tasks received and is obtained Task definition.
Optionally, the calling module calls delayed tasks described in the client executing according to the calling opportunity When, it is specifically used for: according to the calling opportunity, in the way of the long connection of transmission control protocol TCP or utilizes enterprises service Bus ESB sends the delayed tasks to corresponding client and executes the notice of the delayed tasks.
Fourth aspect, the embodiment of the present invention provide a kind of calling device, comprising: determining module, sending module execute mould Block;
The determining module, for determining delayed tasks;
The sending module, for the delayed tasks to be sent to server-side;
The execution module, for executing the delayed tasks when being called by the server-side.
Optionally, the determining module is specifically used for when determining delayed tasks, the access record and industry according to user The demand of business side determines delayed tasks.
Optionally, the sending module is specifically used for when the delayed tasks are sent to server-side: prolonging to described When task carry out serializing processing, then will treated that task is sent to server-side by serializing.
Optionally, the execution module when executing the delayed tasks, is specifically used for when being called by the server-side:
Receive the delayed tasks and the notice for executing the delayed tasks that server-side is sent;
According to the notice, the task definition is executed.
Optionally, the execution module is receiving the delayed tasks and execute the logical of the delayed tasks that server-side is sent When knowing, it is specifically used for: receives the delayed tasks and execute the delayed tasks that server-side is sent in the way of TCP long connection Notice;
Alternatively, receiving the delayed tasks and execute the delayed tasks that server-side is sent using ESB Enterprise Service Bus Notice.
5th aspect, the embodiment of the present invention provide a kind of server, and the server includes memory, processor and storage On the memory and the computer program that can run on the processor, the computer program are held by the processor The step of following method is realized when row:
Receive the delayed tasks that each client is sent;
The delayed tasks received are stored, and monitor the calling opportunity of the delayed tasks;
According to the calling opportunity, delayed tasks described in the client executing are called.
6th aspect, the embodiment of the present invention provide a kind of terminal, and the terminal includes: memory, processor and is stored in On the memory and the computer program that can run on the processor, the computer program are executed by the processor The following method and step of Shi Shixian:
Determine delayed tasks;
The delayed tasks are sent to server-side;
When being called by the server-side, the delayed tasks are executed.
7th aspect, the embodiment of the present invention provide a kind of storage medium, are stored with computer program on the storage medium, The step of computer program realizes following method when being executed by processor:
Receive the delayed tasks that each client is sent;
The delayed tasks received are stored, and monitor the calling opportunity of the delayed tasks;
According to the calling opportunity, delayed tasks described in the client executing are called.
Alternatively, realizing following method and step:
Determine delayed tasks;
The delayed tasks are sent to server-side;
When being called by the server-side, the delayed tasks are executed.
The embodiment of the present invention appoints delay by the way that the delayed tasks in client are stored in server-side, using server-side The calling opportunity of business is monitored, and foundation is called opportunity, calling client executing delayed tasks, in present invention implementation, server-side When calling client executing delayed tasks, can be called according to the task situation of each client, thus by delayed tasks It evenly distributes to each client, realizes server-side and uniformly call client executing task, solve and loaded not in existing scheduling Balanced problem.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention, And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 is a kind of flow chart for call method that first embodiment of the invention provides;
Fig. 2 is a kind of flow chart for call method that second embodiment of the invention provides;
Fig. 3 is a kind of flow chart for call method that third embodiment of the invention provides;
Fig. 4 is a kind of flow chart for call method that fourth embodiment of the invention provides;
Fig. 5 is a kind of structural block diagram for calling device that fifth embodiment of the invention provides;
Fig. 6 is a kind of structural block diagram for calling device that sixth embodiment of the invention provides;
Fig. 7 is a kind of block diagram for server that seventh embodiment of the invention provides;
Fig. 8 is a kind of structural block diagram for terminal that eighth embodiment of the invention provides;
Fig. 9 is a kind of structure chart for server that tenth embodiment of the invention provides;
Figure 10 is a kind of simple class figure for server that tenth embodiment of the invention provides;
Figure 11 is a kind of structure chart for client that tenth embodiment of the invention provides;
Figure 12 is a kind of simple class figure for client that tenth embodiment of the invention provides;
A kind of flow chart for calling system that Figure 13 tenth embodiment of the invention provides.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure It is fully disclosed to those skilled in the art.
First embodiment of the invention provides a kind of call method, and the method can be, but not limited to be applied to server-side, such as Shown in Fig. 1, comprising the following specific steps
Step S11 receives the delayed tasks that each client is sent;
Delayed tasks are to determine task according to the access record of user and the demand of business side in the present embodiment.It is exemplary , specific delayed tasks can be the page/trick of renting a house that the corresponding client in business side is pushed in the scheduled time to user Engage the page or shopping page etc.;Wherein, the determination of predetermined time can access after the related pages 1 hour or 24 small for user When etc..Such as: business side, which wants to realize, pushes the page of renting a house, then certain user accessed after renting a house information, business Fang Ze is 24 Hour rear line pushes the page of renting a house.The time of specific delay push can be adjusted according to the actual situation.
Step S12 stores the delayed tasks received, and monitors the calling opportunity of the delayed tasks;
It is to client forward delay interval task so that the opportunity of client executing delayed tasks that opportunity is called in the present embodiment, Specific calling opportunity can be adjusted according to the demand of business side, such as business side requires to access the page of renting a house in user Afterwards, client is recycled to push the page of renting a house to user after 24 hours, then calling opportunity then is 24 hours, and server receives Delayed tasks then start to carry out timing, reach timing time, then delayed tasks are sent to client and notify client executing Task.
Step S13 calls delayed tasks described in the client executing according to the calling opportunity.
In the present embodiment, in present invention implementation, several clients are corresponding under same business side, server-side is being called respectively When client executing delayed tasks, it can be called according to the case where task amount of each client, so that delayed tasks are equal Even distributes to each client, realizes server-side and uniformly calls method in client, solves and load in existing scheduling Unbalanced problem.
In addition, the present embodiment, which can also solve each scheduling of existing local scheduling mode, can be only done asking for a task Topic specifically, existing local scheduling mode, for example wants 9 points of execution task A every morning, need using quartz or Crontab etc. adds a scheduler task, is executing task B after having spent several days and wishing to carry out task A, at this moment only there are two types of processing Mode, first is that, the configuration of modification quartz or crontab increases a scheduler task;Second is that modifying the code of task execution It is allowed to be performed simultaneously A and B, but both modes can all cause the promotion of maintenance cost.And utilize tune described in the present embodiment Degree method, it is only necessary to add a task B again in the client, utilize server-side by the way that task B is stored in server-side It carries out timing monitoring and task B is then sent to client when the time for reaching execution task B, so that client executing task B, It does not need to increase configuration task for each client or modifies task execution code in each client, therefore maintenance cost is low.
In addition, the present embodiment can also solve the problems, such as that dynamic does not increase deletion scheduling to existing local scheduling mode, Specifically, existing local scheduling mode, for example 9 points originally of task is adjusted at 3 points in afternoon, it can only be by modifying quartz Or the configuration file of crontab, if every machine of cluster has configuration, that just needs to modify all machines, it is cumbersome, If execute after a week the bad readjustment task of effect to 9 points, it is also necessary to modify configuration file again.And utilize the present embodiment The dispatching method, it is only necessary to the adjustment task in a client, then by the way that task adjusted is stored in clothes Be engaged in end in, task is monitored using server-side, reach execute the time task adjusted is then sent to each client, with Make each client executing task, therefore does not need to modify configuration file adjustment task for each client, therefore increase or delete Scheduler task is more convenient, quick.
Furthermore the present embodiment can also solve existing local scheduling mode cannot asking for users' personal allocation Topic, specifically, existing local scheduling mode is the time by saving task and task execution in local, such as morning 9 Point scheduler task, then all data all can only 9 points execution, if require delayed 24 hours according to the time that user accesses It executes, the modes such as quartz and crontab can only configure a scheduler task per minute, and a demand will configure 1140 and appoint Business, if cluster has 10 servers, it is desirable to which load balancing needs to configure 1140*10=11400 task, complicated for operation numerous Trivial, maintenance cost is huge.And dispatching method described in the present embodiment is utilized, by according to the access record of user and business side Demand determines delayed tasks and executes the time, for example user's access time is 8 a.m., the access content job hunting page, business side It is required that after being 24 hours to the time that user pushes the page, it is determined that delayed tasks push the job hunting page to user, when push Between be 8 points of the next morning, therefore the dispatching method in the present embodiment is more personalized, will not only at a fixed time (for example, Daily 8 points) to user push the page.
Second embodiment of the invention provides a kind of call method, and the present embodiment the method compared to the first embodiment, will Message transmission and the mechanism for resolving between client and server-side are illustrated emphatically, thus more detailed description calling of the present invention The specific implementation process of method.Specifically, as shown in Fig. 2, the present embodiment the method includes steps in detail below:
Step S21, receive that each client sends by serializing treated delayed tasks, and the delay to receiving Task carries out unserializing processing and obtains task definition and call opportunity;
In this step, delayed tasks can be with are as follows: the corresponding client in business side needs the page/trick of renting a house pushed to user Engage the page/shopping page etc.;Wherein, calling opportunity is the opportunity for needing to push the page to user, such as user accessed the phase 1 hour or 24 hours etc. after the page of pass.It is specific: if business side, which wants to realize, pushes the page of renting a house, then certain user accessed After information of renting a house, then delayed tasks content is that 24 hours rear lines push the page of renting a house, and calling opportunity is that user accesses the page Behind 24 hours when face.The time of specific delay push can be adjusted according to the actual situation.
Step S22 stores the task definition obtained after unserializing is handled, and monitors the calling of the task definition Opportunity.
Step S23 in the way of the long connection of transmission control protocol TCP or utilizes enterprise according to the calling opportunity Service bus ESB is to corresponding client forward delay interval task and executes the notices of the delayed tasks.
To further including carrying out serializing processing to delayed tasks before client forward delay interval task in this step, then Delayed tasks are sent to client again.
In the embodiment of the present invention, several clients are corresponding under same business side, server-side is held in each client of calling When line delay task, it can be called according to the case where task amount of each client, so that delayed tasks uniformly be distributed It to each client, realizes server-side and uniformly calls client executing delayed tasks, it is uneven thus to solve existing load The problem of weighing apparatus.
Third embodiment of the invention provides a kind of call method, and the method can be, but not limited to be applied to client, knot Fig. 3 is closed, the present embodiment the described method comprises the following steps:
Step S31, determines delayed tasks;
This step specifically includes in implementation process: determining that delay is appointed according to the access record of user and the demand of business side Business;Specific delayed tasks can be the page/trick of renting a house that the corresponding client in business side is pushed in the scheduled time to user Engage the page/shopping page etc.;Wherein, the determination of predetermined time can access after the related pages 1 hour or 24 small for user When etc..Such as: business side, which wants to realize, pushes the page of renting a house, then certain user accessed after renting a house information, business Fang Ze is 24 Hour rear line pushes the page of renting a house.The time of specific delay push can be adjusted according to the actual situation.
The delayed tasks are sent to server-side by step S32;
This step in the specific implementation process, specifically includes: the delayed tasks is sent to server-side, are specifically included: Serializing processing carried out to the delayed tasks, then will treated that task is sent to server-side by serializing.
Step S33 executes the delayed tasks when being called by the server-side.
This step in the specific implementation process, specifically includes: receiving and prolongs described in the delayed tasks and execution that server-side is sent When task notice;According to the notice, the task definition is executed.
In the present embodiment, by the way that delayed tasks are sent to server-side using saving in server-side, and service is executed Thus the calling at end solves the problems, such as existing load imbalance.Since delayed tasks can be sent to server-side by client Saved, if therefore same business side be corresponding with multiple client, it is only necessary to increase/deletion delay is appointed in a client Thus business solves the problems, such as that each scheduling can be only done a business, non-dynamic increase/deletion scheduling.
Four embodiment of the invention provides a kind of call method, and executing subject can be client, in conjunction with Fig. 4, including Following steps:
Step S41 determines delayed tasks according to the access record of user and the demand of business side.
In this step, business side wants to realize after user accessed and rents a house information, pushes page of renting a house to the user within 5 hours Face;So certain user access in the morning 7 points accessed and rent a house information after, it is determined that delayed tasks are 7 points to this of the next morning User pushes the page of renting a house.The time of specific delay push can be adjusted according to the actual situation.
Step S42 carries out serializing processing to the delayed tasks, then will treated that task is sent to by serializing Server-side.
Step S43 receives delayed tasks and the notice for executing the delayed tasks that server-side is sent, according to described logical Know, executes the task definition.
This step is specifically as follows in implementation process: receiving the delay that server-side is sent in the way of TCP long connection Task and the notice for executing the delayed tasks;Alternatively, receiving the delayed tasks that server-side utilizes ESB Enterprise Service Bus to send And execute the notice of the delayed tasks.
In the present embodiment, by the way that delayed tasks are sent to server-side using saving in server-side, and service is executed Thus the calling at end solves the problems, such as existing load imbalance.Since delayed tasks can be sent to server-side by client Saved, if therefore same business side be corresponding with multiple client, it is only necessary to increase/deletion delay is appointed in a client Thus business solves the problems, such as that each scheduling can be only done a business, non-dynamic increase/deletion scheduling, while solving It in the prior art, cannot be aiming at the problem that user individual due to being directly to execute delayed tasks in client.The present invention Embodiment in modification/increase delayed tasks be it is more convenient, easy to operate and maintenance cost is low.
Fifth embodiment of the invention provides a kind of calling device, in conjunction with Fig. 5, including receiving module 11,12 and of monitoring module Calling module 13;
The receiving module 11, the delayed tasks sent for receiving each client;
The monitoring module 12 for storing the delayed tasks received, and monitors the calling of the delayed tasks Opportunity;
The calling module 13 calls delayed tasks described in the client executing according to the calling opportunity.
In the present embodiment, receiving module 11 is specifically used for when receiving the delayed tasks that each client is sent: receiving each Client send by serializing treated delayed tasks, and unserializing processing is carried out to the delayed tasks received and is obtained Obtain task definition.
Calling module 13 when calling delayed tasks described in the client executing, is specifically used according to the calling opportunity In: according to the calling opportunity, in the way of the long connection of transmission control protocol TCP or using Enterprise Service Bus ESB to Corresponding client sends the delayed tasks and executes the notice of the delayed tasks.
The execution time that monitoring module monitoring delay task is utilized in the present embodiment utilizes after task reaches and executes the time Task is sent to each client by calling module, the execution delayed tasks for calling each client is realized, by the way that task to be stored in Monitoring module does not have to increase each client or delete processing when increasing or deleting task, it is only necessary at one Client increased or delete processing and by increase or delete processing after task be sent to monitoring module, reach when executing Between after monitoring module the task is then sent to each client, therefore operate more convenient, improve work efficiency.
Sixth embodiment of the invention provides a kind of calling device, and in conjunction with Fig. 6, including determining module 21, sending module 22 is held Row module 23;
The determining module 21, for determining delayed tasks;
The sending module 22, for the delayed tasks to be sent to server-side;
The execution module 23, for executing the delayed tasks when being called by the server-side.
Determining module 21 in the present embodiment are specifically used for when determining delayed tasks, the access record and industry according to user The demand of business side determines delayed tasks.
Sending module 22 in the present embodiment are specifically used for when the delayed tasks are sent to server-side: prolonging to described When task carry out serializing processing, then will treated that task is sent to server-side by serializing.
Execution module 23 in the present embodiment, it is specific to use when executing the delayed tasks when being called by the server-side In: receive the delayed tasks and the notice for executing the delayed tasks that server-side is sent;According to the notice, the task is executed Content.Specifically, the execution module 23, is receiving the delayed tasks and the notice for executing the delayed tasks that server-side is sent When, it is specifically used for: receives the process fed back according to the timing monitored results that server-side is sent in the way of TCP long connection The notice of delayed tasks and the execution delayed tasks after serializing processing;Alternatively, receiving server-side utilizes ESB enterprises service What bus was sent appoints according to the delayed tasks after serializing is handled of timing monitored results feedback and the execution delay The notice of business.
By the way that delayed tasks are sent to server-side in the present embodiment, using server-side monitoring delay task, held when reaching Delayed tasks are then fed back to calling module by row opportunity, server-side, and calling module executes delayed tasks.The embodiment of the present invention Do not have to increase each client or delete processing when increasing or deleting task, it is only necessary to carry out in a client Increase or delete processing and by increase or delete processing after task be sent to monitoring module, reach and monitor mould after executing the time The task is then sent to each client by block, therefore operation is more convenient, improves work efficiency.
Seventh embodiment of the invention provides a kind of server, in conjunction with Fig. 7, including memory 1, processor 2 and communication bus 3;The communication bus 3 is for realizing the connection communication between processor 2 and memory 1;
Specifically, processor 2 can be general processor, such as central processing unit (Central in the embodiment of the present invention Processing Unit, CPU), can also be digital signal processor (Digital Signal Processor, DSP), specially With integrated circuit (English: Application Specific Integrated Circuit, ASIC), or it is arranged to Implement one or more integrated circuits of the embodiment of the present invention.Wherein, memory is used to store the executable finger of the processor It enables;
Memory 1 is transferred to processor for storing program code, and by the program code.Memory may include easy The property lost memory (Volatile Memory), such as random access memory (RandomAccess Memory, RAM);Storage Device also may include nonvolatile memory (Non-Volatile Memory), such as read-only memory (Read-Only Memory, ROM), flash memory (Flash Memory), hard disk (Hard Disk Drive, HDD) or solid state hard disk (Solid-State Drive, SSD);Memory can also include the combination of the memory of mentioned kind.
Specifically, the processor is for executing the caller stored in memory, the tune in the embodiment of the present invention Following method and step is realized when being executed with program by the processor:
Step 1: receiving the delayed tasks that each client is sent;
Step 2: the delayed tasks that storage receives, and monitor the calling opportunity of the delayed tasks;
Step 3: calling delayed tasks described in the client executing according to the calling opportunity.
The specific embodiment process of above method step can be found in the first and second embodiment, and the present embodiment is not repeated herein It repeats.
Eighth embodiment of the invention provides a kind of terminal, and in conjunction with Fig. 8, the terminal includes: memory 1, processor 2 and leads to Believe bus 3;The communication bus 3 is for realizing the connection communication between processor 2 and memory 1;
Specifically, processor 2 can be general processor, such as central processing unit (Central in the embodiment of the present invention Processing Unit, CPU), can also be digital signal processor (Digital Signal Processor, DSP), specially With integrated circuit (English: Application Specific Integrated Circuit, ASIC), or it is arranged to Implement one or more integrated circuits of the embodiment of the present invention.Wherein, memory is used to store the executable finger of the processor It enables;
Memory 1 is transferred to processor for storing program code, and by the program code.Memory may include easy The property lost memory (Volatile Memory), such as random access memory (RandomAccess Memory, RAM);Storage Device also may include nonvolatile memory (Non-Volatile Memory), such as read-only memory (Read-Only Memory, ROM), flash memory (Flash Memory), hard disk (Hard Disk Drive, HDD) or solid state hard disk (Solid-State Drive, SSD);Memory can also include the combination of the memory of mentioned kind.
Specifically, the processor is for executing the caller stored in memory, the tune in the embodiment of the present invention Following method and step is realized when being executed with program by the processor:
Step 1: determining delayed tasks;
Step 2: the delayed tasks are sent to server-side;
Step 3: executing the delayed tasks when being called by the server-side.
The specific embodiment process of above method step can be found in third and fourth embodiment, and the present embodiment is not repeated herein It repeats.
Ninth embodiment of the invention provides a kind of computer readable storage medium, deposits on the computer readable storage medium Computer program is contained, the step of computer program realizes following call method when being executed by processor:
Step 1: receiving the delayed tasks that each client is sent;
Step 2: the delayed tasks that storage receives, and monitor the calling opportunity of the delayed tasks;
Step 3: calling delayed tasks described in the client executing according to the calling opportunity.
Alternatively, the step of realizing following call method:
Step 1: determining delayed tasks;
Step 2: the delayed tasks are sent to server-side;
Step 3: executing the delayed tasks when being called by the server-side.
The specific embodiment process of above method step can be found in first embodiment to fourth embodiment, and the present embodiment is herein It is no longer repeated.
Tenth embodiment of the invention provides a kind of calling system, including client and server;Specifically, in conjunction with Fig. 9, this In embodiment, server DC-Service includes: work package Worker component, lock set DistributeLock Component, remote service component SCF (service communication fuwork) component, Mission Monitor component TaskExecutor component, message informing component N otifier component and configuration component Config component;
Worker component is mainly responsible for the initialization of server system and the instantiation of internal component and mutually association Make, and manage the life cycle entirely serviced, depends on DistributeLock component, Notifier Component and TaskExecutor component;
DistributeLock component realizes for distributed lock, guarantees that synchronization only has a main service Device DC service (Delaycall-service) is currently running;
SCF component: submission and inquiry for providing delay calling task provide data management function, including appoint The state of the persistence of business and inquiry and task, which updates, to be operated;
TaskExecutor component: phase is notified for monitoring timed task, and when task reaches and executes the time The client executing remote code answered;
Notifier component: for executing notice operation, remotely executing for task is sent to corresponding to task Client;
Config component: for initializing system configuration information.
In conjunction with the simple class figure of Figure 10 server, the primary interface of server system is TaskExecutor, is responsible for task Monitoring and message informing, implementor respectively are DC58MasterTaskExecutor, TCPNotifier, ESBNotifier. TaskExecutor inherits DC58MasterTaskExecutor, and DC58MasterTaskExecutor is relied on AbstractDCWorker, AbstractDCWorker rely on DCService and Distributedlock, AbstractDCWorker inherits DC58Worker and realizes DCWorker.
A specific implementation of DC58MasterTaskExecutor:TaskExecutor, major responsibility is to pass through AbstractDCWorker groundwork component inquires the delayed tasks of nearest a period of time from the database of DCService, The time is executed when task reaches, task is distributed to DCWorker processing.
DCWorker: for the main thread of server system, it is responsible for various components in processing system and calls and execute process;
ESBNotifier: task message will be executed using Enterprise Service Bus Enterprise Service Bus and will be appointed Business is distributed to delaycall-Client client;
TCPNotifier: the mode of the long connection of Transmission Control Protocol transmission control protocol is used Task message will be executed and task issues delaycall-Client client, realized using Netty frame;It had been embodied Cheng Zhong can be selected according to actual needs using ESBNotifier or TCPNotifier: the publication to carry out task.
DCService: system configuration and upper and lower environment are mainly responsible for.
Event: the case mechanism of internal system.
The creation entrance of WorkBuilder:work component passes through workBuilder when system initialization and creates DCWorker transmitting configuration and online text and activation system.
In the present embodiment, client includes message components Messaging, serializing component Invocation, invocation component Invocation and service brokering component SCFProxy;Its call relation is as shown in figure 11, specific:
Messaging: content reception and the transmission of timed task are mainly responsible for.
Serialization: the serializing and unserializing for being mainly responsible for task definition ensure that goal approach can be adjusted correctly With.
Invocation: an executable task is received, and really executes task.
SCFProxy: one SCF service broker mainly provides the user with the interface for submitting delayed tasks.
In conjunction with Figure 12, client DCClient (Delaycall-Client) is called in the simple class figure of client, including delay, ESBClient, TCPClient, TaskInvoker and TaskConverter;
DCClient: client-side interface receives the notifier message of server-side transmission for being responsible for, and calls TaskInvoker is called to execute business side's logic after MessageConvertr unserializing;It is AbstractDCClient spy Fixed realization interface.
ESBClient and TCPClient: it is responsible for the specific Notifier notice of processing, guarantees the reception of server-side message.
TaskInvoker: parameter when being responsible for the logic of calling business side and business side being created task returns to business Side;<interface>TaskInvoker is the realization interface of DefaultTaskInvoker.
Task Switching TaskConverter realizes interface for<interface>MessageConverter conversion;Disappear Breath MessageConverter is used to unserializing after receiving message for realizing: client, and guarantee can be obtained correctly The original contents of message.
In conjunction with Figure 13, the calling process of calling system in the present embodiment are as follows: user completes after corresponding operating by business root According to the service conditions of oneself by delaycall-client client addition timing readjustment task, such as business side A is to rent a house Business, business side B are recruitment, and business side C is shopping service, and delaycall-client corresponding with business side can will appoint Business content passes to the preservation of delaycall-service server-side cluster, and delaycall-service can be in internal waiting task Reach executable state, task is then passed back to delaycall-client corresponding with business side and executes business side's task.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the device that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or device.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to logical
Hardware is crossed, but the former is more preferably embodiment in many cases.Based on this understanding, technical side of the invention Substantially the part that contributes to existing technology can be embodied in the form of software products case in other words, and the computer is soft Part product is stored in a storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal (can be mobile phone, computer, server, air conditioner or the network equipment etc.) executes side described in each embodiment of the present invention Method.
The embodiment of the present invention is described with above attached drawing, but the invention is not limited to above-mentioned specific Embodiment, the above mentioned embodiment is only schematical, rather than restrictive, those skilled in the art Under the inspiration of the present invention, without breaking away from the scope protected by the purposes and claims of the present invention, it can also make very much Form, all of these belong to the protection of the present invention.

Claims (19)

1. a kind of call method, which is characterized in that the described method comprises the following steps:
Receive the delayed tasks that each client is sent;
The delayed tasks received are stored, and monitor the calling opportunity of the delayed tasks;
According to the calling opportunity, delayed tasks described in the client executing are called.
2. call method as described in claim 1, which is characterized in that the delayed tasks for receiving each client and sending, tool Body includes: to receive that each client sends by serializing treated delayed tasks, and carry out to the delayed tasks received Unserializing processing obtains task definition.
3. call method as described in claim 1, which is characterized in that described to call the client according to the calling opportunity Execute the delayed tasks, specifically include: according to the calling opportunity, in the way of the long connection of transmission control protocol TCP or Person sends the delayed tasks to corresponding client using Enterprise Service Bus ESB and executes the logical of the delayed tasks Know.
4. a kind of call method, which comprises the following steps:
Determine delayed tasks;
The delayed tasks are sent to server-side;
When being called by the server-side, the delayed tasks are executed.
5. call method as claimed in claim 4, which is characterized in that the determining delayed tasks specifically include: according to user Access record and the demand of business side determine delayed tasks.
6. call method as claimed in claim 4, which is characterized in that the delayed tasks are sent to server-side, it is specific to wrap It includes: serializing processing is carried out to the delayed tasks, then will treated that task is sent to server-side by serializing.
7. call method as claimed in claim 4, which is characterized in that it is described when being called by the server-side, described in execution Delayed tasks specifically include:
Receive the delayed tasks and the notice for executing the delayed tasks that server-side is sent;
According to the notice, the task definition is executed.
8. call method as claimed in claim 7, which is characterized in that described to receive the delayed tasks and execution that server-side is sent The notice of the delayed tasks, specifically includes:
Receive the delayed tasks and the notice for executing the delayed tasks that server-side is sent in the way of TCP long connection;
Alternatively, receiving the delayed tasks and the notice for executing the delayed tasks that server-side is sent using ESB Enterprise Service Bus.
9. a kind of calling device, which is characterized in that including receiving module, monitoring module and calling module;
The receiving module, the delayed tasks sent for receiving each client;
The monitoring module for storing the delayed tasks received, and monitors the calling opportunity of the delayed tasks;
The calling module calls delayed tasks described in the client executing according to the calling opportunity.
10. calling device as claimed in claim 9, which is characterized in that the receiving module is receiving what each client was sent When delayed tasks, be specifically used for: receive that each client sends by serializing treated delayed tasks, and to receiving Delayed tasks carry out unserializing processing and obtain task definition.
11. calling device as claimed in claim 9, which is characterized in that the calling module, according to the calling opportunity, When calling delayed tasks described in the client executing, it is specifically used for: according to the calling opportunity, utilizes transmission control protocol The mode of TCP long connection sends the delayed tasks and execution to corresponding client using Enterprise Service Bus ESB The notice of the delayed tasks.
12. a kind of calling device, which is characterized in that including determining module, sending module and execution module;
The determining module, for determining delayed tasks;
The sending module, for the delayed tasks to be sent to server-side;
The execution module, for executing the delayed tasks when being called by the server-side.
13. calling device as claimed in claim 12, which is characterized in that the determining module, when determining delayed tasks, tool Body is used for, and determines delayed tasks according to the access record of user and the demand of business side.
14. calling device as claimed in claim 12, which is characterized in that the sending module is sent out by the delayed tasks When giving server-side, it is specifically used for: serializing processing is carried out to the delayed tasks, then will be by serializing treated task It is sent to server-side.
15. calling device as claimed in claim 12, which is characterized in that the execution module is called by the server-side When, when executing the delayed tasks, it is specifically used for:
Receive the delayed tasks and the notice for executing the delayed tasks that server-side is sent;
According to the notice, the task definition is executed.
16. calling device as claimed in claim 15, which is characterized in that the execution module is receiving what server-side was sent When the notice of delayed tasks and the execution delayed tasks, it is specifically used for: receives server-side and sent in the way of TCP long connection Delayed tasks and execute the notices of the delayed tasks;
Alternatively, receiving the delayed tasks and the notice for executing the delayed tasks that server-side is sent using ESB Enterprise Service Bus.
17. a kind of server, which is characterized in that the server includes memory, processor and is stored on the memory And the computer program that can be run on the processor, such as right is realized when the computer program is executed by the processor It is required that the step of call method described in any one of 1-3.
18. a kind of terminal, which is characterized in that the terminal includes: memory, processor and is stored on the memory and can The computer program run on the processor realizes such as claim when the computer program is executed by the processor The step of call method described in any one of 4-8.
19. a kind of computer readable storage medium, which is characterized in that computer program is stored on the storage medium, it is described The step of call method as claimed in any one of claims 1-3 is realized when computer program is executed by processor, alternatively, real Now the step of call method as described in claim 4-8 any one.
CN201811081305.4A 2018-09-17 2018-09-17 Call method, calling device, server, terminal and computer readable storage medium Pending CN109347918A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811081305.4A CN109347918A (en) 2018-09-17 2018-09-17 Call method, calling device, server, terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811081305.4A CN109347918A (en) 2018-09-17 2018-09-17 Call method, calling device, server, terminal and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN109347918A true CN109347918A (en) 2019-02-15

Family

ID=65305639

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811081305.4A Pending CN109347918A (en) 2018-09-17 2018-09-17 Call method, calling device, server, terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109347918A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110109764A (en) * 2019-05-15 2019-08-09 重庆天蓬网络有限公司 Delayed tasks creation method, device, medium and electronic equipment
CN110677312A (en) * 2019-08-15 2020-01-10 北京百度网讯科技有限公司 SDK packet delay monitoring method and system, computer device and readable medium
CN112286655A (en) * 2020-10-19 2021-01-29 江苏银承网络科技股份有限公司 Distributed delay scheduling method, device and system
CN117596318A (en) * 2024-01-18 2024-02-23 北京集度科技有限公司 Timing management device and method for vehicle, electronic device, and computer program product

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104702426A (en) * 2013-12-05 2015-06-10 广东优迈信息通信股份有限公司 A configuring method and device for time scheduling service system
CN105610605A (en) * 2015-12-18 2016-05-25 成都广达新网科技股份有限公司 Message reverse push method, network management system alarm method and state update method
CN106034137A (en) * 2015-03-09 2016-10-19 阿里巴巴集团控股有限公司 Intelligent scheduling method for distributed system, and distributed service system
CN106878368A (en) * 2016-08-10 2017-06-20 阿里巴巴集团控股有限公司 The implementation method and device of information pushing
CN108512879A (en) * 2017-02-28 2018-09-07 阿里巴巴集团控股有限公司 A kind of information-pushing method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104702426A (en) * 2013-12-05 2015-06-10 广东优迈信息通信股份有限公司 A configuring method and device for time scheduling service system
CN106034137A (en) * 2015-03-09 2016-10-19 阿里巴巴集团控股有限公司 Intelligent scheduling method for distributed system, and distributed service system
CN105610605A (en) * 2015-12-18 2016-05-25 成都广达新网科技股份有限公司 Message reverse push method, network management system alarm method and state update method
CN106878368A (en) * 2016-08-10 2017-06-20 阿里巴巴集团控股有限公司 The implementation method and device of information pushing
CN108512879A (en) * 2017-02-28 2018-09-07 阿里巴巴集团控股有限公司 A kind of information-pushing method and device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110109764A (en) * 2019-05-15 2019-08-09 重庆天蓬网络有限公司 Delayed tasks creation method, device, medium and electronic equipment
CN110677312A (en) * 2019-08-15 2020-01-10 北京百度网讯科技有限公司 SDK packet delay monitoring method and system, computer device and readable medium
CN110677312B (en) * 2019-08-15 2023-07-25 北京百度网讯科技有限公司 Time delay monitoring method and system for SDK (software development kit) package, computer equipment and readable medium
CN112286655A (en) * 2020-10-19 2021-01-29 江苏银承网络科技股份有限公司 Distributed delay scheduling method, device and system
CN117596318A (en) * 2024-01-18 2024-02-23 北京集度科技有限公司 Timing management device and method for vehicle, electronic device, and computer program product

Similar Documents

Publication Publication Date Title
US10574505B2 (en) Endpoint data centers of different tenancy sets
CN109347918A (en) Call method, calling device, server, terminal and computer readable storage medium
CN107729139B (en) Method and device for concurrently acquiring resources
US8818940B2 (en) Systems and methods for performing record actions in a multi-tenant database and application system
CN102456185B (en) Distributed workflow processing method and distributed workflow engine system
CA2812525C (en) Virtual server control system and program
US8938510B2 (en) On-demand mailbox synchronization and migration system
US7680848B2 (en) Reliable and scalable multi-tenant asynchronous processing
CN110383764B (en) System and method for processing events using historical data in a serverless system
CN109582466A (en) A kind of timed task executes method, distributed server cluster and electronic equipment
US20120011515A1 (en) Resource Consumption Template Processing Model
US20170093988A1 (en) Workflow service using state transfer
CN103679392B (en) A kind of task scheduling processing method and system
GB2532834A (en) A method and system for scalable job processing
CN109634730A (en) Method for scheduling task, device, computer equipment and storage medium
CN105516086B (en) Method for processing business and device
JP2012510651A (en) Service load balancing
US11645098B2 (en) Systems and methods to pre-provision sockets for serverless functions
US11175950B1 (en) Dynamic regulation of parallelism for job scheduling
US8793325B2 (en) Time and event controlled message processing
Seelam et al. Polyglot application auto scaling service for platform as a service cloud
US20190377596A1 (en) Flexible batch job scheduling in virtualization environments
EP2756421A2 (en) Scale-out system to acquire event data
CN108958933B (en) Configuration parameter updating method, device and equipment of task executor
CN111190731A (en) Cluster task scheduling system based on weight

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