CN109213589A - A kind of method and device of Message Processing - Google Patents

A kind of method and device of Message Processing Download PDF

Info

Publication number
CN109213589A
CN109213589A CN201811139416.6A CN201811139416A CN109213589A CN 109213589 A CN109213589 A CN 109213589A CN 201811139416 A CN201811139416 A CN 201811139416A CN 109213589 A CN109213589 A CN 109213589A
Authority
CN
China
Prior art keywords
dormancy
processor
message
thread
preset
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
CN201811139416.6A
Other languages
Chinese (zh)
Other versions
CN109213589B (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.)
SHENZHEN SUNELL TECHNOLOGY Corp
Original Assignee
SHENZHEN SUNELL TECHNOLOGY Corp
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 SHENZHEN SUNELL TECHNOLOGY Corp filed Critical SHENZHEN SUNELL TECHNOLOGY Corp
Priority to CN201811139416.6A priority Critical patent/CN109213589B/en
Publication of CN109213589A publication Critical patent/CN109213589A/en
Application granted granted Critical
Publication of CN109213589B publication Critical patent/CN109213589B/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/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/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • G06F9/4856Task life-cycle, e.g. stopping, restarting, resuming execution resumption being on a different machine, e.g. task migration, virtual machine migration
    • 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/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4418Suspend and resume; Hibernate and awake
    • 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/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

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 Security & Cryptography (AREA)
  • Telephonic Communication Services (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present invention is suitable for field of communication technology, provides a kind of method and device of Message Processing, comprising: receives message and obtains the first number of dormancy that current processor presets thread;The second number of dormancy of thread is preset according to processor corresponding to preset dormancy duration calculation presetting message elimination duration;If the number of dormancy that processor presets thread reaches third number of dormancy, the message is eliminated;The third number of dormancy is equal to the first number of dormancy and adds the second number of dormancy.The embodiment of the present invention is by way of processor thread suspend mode, thread can be made to concede the right to use of processor, increase the efficiency of processor, it avoids the problem that in the prior art because the use system of high frequency calls acquisition time to lead to system performance bottleneck, the prior art is overcome because system time mistake causes message to delay enough to destroy by fire, or has little time display and just destroy by fire immediately, or destroy the time by fire and design time has big difference problem.

Description

A kind of method and device of Message Processing
Technical field
The invention belongs to communication technique field more particularly to a kind of method and apparatus of Message Processing.
Background technique
In communication information process field, it is using very extensive, in the prior art mostly that function is destroyed in message timing, which by fire, Number be all set in advance receive message preset duration after message is destroyed by fire, by read receive message when CPU when Between, when the CPU time reaching the preset duration that message is destroyed by fire, just message is destroyed by fire.Although the CPU time does not modify with system time And change, but CPU time and system time are inconsistent in many cases, abnormal logic may be generated, the time read is caused Inaccuracy.And calling acquisition time by system is the operation of relative consumption system performance, and the use system calling of high frequency obtains It takes the time to result in the bottleneck of system performance, so that the occupancy of CPU is excessively high, timing is caused to destroy disabler by fire.
Summary of the invention
In view of this, the embodiment of the invention provides a kind of method of Message Processing, to solve the CPU time in the prior art It is inconsistent with system time, abnormal logic may be generated, the time read inaccuracy is caused.And it is called and is obtained by system Time is the operation of relative consumption system performance, and high frequency calls acquisition time to result in the bottleneck of system performance using system, So that the occupancy of CPU is excessively high, lead to the problem of periodically destroying disabler by fire.
The first aspect of the embodiment of the present invention provides a kind of method of Message Processing, comprising:
It receives message and obtains the first number of dormancy that current processor presets thread;
The second suspend mode of thread is preset according to processor corresponding to preset dormancy duration calculation presetting message elimination duration Number;
If the number of dormancy that processor presets thread reaches third number of dormancy, the message is eliminated;The third Number of dormancy is equal to the first number of dormancy and adds the second number of dormancy.
Further, it before first number of dormancy for receiving message and obtaining the default thread of current processor, also wraps It includes:
The default thread that processor is arranged repeats suspend mode, and preset dormancy duration is arranged.
Further, the default thread of the setting processor repeats suspend mode, and is arranged after preset dormancy duration, Further include:
The number of dormancy of thread is preset by counter records processor.
It is further, described to receive message and obtain the first number of dormancy that current processor presets thread, comprising:
It receives message and reads the first number of dormancy that the processor recorded in counter presets thread.
Further, it is described according to preset dormancy duration calculation presetting message eliminate duration corresponding to default thread the Two number of dormancies, comprising:
Presetting message is calculated by formula " the second number of dormancy=presetting message eliminates duration ÷ preset dormancy duration " to disappear Except the second number of dormancy of default thread corresponding to duration.
The second aspect of the embodiment of the present invention provides a kind of device of Message Processing, comprising:
Obtain module, for receive message and obtain current processor preset thread the first number of dormancy;
Computing module presets line for the processor according to corresponding to preset dormancy duration calculation presetting message elimination duration Second number of dormancy of journey;
Cancellation module, if the number of dormancy for processor to preset thread reaches third number of dormancy, by the message It eliminates;The third number of dormancy is equal to the first number of dormancy and adds the second number of dormancy.
Further, the acquisition module is specifically used for:
It receives message and reads the first number of dormancy that the processor recorded in counter presets thread.
Further, the computing module is specifically used for:
Presetting message is calculated by formula " the second number of dormancy=presetting message eliminates duration ÷ preset dormancy duration " to disappear Except the second number of dormancy of default thread corresponding to duration.
The third aspect the embodiment of the invention provides a kind of terminal, including processor, input equipment, output equipment and is deposited Reservoir, the processor, input equipment, output equipment and memory are connected with each other, wherein the memory is supported for storing Terminal executes the computer program of the above method, and the computer program includes program instruction, and the processor is configured for Call described program instruction, the method for executing above-mentioned first aspect.
Fourth aspect, the embodiment of the invention provides a kind of computer readable storage medium, the computer-readable storage Media storage has computer program, and the computer program includes program instruction, and described program instructs when being executed by a processor The method for making the processor execute above-mentioned first aspect.
The embodiment of the present invention passes through reception message and obtains the first number of dormancy that current processor presets thread;According to pre- If sleep time calculates presetting message and eliminates the second number of dormancy that processor corresponding to duration presets thread;If processor is pre- If the number of dormancy of thread reaches third number of dormancy, then the message is eliminated;The third number of dormancy is equal to first and stops Dormancy number adds the second number of dormancy.The embodiment of the present invention can make thread by source by way of processor thread suspend mode The right to use for managing device, increases the efficiency of processor, avoids in the prior art because the use system of high frequency calls acquisition time to lead The problem of causing system performance bottleneck, and replace by record thread number of dormancy repeating to obtain system time overcome it is existing Technology is because system time mistake causes message to delay enough to destroy by fire, or has little time display and just destroy by fire immediately, or destroy the time by fire Have big difference problem with design time.The embodiment of the present invention can accurately and timely be handled message, and the processing of raising system disappears The efficiency of breath.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only of the invention some Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is a kind of implementation process schematic diagram of the method for Message Processing provided in an embodiment of the present invention;
Fig. 2 is the implementation process schematic diagram of the method for another Message Processing provided in an embodiment of the present invention;
Fig. 3 is a kind of schematic diagram of the device of Message Processing provided in an embodiment of the present invention;
Fig. 4 is the schematic diagram of terminal device provided in an embodiment of the present invention.
Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposed Body details, to understand thoroughly the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specific The present invention also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, device, electricity The detailed description of road and method, in case unnecessary details interferes description of the invention.
It should be appreciated that ought use in this specification and in the appended claims, term " includes " and "comprising" instruction Described feature, entirety, step, operation, the presence of element and/or component, but one or more of the other feature, whole is not precluded Body, step, operation, the presence or addition of element, component and/or its set.
It is also understood that mesh of the term used in this description of the invention merely for the sake of description specific embodiment And be not intended to limit the present invention.As description of the invention and it is used in the attached claims, unless on Other situations are hereafter clearly indicated, otherwise " one " of singular, "one" and "the" are intended to include plural form.
It will be further appreciated that the term "and/or" used in description of the invention and the appended claims is Refer to any combination and all possible combinations of one or more of associated item listed, and including these combinations.
It is very extensive used in instant communication software field that function is destroyed in message timing by fire, in the prior art, mostly Number is all to be handled by reading system time message, for example, it is assumed that destroyed by fire automatically after receiving communication information 10s, Routine operation is system time T1 when server record receives message, it is assumed that T1 is 10:00:00, as current time in system T2 When reaching 10:00:10, T2-T1=10s, server-side first removes the message automatically and client is notified to remove.In above-mentioned existing skill In art, there is several disadvantages.It is not 10:00 when the actual time of the i.e. record message sink of T1=10:00:00 mistake itself: When 00, if actual time ratio T1 is small, for example, 00:00:00, then system update the system time before 10:00:10 is true System time 00:00:00, then message needs 10h+10s just to destroy by fire.If the actual time of message sink is in 00:00:00-10: Between 00:10, destroyed by fire then being difficult to accurate 10s or so.If the actual time ratio T1 of message sink is big, then the update the system time It will lead to message to destroy by fire immediately.If T1 record is correct system time, but current time T2 is incorrect system time, It will lead to message to delay enough to destroy by fire, or have little time display and just destroy by fire immediately, or destroy the time by fire and have big difference with design time Problem.When multiple users are to the frequent clock synchronization of server, and the time of user is correct and identical not to the utmost, and such case will lead to service Device system time frequently changes, and timing is caused to destroy disabler by fire.In addition, if message is in a list, because the time repairs Change, if oldest message can not delete, the message after can not also deleting causes message queue excessive, consumes additional System resource.Equally, if message is independent of each other, may cause message entanglement, subsequent message all deletes, and front Message such as still retains at the abnormal appearance.Also, when server generates a large amount of message, each message requires to obtain currently Time, and calling acquisition time by system is the operation of relative consumption system performance, when the use system of high frequency calls acquisition Between will lead to the bottleneck of system performance.The embodiment of the present invention presets thread by obtaining current processor when receiving message First number of dormancy;The second of thread is preset according to processor corresponding to preset dormancy duration calculation presetting message elimination duration Number of dormancy;If the number of dormancy that processor presets thread reaches third number of dormancy, the message is eliminated;The third Number of dormancy is equal to the first number of dormancy and adds the second number of dormancy.The embodiment of the present invention, which avoids the frequent calling system time, to be caused The bottleneck of system performance enables the system to accurately handle message.In order to illustrate technical solutions according to the invention, lead to below Specific embodiment is crossed to be illustrated.
It is a kind of schematic flow diagram of the method for Message Processing provided in an embodiment of the present invention, this method with reference to Fig. 1, Fig. 1 Executing subject is server, and the server executes the method as described in step S101 to S103, this method comprises: step S101 To step S103.
Step S101 receives message and obtains the first number of dormancy that current processor presets thread.
In embodiments of the present invention, a thread of processor carry out repeat suspend mode, and set each suspend mode when It is long, the number of dormancy of thread is preset by counter records processor.When receiving message, reads in counter and record Processor preset thread number of dormancy.
As shown in Fig. 2, in the implementation steps of the invention step S101: receiving message and obtain current processor and preset thread Before first number of dormancy, further includes: step S110 to step S120.
Step S110, the default thread that processor is arranged repeats suspend mode, and preset dormancy duration is arranged.
Current substantially all processors are all the processors of multithreading, and multithreading can give full play to the utilization rate of core cpu, In embodiments of the present invention, carry out the setting of the independent thread of processor to repeat suspend mode, and set each suspend mode when It is long, for example, a length of 10ms when each preset dormancy, processor thread suspend mode to the time interval base waken up between suspend mode again Originally it can ignore and disregard, there was only the time error of 2ms in 10s, this is for exhausted when sleep time is 10ms through overtesting Most of Message Processings are acceptable ranges.In embodiments of the present invention, the thread of processor uses 32 int types, If using the sleep time of every 10ms, can in the ideal case, equipment can with 4294967296 ÷ ((365 × 24 × 60 × 60) year do not restart × 10)=13.In an embodiment of the present invention, when processor is initially powered up, thread is preset just Start to carry out suspend mode.Carrying out thread suspend mode can make thread concede the right to use of processor, increase the treatment effeciency of processor, when When thread suspend mode, the use of processor resource can be given to other threads, so as to which the rotation between thread is called.How to allow There are two types of methods for one thread suspend mode, first is that using Thread.sleep (long millis) or Thread.sleep (long Millis, int nanos) method.The other is realizing thread suspend mode using sleep () method of TimeUnit class.
Step S120 presets the number of dormancy of thread by counter records processor.
When the default thread of processor starts repeat suspend mode, thread is preset by the counter records of processor Number of dormancy.
In order to facilitate the number of dormancy for carrying out record thread, counter provides various counting mode in the embodiment of the present invention, For example, by taking each suspend mode 10ms as an example, counter externally provide 10ms count value value10,100ms count value value100, Three parameters such as 1s count value value1000, value10 are 10ms count value, and every 10ms count value of crossing is from increasing 1, value100 For 100ms count value, every 100ms that crosses increases 1, value1000 certainly as 1s count value, and every 1s count value of crossing is from increasing 1.When processor line Journey every suspend mode 10ms, value10 are from increasing 1, and every suspend mode 10 times, from increasing 1, every suspend mode 100 times, value100 increases value100 certainly 10, value1000 increase 1 certainly.In another example 1 value100 of every suspend mode often stops from increasing 1 when each sleep time is 100ms 10 value1000 that sleep increase 1 certainly.It is specifically chosen which kind of counting mode, can voluntarily be selected according to the requirement to precision, for example, If the counting mode of 10ms is just selected, if not high to required precision, so that it may select the counting mode of 1s to required precision height.
Step S102 presets thread according to processor corresponding to preset dormancy duration calculation presetting message elimination duration Second number of dormancy.
A length of processor presets the duration of each suspend mode of thread when the preset dormancy, has in above-mentioned implementation steps and retouches It states.Retention time after the message sink of a length of system setting arrives when presetting message elimination, presets after receiving message After message eliminates duration, the message received is eliminated, prevents from being accumulated in message queue, clogged with messages or processor is caused to account for It is excessively high with rate.
Presetting message is calculated by formula " the second number of dormancy=presetting message eliminates duration ÷ preset dormancy duration " to disappear Except the second number of dormancy of default thread corresponding to duration.For example, it is assumed that being destroyed by fire automatically after receiving communication information 10s, often The when a length of 10ms of secondary suspend mode, the second number of dormancy=10000ms ÷ 10ms=1000 times, then pre- in this 10s inner treater If thread should be suspend mode 1000 times.That is, being preset thread secondary dormancy 1000 times from message preprocessor is received, just by institute State message elimination.
Step S103 eliminates the message if the number of dormancy that processor presets thread reaches third number of dormancy; The third number of dormancy is equal to the first number of dormancy and adds the second number of dormancy.
If the third number of dormancy that processor presets thread meets, " third number of dormancy=second number of dormancy+the first is stopped Dormancy number " then illustrates that presetting message is eliminated duration and had reached, the message is eliminated.For example, it is assumed that receive message when Waiting processor and presetting the first number of dormancy of thread is 1000 times, and preset sleep time is 10ms, and presetting message eliminates duration For 10s, then the second sleep time should be 1000 times, then third sleep time=1000+1000=2000 times, work as processor When the number of dormancy of default thread reaches 2000 times, the message received is eliminated.Timely history message is disappeared Lead to consume additional system resource except that can be accumulated in messaging list to avoid message, accurately eliminating history message can be with System is avoided to generate abnormal logic.
It should be understood that replace obtaining in the prior art by reading processor thread number of dormancy in the embodiment of the present invention be The scheme of system time not only can be used only in message timing and destroy by fire in function, also can be used and needs Timing Processing to disappear at other In the system of breath or affairs, for example, timing forwarding message etc..The method for reading thread number of dormancy through the invention, can solve The problem of certainly present technology is because of message Timing Processing timeliness caused by system time inaccuracy, and processor can be increased Treatment effeciency.
The embodiment of the present invention passes through reception message and obtains the first number of dormancy that current processor presets thread;According to pre- If sleep time calculates presetting message and eliminates the second number of dormancy that processor corresponding to duration presets thread;If processor is pre- If the number of dormancy of thread reaches third number of dormancy, then the message is eliminated;The third number of dormancy is equal to first and stops Dormancy number adds the second number of dormancy.The embodiment of the present invention can make thread by source by way of processor thread suspend mode The right to use for managing device, increases the efficiency of processor, avoids in the prior art because the use system of high frequency calls acquisition time to lead The problem of causing system performance bottleneck, and replace by record thread number of dormancy repeating to obtain system time overcome it is existing Technology is because system time mistake causes message to delay enough to destroy by fire, or has little time display and just destroy by fire immediately, or destroy the time by fire Have big difference problem with design time.The embodiment of the present invention can accurately and timely be handled message, and the processing of raising system disappears The efficiency of breath.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit It is fixed.
It is a kind of schematic diagram of the device 30 of Message Processing provided in an embodiment of the present invention with reference to Fig. 3, Fig. 3, such as Fig. 3 institute Show, which includes: to obtain module 31, computing module 32, cancellation module 33.
Obtain module 31, for receive message and obtain current processor preset thread the first number of dormancy.
Computing module 32, it is default for the processor according to corresponding to preset dormancy duration calculation presetting message elimination duration Second number of dormancy of thread.
Cancellation module 33 disappears if the number of dormancy for processor to preset thread reaches third number of dormancy by described Breath is eliminated;The third number of dormancy is equal to the first number of dormancy and adds the second number of dormancy.
The acquisition module 31 is specifically used for:
It receives message and reads the first number of dormancy that the processor recorded in counter presets thread.
In embodiments of the present invention, a thread of processor carry out repeat suspend mode, and set each suspend mode when It is long, the number of dormancy of thread is preset by counter records processor.When receiving message, reads in counter and record Processor preset thread number of dormancy.
The computing module 32 is specifically used for:
Presetting message is calculated by formula " the second number of dormancy=presetting message eliminates duration ÷ preset dormancy duration " to disappear Except the second number of dormancy of default thread corresponding to duration.For example, it is assumed that being destroyed by fire automatically after receiving communication information 10s, often The when a length of 10ms of secondary suspend mode, the second number of dormancy=10000ms ÷ 10ms=1000 times, then pre- in this 10s inner treater If thread should be suspend mode 1000 times.That is, being preset thread secondary dormancy 1000 times from message preprocessor is received, just by institute State message elimination.
Fig. 4 is the schematic diagram for the terminal device that one embodiment of the invention provides.As shown in figure 4, the terminal of the embodiment is set Standby 4 include: processor 40, memory 41 and are stored in the meter that can be run in the memory 41 and on the processor 40 Calculation machine program 42.The processor 40 realizes the step in above-mentioned each embodiment of the method when executing the computer program 42, Such as step 101 shown in FIG. 1 is to 103.Alternatively, the processor 40 realizes above-mentioned each dress when executing the computer program 42 Set the function of each module/unit in embodiment, such as the function of module 31 to 33 shown in Fig. 3.
Illustratively, the computer program 42 can be divided into one or more modules, one or more of Module is stored in the memory 41, and is executed by the processor 40, to complete the present invention.One or more of moulds Block can be the series of computation machine program instruction section that can complete specific function, and the instruction segment is for describing the computer journey Implementation procedure of the sequence 42 in the terminal device 4.
The terminal device 4 can be the calculating such as desktop PC, notebook, palm PC and cloud server and set It is standby.The terminal device may include, but be not limited only to, processor 40, memory 41.It will be understood by those skilled in the art that Fig. 4 The only example of terminal device 4 does not constitute the restriction to terminal device 4, may include than illustrating more or fewer portions Part perhaps combines certain components or different components, such as the terminal device can also include input-output equipment, net Network access device, bus etc..
Alleged processor 40 can be central processing unit (Central Processing Unit, CPU), can also be Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor Deng.
The memory 41 can be the internal storage unit of the terminal device 4, such as the hard disk or interior of terminal device 4 It deposits.The memory 41 is also possible to the External memory equipment of the terminal device 4, such as be equipped on the terminal device 4 Plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card dodge Deposit card (Flash Card) etc..Further, the memory 41 can also both include the storage inside list of the terminal device 4 Member also includes External memory equipment.The memory 41 is for storing needed for the computer program and the terminal device Other programs and data.The memory 41 can be also used for temporarily storing the data that has exported or will export.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of described device is divided into different functional unit or module, more than completing The all or part of function of description.Each functional unit in embodiment, module can integrate in one processing unit, can also To be that each unit physically exists alone, can also be integrated in one unit with two or more units, it is above-mentioned integrated Unit both can take the form of hardware realization, can also realize in the form of software functional units.In addition, each function list Member, the specific name of module are also only for convenience of distinguishing each other, the protection scope being not intended to limit this application.Above system The specific work process of middle unit, module, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed The scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed device/terminal device and method, it can be with It realizes by another way.For example, device described above/terminal device embodiment is only schematical, for example, institute The division of module or unit is stated, only a kind of logical function partition, there may be another division manner in actual implementation, such as Multiple units or components can be combined or can be integrated into another system, or some features can be ignored or not executed.Separately A bit, shown or discussed mutual coupling or direct-coupling or communication connection can be through some interfaces, device Or the INDIRECT COUPLING or communication connection of unit, it can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated module/unit be realized in the form of SFU software functional unit and as independent product sale or In use, can store in a computer readable storage medium.Based on this understanding, the present invention realizes above-mentioned implementation All or part of the process in example method, can also instruct relevant hardware to complete, the meter by computer program Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on The step of stating each embodiment of the method.Wherein, the computer program includes computer program code, the computer program Code can be source code form, object identification code form, executable file or certain intermediate forms etc..Computer-readable Jie Matter may include: can carry the computer program code any entity or device, recording medium, USB flash disk, mobile hard disk, Magnetic disk, CD, computer storage, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that the meter The content that calculation machine readable medium includes can carry out increase and decrease appropriate according to the requirement made laws in jurisdiction with patent practice, It such as does not include electric carrier signal and telecommunications according to legislation and patent practice, computer-readable medium in certain jurisdictions Signal.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all It is included within protection scope of the present invention.

Claims (10)

1. a kind of method of Message Processing characterized by comprising
It receives message and obtains the first number of dormancy that current processor presets thread;
The second number of dormancy of thread is preset according to processor corresponding to preset dormancy duration calculation presetting message elimination duration;
If the number of dormancy that processor presets thread reaches third number of dormancy, the message is eliminated;The third suspend mode Number is equal to the first number of dormancy and adds the second number of dormancy.
2. the method as described in claim 1, which is characterized in that described to receive message and obtain the default thread of current processor Before first number of dormancy, further includes:
The default thread that processor is arranged repeats suspend mode, and preset dormancy duration is arranged.
3. method according to claim 2, which is characterized in that the default thread of the setting processor repeats suspend mode, And it is arranged after preset dormancy duration, further includes:
The number of dormancy of thread is preset by counter records processor.
4. the method as described in claim 1, which is characterized in that described to receive message and obtain the default thread of current processor First number of dormancy, comprising:
It receives message and reads the first number of dormancy that the processor recorded in counter presets thread.
5. the method as described in claim 1, which is characterized in that when the elimination according to preset dormancy duration calculation presetting message Second number of dormancy of long corresponding default thread, comprising:
When calculating presetting message elimination by formula " the second number of dormancy=presetting message eliminates duration ÷ preset dormancy duration " Second number of dormancy of long corresponding default thread.
6. a kind of device of Message Processing characterized by comprising
Obtain module, for receive message and obtain current processor preset thread the first number of dormancy;
Computing module presets thread for the processor according to corresponding to preset dormancy duration calculation presetting message elimination duration Second number of dormancy;
Cancellation module eliminates the message if the number of dormancy for processor to preset thread reaches third number of dormancy; The third number of dormancy is equal to the first number of dormancy and adds the second number of dormancy.
7. device as claimed in claim 6, which is characterized in that the acquisition module is specifically used for:
It receives message and reads the first number of dormancy that the processor recorded in counter presets thread.
8. device as claimed in claim 6, which is characterized in that the computing module is specifically used for:
When calculating presetting message elimination by formula " the second number of dormancy=presetting message eliminates duration ÷ preset dormancy duration " Second number of dormancy of long corresponding default thread.
9. a kind of terminal, which is characterized in that the processor, defeated including processor, input equipment, output equipment and memory Enter equipment, output equipment and memory to be connected with each other, wherein the memory is for storing computer program, the computer Program includes program instruction, and the processor is configured for calling described program instruction, is executed such as any one of claim 1-5 The method.
10. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage has computer journey Sequence, the computer program include program instruction, and described program instruction executes the processor such as The described in any item methods of claim 1-5.
CN201811139416.6A 2018-09-28 2018-09-28 Message processing method and device Active CN109213589B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811139416.6A CN109213589B (en) 2018-09-28 2018-09-28 Message processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811139416.6A CN109213589B (en) 2018-09-28 2018-09-28 Message processing method and device

Publications (2)

Publication Number Publication Date
CN109213589A true CN109213589A (en) 2019-01-15
CN109213589B CN109213589B (en) 2020-10-23

Family

ID=64981966

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811139416.6A Active CN109213589B (en) 2018-09-28 2018-09-28 Message processing method and device

Country Status (1)

Country Link
CN (1) CN109213589B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115904917A (en) * 2023-02-22 2023-04-04 湖北泰跃卫星技术发展股份有限公司 Internet of things exception handling method and device, computer equipment and storage medium
CN116501475A (en) * 2023-06-21 2023-07-28 杭州炬华科技股份有限公司 Thread scheduling method, system and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101141514A (en) * 2007-10-10 2008-03-12 中兴通讯股份有限公司 Method of improving precision of timer
CN101320337A (en) * 2008-07-16 2008-12-10 北京中星微电子有限公司 Timer and its implementing method
CN101866171A (en) * 2010-04-28 2010-10-20 北京北方微电子基地设备工艺研究中心有限责任公司 Timing control method and device for production line equipment
CN102521948A (en) * 2011-12-19 2012-06-27 深圳Tcl新技术有限公司 Method and device for controlling close-range TV view
CN106571852A (en) * 2016-11-03 2017-04-19 国网辽宁省电力有限公司检修分公司 Clock-system-independent DC transmission monitoring system data link on-off judging method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101141514A (en) * 2007-10-10 2008-03-12 中兴通讯股份有限公司 Method of improving precision of timer
CN101320337A (en) * 2008-07-16 2008-12-10 北京中星微电子有限公司 Timer and its implementing method
CN101866171A (en) * 2010-04-28 2010-10-20 北京北方微电子基地设备工艺研究中心有限责任公司 Timing control method and device for production line equipment
CN102521948A (en) * 2011-12-19 2012-06-27 深圳Tcl新技术有限公司 Method and device for controlling close-range TV view
CN106571852A (en) * 2016-11-03 2017-04-19 国网辽宁省电力有限公司检修分公司 Clock-system-independent DC transmission monitoring system data link on-off judging method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115904917A (en) * 2023-02-22 2023-04-04 湖北泰跃卫星技术发展股份有限公司 Internet of things exception handling method and device, computer equipment and storage medium
CN116501475A (en) * 2023-06-21 2023-07-28 杭州炬华科技股份有限公司 Thread scheduling method, system and medium
CN116501475B (en) * 2023-06-21 2023-10-20 杭州炬华科技股份有限公司 Thread scheduling method, system and medium

Also Published As

Publication number Publication date
CN109213589B (en) 2020-10-23

Similar Documents

Publication Publication Date Title
CN103209439A (en) Method, apparatus and device for monitoring data traffic
CN108449410A (en) Information management method, system and relevant apparatus in a kind of cloud platform
CN105095365A (en) Information flow data processing method and device
CN107147724A (en) A kind of information push method, server and computer-readable recording medium
CN109617829A (en) A kind of processing method of service request data, apparatus and system
CN107516158A (en) A kind of method for allocating tasks, device and terminal device
CN109213589A (en) A kind of method and device of Message Processing
CN109242433A (en) A kind of graphical system and method configured and execute office service process
CN107766160A (en) Queue message processing method and terminal device
CN105210039B (en) Terminal with for it is synchronous its application method
CN108874738A (en) Distributed parallel operation method, device, computer equipment and storage medium
CN111694677A (en) Message queue management method, device, terminal and computer-readable storage medium
CN109445954A (en) A kind of execution method, terminal device and the storage medium of timed task
CN106874079A (en) A kind of method and device of tasks carrying
WO2016107102A1 (en) Short message concurrent sending service processing method and apparatus
CN109857190A (en) A kind of clock signal processing method, device, equipment and readable storage medium storing program for executing
CN108536356A (en) Seating stand processing method, device and computer readable storage medium
CN113743879A (en) Automatic rule processing method, system and related equipment
CN107220811B (en) Method and device for activating nodes in process
CN110865877B (en) Task request response method and device
CN109063926A (en) Plan generated energy determines method, system and terminal device in period
CN115185794A (en) Analysis method and device of service call chain and electronic equipment
CN114546926A (en) Core cluster synchronization, control method, data processing method, core, device, and medium
CN109799715A (en) Data receiver method, device, terminal device
CN112650971B (en) Method, device, equipment and storage medium for realizing formula calculation

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