CN108647100A - A kind of method that single thread daily record sends management - Google Patents

A kind of method that single thread daily record sends management Download PDF

Info

Publication number
CN108647100A
CN108647100A CN201810336345.2A CN201810336345A CN108647100A CN 108647100 A CN108647100 A CN 108647100A CN 201810336345 A CN201810336345 A CN 201810336345A CN 108647100 A CN108647100 A CN 108647100A
Authority
CN
China
Prior art keywords
daily record
sends
data
tasks
distributes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810336345.2A
Other languages
Chinese (zh)
Inventor
郭艳杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kuwo Technology Co Ltd
Original Assignee
Beijing Kuwo 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 Kuwo Technology Co Ltd filed Critical Beijing Kuwo Technology Co Ltd
Priority to CN201810336345.2A priority Critical patent/CN108647100A/en
Publication of CN108647100A publication Critical patent/CN108647100A/en
Pending legal-status Critical Current

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/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • G06F9/522Barrier synchronisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The present invention relates to a kind of methods that single thread daily record sends management, include the following steps:It generates daily record and distributes request, daily record distributes management module reception daily record and distributes request, daily record distributes management module and generates daily record transmission sendDataTask tasks, and synchronous task queue is distributed, daily record sends sendDataTask tasks in the process of implementation, and judgement currently whether there is competitive relation, if there is competitive relation, it then will be added to data buffer storage queue after task persistence, if without competitive relation, execute following steps:Setting synchronous mark isActive is true first, and then execution journal sends network request asycSend, after daily record sends network request, generates continuation daily record and sends sendNextTask tasks, and distribute synchronous task queue.The present invention, algorithm is succinct, and scheduling is clear, and influence of the competitive relation to log management is avoided by synchronous task queue, easy to maintain.

Description

A kind of method that single thread daily record sends management
Technical field
The present invention relates to single thread technical field and log management technical field, specifically a kind of single thread daily record is sent The method of management.
Background technology
In Log Administration System, conventional thinking is with a thread(That is single thread)Individually management daily record(A such as line Journey individually writes daily record, transmission daily record etc.)Although system development is easier, due to needing after the completion of a upper task It can start new task, so its efficiency is usually lower than multithreading Log Administration System.If complete synchronous task used in when Between it is longer than scheduled time, Log Administration System may be not responding to.
When single thread refers to that program executes, the Program path that is run(The thing of processing)It is that consecutive order gets off, it is necessary to Front is handled well, subsequent just to go to.
Single thread daily record sends management and refers to:Daily record sends request in the same time, can only executed there are one task, There is no concurrent tasks.In single thread daily record sends management, not yet completed if last daily record sends request, and new day Will sends request and has generated again, then will appear competitive relation, or cause log information imperfect, influence the peace of Log Administration System Entirely, reliability service.
Invention content
In view of the deficiencies in the prior art, the purpose of the present invention is to provide a kind of single thread daily records to send management Method, algorithm is succinct, and scheduling is clear, and influence of the competitive relation to log management is avoided by synchronous task queue, easy to maintain.
To achieve the above objectives, the technical solution adopted by the present invention is that:
A kind of method that single thread daily record sends management, which is characterized in that include the following steps:
It triggers daily record and sends event sendLog, generate daily record and distribute request,
Daily record distributes management module reception daily record and distributes request,
Daily record distributes management module and generates daily record transmission sendDataTask tasks, and distributes synchronous task queue,
Daily record sends sendDataTask tasks in the process of implementation, and judgement currently whether there is competitive relation,
If there is competitive relation, then daily record perdurable data data n, n=1,2,3 ... will be obtained after task persistence, it will Daily record perdurable data data n are added to data buffer storage queue,
If without competitive relation, following steps are executed:
Setting synchronous mark isActive is true first,
Then execution journal sends network request asycSend,
After daily record sends network request, generates and continue daily record transmission sendNextTask tasks, and distribute synchronous appoint Business queue.
Based on the above technical solution, the continuation daily record sends sendNextTask tasks, from data buffer storage team Daily record perdurable data data n to be sent are obtained in row,
If data buffer storage queue there are data cached,
A daily record perdurable data data n then is obtained from queue heads,
Then execution journal sends network request asycSend,
After daily record sends network request,
It generates and continues daily record transmission sendNextTask tasks, and distribute synchronous task queue.
Based on the above technical solution, the continuation daily record sends sendNextTask tasks, from data buffer storage team Daily record perdurable data data n to be sent are obtained in row,
If data buffer storage queue do not have it is data cached,
Then show there is no the needing to send of the task,
Setting synchronous mark isActive is vacation,
Terminate transmission task.
Based on the above technical solution, the decision principle of competitive relation is:
When synchronous mark isActive is true, generation daily record at this time distributes request, then it is assumed that encounters competitive relation appearance.
Based on the above technical solution, when receiving distal end callback information newwork callback, then judgement is current Daily record sends network request and terminates.
The method that single thread daily record of the present invention sends management, algorithm is succinct, and scheduling is clear, passes through synchronous task team Row avoid influence of the competitive relation to log management, easy to maintain.
Description of the drawings
The present invention has following attached drawing:
The flow chart of Fig. 1 present invention.
Specific implementation mode
Below in conjunction with attached drawing, invention is further described in detail.
As shown in Figure 1, the method that single thread daily record of the present invention sends management, includes the following steps:
It triggers daily record and sends event sendLog, generate daily record and distribute request,
Daily record distributes management module reception daily record and distributes request,
Daily record distributes management module and generates daily record transmission sendDataTask tasks, and distributes synchronous task queue,
Daily record sends sendDataTask tasks in the process of implementation, and judgement currently whether there is competitive relation,
If there is competitive relation, then daily record perdurable data data n, n=1,2,3 ... will be obtained after task persistence, it will Daily record perdurable data data n are added to data buffer storage queue,
If without competitive relation, following steps are executed:
Setting synchronous mark isActive is true first,
Then execution journal sends network request asycSend,
After daily record sends network request, generates and continue daily record transmission sendNextTask tasks, and distribute synchronous appoint Business queue.
Based on the above technical solution, the continuation daily record sends sendNextTask tasks, from data buffer storage team Daily record perdurable data data n to be sent are obtained in row,
If data buffer storage queue there are data cached,
A daily record perdurable data data n then is obtained from queue heads,
Then execution journal sends network request asycSend,
After daily record sends network request,
It generates and continues daily record transmission sendNextTask tasks, and distribute synchronous task queue.
Based on the above technical solution, the continuation daily record sends sendNextTask tasks, from data buffer storage team Daily record perdurable data data n to be sent are obtained in row,
If data buffer storage queue do not have it is data cached,
Then show there is no the needing to send of the task,
Setting synchronous mark isActive is vacation,
Terminate transmission task.
Based on the above technical solution, the decision principle of competitive relation is:
When synchronous mark isActive is true, generation daily record at this time distributes request, then it is assumed that encounters competitive relation appearance.
It is controlled by synchronous mark isActive, same time can only execute there are one task.
Based on the above technical solution, when receiving distal end callback information newwork callback, then judgement is current Daily record sends network request and terminates.
The content not being described in detail in this specification belongs to the prior art well known to professional and technical personnel in the field.

Claims (5)

1. a kind of method that single thread daily record sends management, which is characterized in that include the following steps:
It triggers daily record and sends event sendLog, generate daily record and distribute request,
Daily record distributes management module reception daily record and distributes request,
Daily record distributes management module and generates daily record transmission sendDataTask tasks, and distributes synchronous task queue,
Daily record sends sendDataTask tasks in the process of implementation, and judgement currently whether there is competitive relation,
If there is competitive relation, then daily record perdurable data data n, n=1,2,3 ... will be obtained after task persistence, it will Daily record perdurable data data n are added to data buffer storage queue,
If without competitive relation, following steps are executed:
Setting synchronous mark isActive is true first,
Then execution journal sends network request asycSend,
After daily record sends network request, generates and continue daily record transmission sendNextTask tasks, and distribute synchronous appoint Business queue.
2. the method that single thread daily record as described in claim 1 sends management, it is characterised in that:The continuation daily record is sent SendNextTask tasks obtain daily record perdurable data data n to be sent from data buffer storage queue,
If data buffer storage queue there are data cached,
A daily record perdurable data data n then is obtained from queue heads,
Then execution journal sends network request asycSend,
After daily record sends network request,
It generates and continues daily record transmission sendNextTask tasks, and distribute synchronous task queue.
3. the method that single thread daily record as described in claim 1 sends management, it is characterised in that:The continuation daily record is sent SendNextTask tasks obtain daily record perdurable data data n to be sent from data buffer storage queue,
If data buffer storage queue do not have it is data cached,
Then show there is no the needing to send of the task,
Setting synchronous mark isActive is vacation,
Terminate transmission task.
4. the method that single thread daily record as described in claim 1 sends management, it is characterised in that:The decision principle of competitive relation For:
When synchronous mark isActive is true, generation daily record at this time distributes request, then it is assumed that encounters competitive relation appearance.
5. the method that single thread daily record as described in claim 1 sends management, it is characterised in that:When receiving distal end callback information Newwork callback then judge that current log sends network request and terminates.
CN201810336345.2A 2018-04-16 2018-04-16 A kind of method that single thread daily record sends management Pending CN108647100A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810336345.2A CN108647100A (en) 2018-04-16 2018-04-16 A kind of method that single thread daily record sends management

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810336345.2A CN108647100A (en) 2018-04-16 2018-04-16 A kind of method that single thread daily record sends management

Publications (1)

Publication Number Publication Date
CN108647100A true CN108647100A (en) 2018-10-12

Family

ID=63746243

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810336345.2A Pending CN108647100A (en) 2018-04-16 2018-04-16 A kind of method that single thread daily record sends management

Country Status (1)

Country Link
CN (1) CN108647100A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1642104A (en) * 2004-01-05 2005-07-20 华为技术有限公司 Method and device for realizing system journal
CN101504621A (en) * 2009-04-01 2009-08-12 杭州华三通信技术有限公司 Distributed system and equipment for preventing global resource out-of-order, and its application method
CN103608775A (en) * 2011-06-29 2014-02-26 华为技术有限公司 Method and device for processing data by utilizing threads
CN106293523A (en) * 2016-08-04 2017-01-04 浪潮(北京)电子信息产业有限公司 A kind of I/O Request response method to non-volatile memories and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1642104A (en) * 2004-01-05 2005-07-20 华为技术有限公司 Method and device for realizing system journal
CN101504621A (en) * 2009-04-01 2009-08-12 杭州华三通信技术有限公司 Distributed system and equipment for preventing global resource out-of-order, and its application method
CN103608775A (en) * 2011-06-29 2014-02-26 华为技术有限公司 Method and device for processing data by utilizing threads
CN106293523A (en) * 2016-08-04 2017-01-04 浪潮(北京)电子信息产业有限公司 A kind of I/O Request response method to non-volatile memories and device

Similar Documents

Publication Publication Date Title
US9798830B2 (en) Stream data multiprocessing method
CN106844198B (en) Distributed dispatching automation test platform and method
CN103955491B (en) Method for synchronizing timing data increment
US8473951B2 (en) Method and system for traversing in reverse chronological order along a critical path of a plurality of jobs, and reducing time gaps between jobs until an estimated end time of the last job is less than or equal to a target end time
CN111625331B (en) Task scheduling method, device, platform, server and storage medium
CN109656782A (en) Visual scheduling monitoring method, device and server
CN101464811A (en) Multitask monitoring management system
WO2017167021A1 (en) Abnormality monitoring method and device
CN108664340A (en) A kind of method that multithreading daily record sends management
US20200379803A1 (en) Resource availability-based workflow execution timing determination
CN115840631B (en) RAFT-based high-availability distributed task scheduling method and equipment
CN106326068A (en) Resource index monitoring method and device
CN110611707A (en) Task scheduling method and device
CN106325984A (en) Big data task scheduling apparatus
CN107943657A (en) A kind of linux system problem automatic analysis method and system
CN104933495A (en) Work task assessment system on Android-based mobile terminal
CN115150471A (en) Data processing method, device, equipment, storage medium and program product
CN108762952A (en) A kind of distribution asynchronous data push scheme
CN102893261A (en) Idle transitions sampling
CN113821322A (en) Loosely-coupled distributed workflow coordination system and method
CN109684130A (en) The method and device of data backup between a kind of computer room
CN108647100A (en) A kind of method that single thread daily record sends management
CN103401722A (en) System and method for monitoring software resources
CN112948096A (en) Batch scheduling method, device and equipment
CN116302423A (en) Distributed task scheduling method and system for cloud management platform

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20181012