CN110633161B - Broadcast processing method and device - Google Patents

Broadcast processing method and device Download PDF

Info

Publication number
CN110633161B
CN110633161B CN201910887803.6A CN201910887803A CN110633161B CN 110633161 B CN110633161 B CN 110633161B CN 201910887803 A CN201910887803 A CN 201910887803A CN 110633161 B CN110633161 B CN 110633161B
Authority
CN
China
Prior art keywords
broadcast
receiving
queue
target
overtime
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910887803.6A
Other languages
Chinese (zh)
Other versions
CN110633161A (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.)
Beijing Anyun Century Technology Co Ltd
Original Assignee
Beijing Anyun Century Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Anyun Century Technology Co Ltd filed Critical Beijing Anyun Century Technology Co Ltd
Priority to CN201910887803.6A priority Critical patent/CN110633161B/en
Publication of CN110633161A publication Critical patent/CN110633161A/en
Application granted granted Critical
Publication of CN110633161B publication Critical patent/CN110633161B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications
    • 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/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention discloses a broadcast processing method and a broadcast processing device, relates to the technical field of computers, and mainly aims to construct a self-checking mechanism of a broadcast mechanism and avoid an abnormal state of broadcast blockage. The main technical scheme of the invention is as follows: extracting target broadcast to be processed from a broadcast queue, and acquiring the continuous overtime times of a process corresponding to the target broadcast; if the continuous overtime times reach a threshold value, detecting whether the broadcast queue has processing abnormity; and if the broadcast queue is determined to be abnormal, cleaning receiving components for receiving the target broadcast in the process. The invention is mainly used for monitoring the running health state of the broadcasting mechanism.

Description

Broadcast processing method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for processing a broadcast.
Background
In Android, after some operations are completed, a broadcast is sent, for example, when a short message is sent or a call is made, if a certain program receives the broadcast, corresponding processing is performed. The broadcasting mechanism has the greatest characteristic that the sender does not care whether the receiver receives the data or not, and does not care how the receiver processes the data. The Android broadcasting mechanism comprises three basic elements: broadcast (Broadcast): for transmitting a broadcast; broadcast receiver (BroadcastReceiver) is a component provided for implementing system broadcasts: for receiving a broadcast; intent content (Intent): a medium for storing broadcast associated information.
In the Android native system, broadcast is one of four important components of Android, and a notification mechanism of broadcast is applied to various services and all corners of APP and is an important pipeline for keeping events flowing normally. The universality of the application of the broadcasting mechanism also causes a series of chain reactions, such as delayed event response, alarm clock delay and the like, to occur once the broadcasting mechanism works abnormally, so that the broadcasting is blocked, and the current android native system does not have a self-checking and error-proofing mechanism for the broadcasting mechanism, so that the system cannot timely find and correct the working abnormal state of the broadcasting mechanism.
Disclosure of Invention
In view of the above problems, the present invention provides a broadcast processing method and apparatus, and mainly aims to construct a self-checking mechanism of a broadcast mechanism, so as to avoid an abnormal state of broadcast congestion.
In order to achieve the purpose, the invention mainly provides the following technical scheme:
in one aspect, the present invention provides a broadcast processing method, which specifically includes:
extracting target broadcast to be processed from a broadcast queue, and acquiring the continuous overtime times of a process corresponding to the target broadcast;
if the continuous overtime times reach a threshold value, detecting whether the broadcast queue has processing abnormity;
and if the broadcast queue is determined to be abnormal, cleaning receiving components for receiving the target broadcast in the process.
In another aspect, the present invention provides a broadcast processing apparatus, which specifically includes:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for extracting target broadcasts to be processed from a broadcast queue and acquiring the continuous overtime times of a process corresponding to the received target broadcasts;
the detection unit is used for detecting whether the broadcast queue has abnormal processing or not if the continuous overtime times obtained by the acquisition unit reach a threshold value;
and the clearing unit is used for clearing the receiving assembly for receiving the target broadcast in the process when the detection unit determines that the broadcast queue is abnormal.
In another aspect, the present invention provides a storage medium for storing a computer program, where the computer program controls a device in which the storage medium is located to execute the above-mentioned broadcast processing method when running.
In another aspect, the present invention provides an electronic device comprising a memory, a processor, and a communication bus;
the memory is in communication connection with the processor through the communication bus;
the memory stores computer-executable instructions, and the processor is used for executing the computer-executable instructions to realize the broadcast processing method.
By means of the technical scheme, the broadcast processing method and the broadcast processing device provided by the invention are characterized in that before a broadcast is sent, whether continuous overtime exists in a process corresponding to the broadcast is judged, if the continuous overtime exists in the process corresponding to the broadcast, the processing condition of a current broadcast queue needs to be detected to judge whether the processing of the broadcast queue is abnormal, and when the broadcast queue is determined to have processing abnormality, a receiving component corresponding to the broadcast is cleaned to prevent the overtime from occurring after the broadcast is sent.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart illustrating a method for processing a broadcast according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating another broadcast processing method according to an embodiment of the present invention;
fig. 3 is a block diagram showing a processing apparatus for broadcasting according to an embodiment of the present invention;
fig. 4 is a block diagram showing a processing apparatus of another broadcast according to an embodiment of the present invention;
fig. 5 shows a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
The embodiment of the invention provides a broadcast processing method which is mainly applied to an Android system, is used for optimizing and improving a broadcast notification mechanism in the Android system, realizes real-time detection of broadcast abnormal states by monitoring and counting broadcast receiving conditions in a broadcast process, reduces the occurrence of broadcast abnormal conditions, and improves the stability of the system. The method comprises the following specific steps as shown in figure 1:
step 101, extracting a target broadcast to be processed from a broadcast queue, and acquiring the continuous timeout times of a process corresponding to the target broadcast.
All broadcast messages are queued in the Android system, and the broadcasts in the queue are sent in the order from beginning to end. The broadcast queue is mainly divided into foreground queue and background queue, and the foreground queue and the background queue are subdivided into parallel queue and serial queue. Wherein, the allowed overtime time of the foreground queue for each broadcast receiver is shorter; the background queue allows longer timeout periods for each broadcast receiver. The parallel queue is that all parallel broadcast receivers dynamically registered by programming codes are in the queue; xml is statically registered with all broadcast receivers and serial broadcast receivers are in this queue.
In this step, when a broadcast queue is to send one of target broadcasts, a receiving condition of a process related to the target broadcast is obtained first, where the related process refers to a process that receives the target broadcast, generally, a broadcast sent by an Android system may have a designated receiving process or be received by all processes, while in one process, there may be multiple threads, and what actually needs the target broadcast is one or more threads in the process, and there may be one receiving component corresponding to each thread. That is, the broadcast transmitted in the system is received by at least one receiving component, and if there are multiple receiving components, the receiving components may belong to a process or multiple processes.
In this embodiment, when each receiving component receives a broadcast, if the receiving component is overtime, corresponding timeout data is recorded, and when a process is overtime during continuous broadcast reception, the number of continuous overtime times is generated. When a process receives broadcasts continuously, if the process has a plurality of receiving components, the number of times of continuous timeout is not limited to be received by the same receiving component in the process. For example, one process a has two receiving components a and b, where a continuously receives 4 broadcasts, the first one has a reception and times out, the second one also times out when received by b, at this time, the continuous timeout number of a is 2, the third one is received by b and times out, the continuous timeout number is accumulated to 3, and when the fourth one is received by a, the continuous timeout number is cleared when the third one is not timed out.
In this embodiment, the statistics of the continuous timeout times are counted for the processes, and when the statistics are obtained, the statistics need to be obtained one by one according to the received processes, that is, if the target broadcast has 3 processes to receive, the respective continuous timeout times of the 3 processes are needed, and the subsequent steps are performed one by one.
And 102, if the continuous overtime times reach a threshold value, detecting whether the broadcast queue has processing abnormity.
The value of the threshold may be set by self-definition according to the needs of practical application, and when the number of times of continuous timeout of the process reaches the threshold, an anomaly detection operation for the broadcast queue is triggered, that is, when the received process has continuous timeout, it is considered that the broadcast queue has a possibility of processing an anomaly, a specific detection mode of the detection mode needs to be set according to a specific processing anomaly state, for example, abnormal conditions such as broadcast blocking, failure to send, and the like, and different anomaly states need to configure corresponding detection conditions, which is not specifically limited in this embodiment.
When the step determines that the broadcast queue has processing abnormality, step 103 is executed.
And 103, if the broadcast queue is determined to be abnormal, cleaning receiving components for receiving the target broadcast in the process.
Because the process receiving the target broadcast has a continuous timeout condition and the broadcast queue has processing exception, in order to improve the processing efficiency and accuracy of the target broadcast and avoid the situation that the target broadcast continues to have a reception timeout condition, in this step, the receiving component of the process is cleared, that is, the receiving component is prohibited from receiving the target broadcast, wherein the receiving component refers to one or more receiving components in the process that need to receive the target broadcast.
As can be seen from the embodiment shown in fig. 1, in the broadcast processing method provided in the embodiment of the present invention, the receiving condition of the transmitted broadcast is monitored, the number of times of continuous timeout for the process is counted, and the counted number is used as a condition for triggering the broadcast queue to perform abnormal state detection, and when the broadcast queue is in an abnormal state, the receiving component in the corresponding process is cleaned to reduce the occurrence of the broadcast timeout condition, so that the abnormal state of the broadcast queue is alleviated and eliminated, and the robustness of the system broadcast mechanism and the stability of the system are increased.
Further, the embodiment of the present invention specifically uses a broadcast mechanism in an Android system as an example to describe in detail a process of detecting and processing a blocking exception in a broadcast queue, and specifically as shown in fig. 2, the process includes:
step 201, extracting the target broadcast to be processed from the broadcast queue, and acquiring the continuous timeout times of the process corresponding to the received target broadcast.
Specifically, the number of consecutive timeouts in this embodiment is statistically obtained based on the timeout data generated by the receiving component receiving the broadcast, and these timeout data are generally stored in a buffer for statistical updating in real time. In practical application, the timeout data generated in the processing process of each broadcast can be recorded through a broadcast timeout processing mechanism in the native Android system, and is stored in a cache to serve as basic data for counting the continuous timeout times of each process.
In this step, before obtaining the continuous timeout times of the processes corresponding to the received target broadcast, the system may count the continuous timeout times of the processes based on the timeout data in the cache, that is, for each broadcast, if the process receiving the broadcast has the timeout data, the system may add one to the current value of the timeout times corresponding to the process, and if the process does not have the timeout data, the system may clear the timeout times corresponding to the process. In the specific execution process, the process is identified by identification information corresponding to the received broadcast, for example, the number Pid (process identification) of the process in the linux system, and the continuous timeout times of the corresponding process are obtained through the Pid. When the number of consecutive time-outs of the process reaches a preset threshold, step 202 is performed.
Step 202, detecting whether the broadcast queue has processing blockage.
In this embodiment, the detection is performed for the broadcast queue blocking exception, where the detection trigger condition is that the number of consecutive times out obtained in step 201 reaches a preset threshold, and the specific detection process is as follows:
firstly, whether the number of broadcasts to be processed in the broadcast queue is greater than a preset number is judged, namely whether the total number of broadcasts in the broadcast queue is excessive is judged, the preset number is a user-defined value, and the preset number is one of indexes for measuring whether the number of broadcasts in the broadcast queue is blocked.
Then, if the number of the broadcasts in the broadcast queue is larger than the preset number, whether the number proportion of the same broadcasts in the broadcast queue reaches the preset proportion is further judged, namely whether a large number of the same broadcasts exist in the broadcast queue is judged, wherein the same broadcasts refer to broadcasts with the same identification, such as keywords of broadcast Action. The predetermined duty ratio is also a custom value, and by this determination, the duty ratio of active broadcasts in the broadcast queue can be determined, and generally, the greater the probability of a broadcast queue becoming blocked if there are more inactive or repeated broadcasts in the queue.
Finally, when the number ratio of the same broadcasts reaches the preset ratio, it is determined that the broadcast queue has a processing blocking state, and at this time, the step 203 needs to be executed to perform a cleaning operation.
Step 203, cleaning up the receiving component for receiving the target broadcast in the process.
In this embodiment, the cleaned receiving component is determined according to the actual working state of the receiving component, and is not cleaned for all receiving components receiving the target broadcast in the process. That is, when there are multiple receiving components in the process that receive the target broadcast, this step will obtain the timeout data for each receiving component to receive the broadcast, which can be extracted from the system cache.
What is to be cleared up in this step is that the receiving component may be a receiving component that has timed out the last received broadcast or continuously timed out a plurality of times of received broadcasts, or may be a receiving component that has timed out the total number of received broadcasts greater than a specified number.
And step 204, judging whether other receiving components exist in the target broadcast.
After the cleaning operation of step 203 is completed, since the street fire rate component corresponding to the target broadcast is cleaned, before the target broadcast is sent, it needs to be further determined whether there are other receiving components besides the cleaned receiving component, and it should be noted that the other receiving components are not limited to receiving components belonging to the same process as the cleaned receiving component or receiving components belonging to other processes.
If other receiving components for receiving the target broadcast exist, the target broadcast is sent, otherwise, because the target broadcast does not have a receiving object, the sending operation can not be executed any more, the target broadcast is directly deleted, and the next broadcast is extracted from the broadcast queue for processing.
Further, based on the cleared receiving components, in addition to the above processing of the target broadcast, the present embodiment may also clear the broadcasts in the broadcast queue to reduce the number of broadcasts in the broadcast queue, thereby reducing the degree of queue congestion. The specific way to clear up the broadcast in the broadcast queue may be: the method comprises the steps of detecting broadcasts in a broadcast queue, judging whether broadcasts with all receiving components cleared exist or not, namely detecting whether broadcasts without receiving objects exist in the broadcast queue or not, and deleting the broadcasts from the broadcast queue if the broadcasts exist.
And step 205, clearing the overtime data.
In this embodiment, the key to monitor the broadcast mechanism is to record and statistically analyze the timeout data, and in this embodiment, the timeout data generated by the receiving component is recorded in the cache of the system, but considering that the cache resources of the system are limited, the timeout data in the cache needs to be periodically cleaned in order to not occupy the cache resources too much.
In this step, a trigger condition for clearing the timeout data is to determine the number of the broadcast pieces recorded in the cache that are received overtime, that is, to detect whether the number of the broadcast pieces recorded in the cache reaches a preset number, and if so, to trigger deletion of the timeout data in the cache.
Further, since the timeout data in the cache needs to be counted in real time, during cleaning, the preferred cleaning manner in this step is to classify the timeout data into valid data and invalid data, where the valid data refers to the timeout data that needs to be counted in the process of subsequent broadcast transmission, and the invalid data refers to that the process to which the receiving component belongs has been logged out, and at this time, the receiving component has failed, and it is impossible to receive subsequent broadcasts. Based on the classification, invalid data is deleted. Specifically, the identification method for invalid data is as follows: and acquiring identification information of a process to which the overtime data belongs, such as the Pid of the process, judging whether the corresponding process exists according to the identification information, namely judging whether the process exists in the system, and if not, deleting the overtime data from the cache.
Further, as an implementation of the foregoing broadcast processing method, an embodiment of the present invention provides a broadcast processing apparatus, where the apparatus is mainly used to construct a self-checking mechanism of a broadcast mechanism, so as to avoid an abnormal state of broadcast congestion. For convenience of reading, details in the foregoing method embodiments are not described in detail again in this apparatus embodiment, but it should be clear that the apparatus in this embodiment can correspondingly implement all the contents in the foregoing method embodiments. As shown in fig. 3, the apparatus specifically includes:
an obtaining unit 31, configured to extract a target broadcast to be processed from a broadcast queue, and obtain a continuous timeout number of a process corresponding to receiving the target broadcast;
a detecting unit 32, configured to detect whether the broadcast queue is abnormal in processing if the number of consecutive times out obtained by the obtaining unit 31 reaches a threshold;
a cleaning unit 33, configured to clean up the receiving component receiving the target broadcast in the process when the detection unit 32 determines that the broadcast queue processing is abnormal.
Further, as shown in fig. 4, the apparatus further includes:
a recording unit 34, configured to record timeout data generated in the processing process of each broadcast before the obtaining unit 31 obtains the number of consecutive times of timeout of the process corresponding to the target broadcast;
the counting unit 35 is configured to count the number of continuous timeout times of each process by using the timeout data recorded by the recording unit 34 according to the identification information of the process corresponding to the received broadcast.
Further, as shown in fig. 4, the detection unit 32 includes:
a first determining module 321, configured to determine whether the number of broadcasts to be processed in the broadcast queue is greater than a preset number;
a second determining module 322, configured to determine whether a ratio of the number of the same broadcasts in the broadcast queue reaches a preset ratio when the first determining module 321 determines that the number of the same broadcasts in the broadcast queue is greater than the preset ratio;
a determining module 323, configured to determine that processing blocking occurs in the broadcast queue when the second determining module 322 determines that the processing blocking occurs.
Further, as shown in fig. 4, the cleaning unit 33 includes:
an obtaining module 331, configured to obtain, when there are multiple receiving components receiving the target broadcast in the process, timeout data of each receiving component receiving the broadcast;
a cleaning module 332, configured to clean a receiving component when the broadcast received by the receiving component last time times out, or the number of broadcasts received by the receiving component that time out is greater than a specified number.
Further, as shown in fig. 4, the apparatus further includes:
a first processing unit 36, configured to determine whether there are other receiving components in the target broadcast after the cleaning unit 33 cleans the receiving components in the process that receive the target broadcast; if yes, sending the target broadcast; and if not, deleting the target broadcast.
Further, as shown in fig. 4, the apparatus further includes:
a second processing unit 37, configured to detect broadcasts in the broadcast queue after the cleaning unit 33 cleans up the receiving components that receive the target broadcast in the process, and determine whether there is a broadcast whose receiving components are all cleaned up; and if so, deleting the broadcast from the broadcast queue.
Further, as shown in fig. 4, the recording unit 34 is further configured to store the timeout data in a cache;
the device further comprises:
a buffer cleaning unit 38, configured to detect whether the number of broadcast pieces recorded in the buffer by the recording unit 34 reaches a preset number; and if so, deleting the overtime data in the cache.
Further, as shown in fig. 4, the cache cleaning unit 38 includes:
an obtaining module 381, configured to obtain identification information of a process to which the timeout data belongs;
the detecting module 382 is configured to determine whether the process exists according to the identification information obtained by the obtaining module 381;
a deleting module 383, configured to delete the timeout data from the cache when the detecting module 382 determines that the process does not exist.
Further, an embodiment of the present invention further provides a storage medium, where the storage medium is used for storing a computer program, where the computer program controls, when running, a device on which the storage medium is located to execute the processing method of the broadcast.
In addition, an embodiment of the present invention further provides an electronic device, as shown in fig. 5, including a memory 41, a processor 42, and a communication bus 43;
the memory 41 is connected with the processor 42 in a communication mode through the communication bus 43;
the memory stores computer-executable instructions, and the processor is configured to execute the computer-executable instructions to implement the processing method of the broadcast shown in fig. 1 or fig. 2.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to the related descriptions of other embodiments.
It will be appreciated that the relevant features of the method and apparatus described above are referred to one another. In addition, "first", "second", and the like in the above embodiments are for distinguishing the embodiments, and do not represent merits of the embodiments.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system is apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In addition, the memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art to which the present application pertains. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
The invention also discloses the following technical scheme:
a1, a method for processing broadcast, the method comprising:
extracting target broadcast to be processed from a broadcast queue, and acquiring the continuous overtime times of a process corresponding to the target broadcast;
if the continuous overtime times reach a threshold value, detecting whether the broadcast queue has processing abnormity;
and if the broadcast queue is determined to be abnormal, cleaning receiving components for receiving the target broadcast in the process.
A2, before acquiring the number of consecutive timeouts of the process corresponding to the reception of the target broadcast according to the method of A1, the method further comprising:
recording timeout data generated in the processing process of each broadcast;
and according to the identification information of the process corresponding to the received broadcast, utilizing the timeout data to count the continuous timeout times of each process.
A3, according to the method in A1, detecting whether a processing exception occurs in the broadcast queue, including:
judging whether the number of broadcasts to be processed in the broadcast queue is larger than a preset number or not;
if so, judging whether the number ratio of the same broadcasts in the broadcast queue reaches a preset ratio;
and if so, determining that the processing blockage of the broadcast queue occurs.
A4, according to the method of A1, cleaning up receiving components in the process that receive the target broadcast, including:
when a plurality of receiving components for receiving the target broadcast exist in the process, acquiring timeout data of each receiving component for receiving the broadcast;
and if the broadcast received by the receiving component last time is overtime or the number of the overtime broadcasts received by the receiving component is larger than the specified number, cleaning the receiving component.
A5, the method of any one of A1-A4, further comprising, after cleaning up receiving components in the process that receive the target broadcast:
judging whether other receiving components exist in the target broadcast or not;
if yes, sending the target broadcast;
and if not, deleting the target broadcast.
A6, the method of any one of A1-A4, further comprising, after cleaning up receiving components in the process that receive the target broadcast:
detecting the broadcast in the broadcast queue, and judging whether the broadcast with all the cleaned receiving components exists;
and if so, deleting the broadcast from the broadcast queue.
A7, the method according to a2, wherein the recording of the timeout data generated during the processing of each broadcast includes:
storing the timeout data in a cache;
the method further comprises the following steps:
detecting whether the number of the broadcasting pieces recorded in the cache reaches a preset number;
and if so, deleting the overtime data in the cache.
A8, according to the method in A7, deleting the timeout data in the cache, including:
acquiring identification information of a process to which overtime data belongs;
judging whether the process exists or not according to the identification information;
and if the overtime data does not exist, deleting the overtime data from the cache.
B9, a processing apparatus of a broadcast, the apparatus comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for extracting target broadcasts to be processed from a broadcast queue and acquiring the continuous overtime times of a process corresponding to the received target broadcasts;
the detection unit is used for detecting whether the broadcast queue has abnormal processing or not if the continuous overtime times obtained by the acquisition unit reach a threshold value;
and the clearing unit is used for clearing the receiving assembly for receiving the target broadcast in the process when the detection unit determines that the broadcast queue is abnormal.
B10, the apparatus according to B9, the apparatus further comprising:
the recording unit is used for recording the overtime data generated in the processing process of each broadcast before the acquiring unit acquires the continuous overtime times of the process corresponding to the received target broadcast;
and the counting unit is used for counting the continuous overtime times of each process by utilizing the overtime data recorded by the recording unit according to the identification information of the process corresponding to the received broadcast.
B11, the apparatus according to B9, the detection unit comprising:
the first judgment module is used for judging whether the number of the broadcasts to be processed in the broadcast queue is greater than a preset number or not;
the second judgment module is used for judging whether the number ratio of the same broadcasts in the broadcast queue reaches a preset ratio or not when the first judgment module determines that the number ratio is larger than the preset ratio;
a determining module, configured to determine that processing blocking occurs in the broadcast queue when the second determining module determines that the processing blocking occurs.
B12, the device according to B9, the cleaning unit comprising:
an obtaining module, configured to obtain timeout data of each receiving component for receiving the broadcast when multiple receiving components for receiving the target broadcast exist in the process;
and the clearing module is used for clearing the receiving component when the broadcast received by the receiving component last time is overtime or the receiving overtime broadcast number of the receiving component is greater than the specified number.
B13, the apparatus according to any one of B9-B12, further comprising:
the first processing unit is used for judging whether other receiving components exist in the target broadcast or not after the cleaning unit cleans the receiving components which receive the target broadcast in the process; if yes, sending the target broadcast; and if not, deleting the target broadcast.
B14, the apparatus according to any one of B9-B12, further comprising:
the second processing unit is used for detecting the broadcast in the broadcast queue after the cleaning unit cleans the receiving components for receiving the target broadcast in the process, and judging whether the broadcast with all cleaned receiving components exists; and if so, deleting the broadcast from the broadcast queue.
B15, the apparatus according to B10, the recording unit further configured to store the timeout data in a cache;
the device further comprises:
the buffer cleaning unit is used for detecting whether the number of the broadcasting pieces recorded in the buffer by the recording unit reaches a preset number; and if so, deleting the overtime data in the cache.
B16, the apparatus of B15, the cache scrubbing unit comprising:
the acquisition module is used for acquiring the identification information of the process to which the overtime data belongs;
the detection module is used for judging whether the process exists or not according to the identification information obtained by the acquisition module;
and the deleting module is used for deleting the overtime data from the cache when the detecting module determines that the process does not exist.

Claims (18)

1. A method for processing a broadcast, the method comprising:
extracting target broadcast to be processed from a broadcast queue, and acquiring continuous overtime times of a process corresponding to the received target broadcast;
if the continuous overtime times reach a threshold value, detecting whether the broadcast queue has processing abnormity;
if the broadcast queue is determined to be abnormal, cleaning a receiving assembly for receiving the target broadcast in the process;
if the process has a plurality of receiving components for receiving the target broadcast, acquiring the continuous timeout times of the process corresponding to receiving the target broadcast includes:
and acquiring the sum of the continuous overtime times accumulated by each receiving component for receiving the target broadcast in the process as the continuous overtime times of the process.
2. The method of claim 1, wherein before obtaining the number of consecutive timeouts of the process corresponding to receiving the target broadcast, the method further comprises:
recording timeout data generated in the processing process of each broadcast;
and according to the identification information of the process corresponding to the received broadcast, utilizing the timeout data to count the continuous timeout times of each process.
3. The method of claim 1, wherein detecting whether a processing exception occurs in the broadcast queue comprises:
judging whether the number of broadcasts to be processed in the broadcast queue is greater than a preset number or not;
if so, judging whether the number ratio of the same broadcasts in the broadcast queue reaches a preset ratio;
and if so, determining that the processing blockage of the broadcast queue occurs.
4. The method of claim 1, wherein cleaning up receiving components in the process that receive the target broadcast comprises:
when a plurality of receiving components for receiving the target broadcast exist in the process, acquiring timeout data of each receiving component for receiving the broadcast;
and if the broadcast received by the receiving component last time is overtime or the number of the overtime broadcasts received by the receiving component is larger than the specified number, cleaning the receiving component.
5. The method of any of claims 1-4, wherein after cleaning up receiving components in the process that receive the target broadcast, the method further comprises:
judging whether other receiving components exist in the target broadcast or not;
if yes, sending the target broadcast;
and if not, deleting the target broadcast.
6. The method of any of claims 1-4, wherein after cleaning up receiving components in the process that receive the target broadcast, the method further comprises:
detecting the broadcast in the broadcast queue, and judging whether the broadcast with all the cleaned receiving components exists;
and if so, deleting the broadcast from the broadcast queue.
7. The method of claim 2, wherein recording time-out data generated during processing of each broadcast comprises:
storing the timeout data in a cache;
the method further comprises the following steps:
detecting whether the number of the broadcast pieces recorded in the cache reaches a preset number;
and if so, deleting the overtime data in the cache.
8. The method of claim 7, wherein deleting the timeout data in the cache comprises:
acquiring identification information of a process to which overtime data belongs;
judging whether the process exists according to the identification information;
and if the timeout data does not exist, deleting the timeout data from the cache.
9. An apparatus for processing a broadcast, the apparatus comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for extracting target broadcasting to be processed from a broadcasting queue and acquiring the continuous overtime times of a process corresponding to the received target broadcasting;
the detection unit is used for detecting whether the broadcast queue has abnormal processing or not if the continuous overtime times obtained by the acquisition unit reach a threshold value;
the clearing unit is used for clearing a receiving component for receiving the target broadcast in the process when the detection unit determines that the broadcast queue is abnormal;
if the process has a plurality of receiving components for receiving the target broadcast, the obtaining unit is configured to:
and acquiring the sum of the continuous overtime times accumulated by each receiving component for receiving the target broadcast in the process as the continuous overtime times of the process.
10. The apparatus of claim 9, further comprising:
the recording unit is used for recording the overtime data generated in the processing process of each broadcast before the acquiring unit acquires the continuous overtime times of the process corresponding to the received target broadcast;
and the counting unit is used for counting the continuous overtime times of each process by utilizing the overtime data recorded by the recording unit according to the identification information of the process corresponding to the received broadcast.
11. The apparatus of claim 9, wherein the detection unit comprises:
the first judgment module is used for judging whether the number of the broadcasts to be processed in the broadcast queue is greater than a preset number or not;
the second judgment module is used for judging whether the number ratio of the same broadcasts in the broadcast queue reaches a preset ratio or not when the first judgment module determines that the number ratio is larger than the preset ratio;
a determining module, configured to determine that processing blocking occurs in the broadcast queue when the second determining module determines that the processing blocking occurs.
12. The apparatus of claim 9, wherein the cleaning unit comprises:
an obtaining module, configured to obtain timeout data of each receiving component for receiving the broadcast when multiple receiving components for receiving the target broadcast exist in the process;
and the clearing module is used for clearing the receiving component when the broadcast received by the receiving component last time is overtime or the receiving overtime broadcast number of the receiving component is greater than a specified number.
13. The apparatus according to any one of claims 9-12, wherein the apparatus further comprises:
the first processing unit is used for judging whether other receiving components exist in the target broadcast or not after the cleaning unit cleans the receiving components which receive the target broadcast in the process; if yes, sending the target broadcast; and if not, deleting the target broadcast.
14. The apparatus according to any one of claims 9-12, wherein the apparatus further comprises:
the second processing unit is used for detecting the broadcast in the broadcast queue after the cleaning unit cleans the receiving components for receiving the target broadcast in the process, and judging whether the broadcast with all cleaned receiving components exists; and if so, deleting the broadcast from the broadcast queue.
15. The apparatus of claim 10, wherein the recording unit is further configured to store the timeout data in a cache;
the device further comprises:
the buffer cleaning unit is used for detecting whether the number of the broadcasting pieces recorded in the buffer by the recording unit reaches a preset number; and if so, deleting the overtime data in the cache.
16. The apparatus of claim 15, wherein the buffer cleaning unit comprises:
the acquisition module is used for acquiring the identification information of the process to which the overtime data belongs;
the detection module is used for judging whether the process exists according to the identification information obtained by the acquisition module;
and the deleting module is used for deleting the overtime data from the cache when the detecting module determines that the process does not exist.
17. A storage medium for storing a computer program, wherein the computer program is operable to control an apparatus in which the storage medium is located to perform the processing method of the broadcast according to any one of claims 1-8.
18. An electronic device comprising a memory, a processor, and a communication bus;
the memory is in communication connection with the processor through the communication bus;
the memory has stored therein computer-executable instructions for execution by the processor to implement the method of any one of claims 1-8.
CN201910887803.6A 2019-09-19 2019-09-19 Broadcast processing method and device Active CN110633161B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910887803.6A CN110633161B (en) 2019-09-19 2019-09-19 Broadcast processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910887803.6A CN110633161B (en) 2019-09-19 2019-09-19 Broadcast processing method and device

Publications (2)

Publication Number Publication Date
CN110633161A CN110633161A (en) 2019-12-31
CN110633161B true CN110633161B (en) 2022-09-02

Family

ID=68971803

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910887803.6A Active CN110633161B (en) 2019-09-19 2019-09-19 Broadcast processing method and device

Country Status (1)

Country Link
CN (1) CN110633161B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113515424A (en) * 2021-04-25 2021-10-19 广东邦盛北斗技术服务有限公司 Queue jam judging method and storage medium
CN116701008A (en) * 2022-09-23 2023-09-05 荣耀终端有限公司 Broadcasting method and apparatus

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106851014A (en) * 2017-03-10 2017-06-13 广东欧珀移动通信有限公司 Adjust method, device and the terminal of broadcast message queue
CN106851015A (en) * 2017-03-10 2017-06-13 广东欧珀移动通信有限公司 Adjust method, device and the terminal of broadcast message queue
CN106919459A (en) * 2017-03-10 2017-07-04 广东欧珀移动通信有限公司 A kind of management method of broadcast recipients, device and terminal
CN106921947A (en) * 2017-03-10 2017-07-04 广东欧珀移动通信有限公司 Adjust method, device and the terminal of broadcast message queue
CN106936827A (en) * 2017-03-10 2017-07-07 广东欧珀移动通信有限公司 A kind of broadcast recipients' queue regulation method, device and terminal
CN106933685A (en) * 2017-03-10 2017-07-07 广东欧珀移动通信有限公司 A kind of management method of broadcast recipients, device and terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8248936B2 (en) * 2009-04-01 2012-08-21 Lockheed Martin Corporation Tuning congestion control in IP multicast to mitigate the impact of blockage

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106851014A (en) * 2017-03-10 2017-06-13 广东欧珀移动通信有限公司 Adjust method, device and the terminal of broadcast message queue
CN106851015A (en) * 2017-03-10 2017-06-13 广东欧珀移动通信有限公司 Adjust method, device and the terminal of broadcast message queue
CN106919459A (en) * 2017-03-10 2017-07-04 广东欧珀移动通信有限公司 A kind of management method of broadcast recipients, device and terminal
CN106921947A (en) * 2017-03-10 2017-07-04 广东欧珀移动通信有限公司 Adjust method, device and the terminal of broadcast message queue
CN106936827A (en) * 2017-03-10 2017-07-07 广东欧珀移动通信有限公司 A kind of broadcast recipients' queue regulation method, device and terminal
CN106933685A (en) * 2017-03-10 2017-07-07 广东欧珀移动通信有限公司 A kind of management method of broadcast recipients, device and terminal

Also Published As

Publication number Publication date
CN110633161A (en) 2019-12-31

Similar Documents

Publication Publication Date Title
CN110661659B (en) Alarm method, device and system and electronic equipment
US8473789B2 (en) Memory leak monitoring system and associated methods
CN110213068B (en) Message middleware monitoring method and related equipment
US20180365085A1 (en) Method and apparatus for monitoring client applications
US8805999B2 (en) Administering event reporting rules in a distributed processing system
US9286143B2 (en) Flexible event data content management for relevant event and alert analysis within a distributed processing system
US8737231B2 (en) Dynamic administration of event pools for relevant event and alert analysis during event storms
US8713366B2 (en) Restarting event and alert analysis after a shutdown in a distributed processing system
US8645757B2 (en) Administering incident pools for event and alert analysis
CN100490397C (en) Alarm processing method and alarming system
US8954811B2 (en) Administering incident pools for incident analysis
CN110633161B (en) Broadcast processing method and device
US9658902B2 (en) Adaptive clock throttling for event processing
US9256482B2 (en) Determining whether to send an alert in a distributed processing system
CN107204875B (en) Data reporting link monitoring method and device, electronic equipment and storage medium
US20170185464A1 (en) Detecting flapping in resource measurements
US20060031487A1 (en) Apparatuses for generation and collection of information, and computer-readable recording medium
CN113001590A (en) Robot fault recovery method, device, equipment and computer readable storage medium
CN113206797A (en) Flow control method and device, electronic equipment and storage medium
JP5623557B2 (en) Method, apparatus, and computer program in a multi-threaded computing environment for collecting diagnostic data
CN113472582B (en) Systems and methods for alarm association and alarm aggregation in information technology monitoring
WO2024139333A1 (en) Method and device for predicting operating state of storage cluster
US20080098404A1 (en) Information processing apparatus, control method for information processing apparatus and program
CN111586129A (en) Alarm method and device for data synchronization, electronic equipment and storage medium
JP2006331026A (en) Message analysis system and message analysis program

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