Movatterモバイル変換


[0]ホーム

URL:


CN103218254B - A kind of AFC (Automatic Fare Collection) data processing method of many queues - Google Patents

A kind of AFC (Automatic Fare Collection) data processing method of many queues
Download PDF

Info

Publication number
CN103218254B
CN103218254BCN201310128727.3ACN201310128727ACN103218254BCN 103218254 BCN103218254 BCN 103218254BCN 201310128727 ACN201310128727 ACN 201310128727ACN 103218254 BCN103218254 BCN 103218254B
Authority
CN
China
Prior art keywords
data
thread
queue
afc
business processing
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
CN201310128727.3A
Other languages
Chinese (zh)
Other versions
CN103218254A (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.)
Guangzhou Huajia Software Co.,Ltd.
Original Assignee
GUANGZHOU PCI 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 GUANGZHOU PCI TECHNOLOGY Co LtdfiledCriticalGUANGZHOU PCI TECHNOLOGY Co Ltd
Priority to CN201310128727.3ApriorityCriticalpatent/CN103218254B/en
Publication of CN103218254ApublicationCriticalpatent/CN103218254A/en
Application grantedgrantedCritical
Publication of CN103218254BpublicationCriticalpatent/CN103218254B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Landscapes

Abstract

The invention discloses a kind of AFC (Automatic Fare Collection) data processing method of many queues, first, one-level queue and dispatch thread pond is set up in computer equipment data handling procedure, and secondary queue and the business processing thread pool corresponding with secondary queue, utilize the real time data bag of one-level queue receiving front-end station equipment, secondary queue is put into after judging type by dispatch thread Chi Xiexishuojubao, the packet that business processing thread pool obtains preset kind from the secondary queue of correspondence carries out business processing, completes data handling procedure.Its mode can make full use of computer hardware resource, and promote AFC (Automatic Fare Collection) data-handling efficiency, dirigibility is good, retractility is strong, is particularly suitable for using at various AFC (Automatic Fare Collection) platform.

Description

A kind of AFC (Automatic Fare Collection) data processing method of many queues
Technical field
The present invention relates to a kind of data processing method of Services in Distributed System device, particularly relate to the many queues AFC (Automatic Fare Collection) data processing method in a kind of AFC system.
Background technology
In the AFC system of subway station, equipment and station computer form a closed distributed system, all devices is sent to station computer the AFC (Automatic Fare Collection) data produced at any time by network and processes in real time, and feed back to station operating personnel in time, complete information sharing and monitoring.The efficiency of AFC system data processing is normal to station, high-efficiency operation is most important.
Along with subway business development, traditional AFC (Automatic Fare Collection) data processing method cannot meet flexible, a large amount of data handling requirements.Its reason is: first, and in subway line, the scale of each website is inconsistent, causes the data volume of the station computer process of each website not identical; Secondly, along with updating of subway business, traffic data type constantly changes, and the data volume that equipment produces is also in continuous growth.As by increasing the change of number of computers reply data volume, so hardware input cost and the software development and design cost for multiple stage computing machine all higher, and computer hardware performance upgrades and promotes very fast, makes later stage HardwareUpgring cost higher.Therefore under former mentality of designing, traditional automatic ticketing data processing method cannot give full play to and use active computer hardware resource, brings adverse effect to the effective use of hardware resource and ticket sale system, and causes the larger wasting of resources.
How to make that existing AFC system is formed efficiently, low cost, easily flexible running status, improve data handling procedure, just become the problem that the present invention wants to solve.
Summary of the invention
In view of above-mentioned the deficiencies in the prior art, the present invention aims to provide a kind of AFC (Automatic Fare Collection) data processing method of many queues, for computer equipment provides the low cost expansion scheme of software view, on the basis of guaranteeing data-handling efficiency, the phenomenon realizing reply AFC system data volume and constantly change is calculated, to meet operation, the regulatory requirement at AFC (Automatic Fare Collection) station by configuration.
The present invention is achieved by the following technical solutions:
An AFC (Automatic Fare Collection) data processing method for many queues, it is characterized in that, concrete steps comprise:
Step one, first to set up in computer equipment data handling procedure: one-level queue and dispatch thread pond, and secondary queue and the business processing thread pool corresponding with secondary queue.
Step 2, utilize the real time data bag of described one-level queue receiving front-end station equipment, simultaneously, one-level queue also provides blocking mechanism to use the CPU of computer equipment, detailed process is: as described in there is no data in one-level queue, thread in described dispatch thread pond can block when obtaining data, until just continue after obtaining data to perform; As described in after data packet number reaches the upper limit in one-level queue, no longer will receive packet.
Step 3, obtain data by described dispatch thread pond from described one-level queue, resolution data bag also puts into described secondary queue after judging type.
Step 4, described secondary queue receive the packet meeting preset kind from described dispatch thread pond, simultaneously, secondary queue also provides blocking mechanism to use the CPU of computer equipment, detailed process is: as described in there is no data in secondary queue, thread in corresponding business processing thread pool can block when obtaining data, until just continue after obtaining data to perform; As described in after data packet number reaches the upper limit in secondary queue, dispatch thread pond can obstruction be sent stored in during data, until etc. just continue to perform after success to be deposited.
The packet that step 5, described business processing thread pool obtain from the described secondary queue of correspondence carries out business processing, completes data handling procedure.
If packet requires to return, then the packet that the data assembling completed business processing returns, and is sent back to by network service.
The quantity in described one-level queue and dispatch thread pond is respectively one, and the thread in dispatch thread pond performs with concurrent or parallel mode.
The quantity of described secondary queue is one or more; The quantity of described business processing thread pool and one_to_one corresponding identical with described secondary queue quantity, corresponding business processing thread pool is only responsible for the data in secondary queue corresponding to process one; The thread of described business processing thread pool performs with concurrent or parallel mode.
The capacity of described one-level queue and the capacity of secondary queue calculate from corresponding computer equipment memory size and anticipatory data bag treatment capacity respectively, and formula is as follows:
Wherein, N is the number of secondary queue, DT1... DTnfor the data number of each queue expection process per second, PM expects the size of every bar data, and TM is computer equipment memory size, and FQ is one-level queue assignment size, SQiit is the allocated size of i-th secondary queue.
Described dispatch thread pond thread quantity and described business processing thread pool thread quantity calculate from the CPU quantity of computer equipment and anticipatory data bag treatment effeciency respectively, and formula is as follows:
Wherein N is the number of secondary queue, DT1... DTnfor the data number of each queue expection process per second, UT is CPU sum in computer equipment, and FT is the number of threads that dispatch thread pond is distributed, STibe i-th secondary queue business processing thread pool thread quantity allotted.
Thread in thread in described dispatch thread pond and described business processing thread pool, as in the computer equipment of single cpu, thread performs with concurrent fashion; As in the computer equipment of multiple CPU, thread performs with parallel or concurrent fashion.
Described computer equipment comprises personal computer, server or other network equipment.
As can be seen from the above scheme, the capacity of one-level queue and secondary queue in the present invention, and dispatch thread pond and business processing thread pool can change flexibly for data volume and hardware configuration.When data volume changes, without the need to Adjustable calculation machine quantity or amendment Software for Design, self rapid adjustment can be made, meet the needs of communication transfer, not only save hardware and software cost, also solve AFC (Automatic Fare Collection) data volume and change the difficult problem brought, concrete beneficial effect comprises:
(1) be convenient to dispose, be easy to realize, effectively reduce costs
The present invention adopts the mode of software merit rating to meet the processing requirements of elastic traffic amount, dropping into or change Software for Design, reducing the cost when increase of reply portfolio or business change without the need to increasing hardware.
(2) applied range
The service end data processing of distributed system under LAN (Local Area Network) state can be widely used in.
(3) data-handling efficiency is high
Adopt the concurrent or parallel mode of multiple thread to carry out AFC (Automatic Fare Collection) Data dissemination and process, speed is fast, and data-handling efficiency can meet business need completely.
Accompanying drawing explanation
Fig. 1 is the AFC (Automatic Fare Collection) data processing method structural representation of a kind of many queues of the present invention;
Fig. 2 is the Data dissemination schematic flow sheet of the AFC (Automatic Fare Collection) data processing method of a kind of many queues of the present invention;
Fig. 3 is the flow chart of data processing schematic diagram of the AFC (Automatic Fare Collection) data processing method of a kind of many queues of the present invention.
Embodiment
Below in conjunction with the drawings and specific embodiments, the present invention is described in further detail:
The AFC (Automatic Fare Collection) data processing method of a kind of many queues of the present invention, concrete steps comprise:
Step S100, in the data handling procedure of computer equipment, first set up one-level queue and dispatch thread pond, and secondary queue and the business processing thread pool corresponding with secondary queue.
Computer equipment can be personal computer, server or other network equipment, in present embodiment, as shown in Figure 1, the quantity in one-level queue 1 and dispatch thread pond 2 is respectively one, the quantity of secondary queue 3 is two, the quantity of business processing thread pool 4 is identical with secondary queue 3 quantity and form annexation one to one, that is, the data in the secondary queue 3 that the responsible process of corresponding business processing thread pool 4 is corresponding.In the computer equipment of single cpu, the thread in dispatch thread pond 2 and the thread of business processing thread pool 4 perform with concurrent fashion respectively; And in the computer equipment of multiple CPU, the thread in dispatch thread pond 2 and the thread of business processing thread pool 4 then perform with parallel or concurrent fashion.
Then, as shown in Figure 2, one-level queue AFC (Automatic Fare Collection) Data dissemination flow process is as follows:
Step S101, utilize one-level queue to receive the real time data bag of station equipment, namely receive AFC (Automatic Fare Collection) data by network service thread, attempt stored in one-level queue.
Step S102, judge in one-level queue, whether AFC (Automatic Fare Collection) quantity reaches the upper limit, if then perform S101, continue to attempt stored in one-level queue; Otherwise perform S103.
Step S103, AFC (Automatic Fare Collection) data are stored in one-level queue.
Whether there are the pending datas such as thread block in step S104, dispatch thread pond, if having, perform S107, otherwise perform S105.
Step S105, dispatch thread pond thread are attempted obtaining AFC (Automatic Fare Collection) data from one-level queue.
Step S106, judge that whether one-level queue is empty, if then perform S107, otherwise perform S108.
Attempt the thread block obtaining AFC (Automatic Fare Collection) data in step S107, dispatch thread pond, wait in one-level queue and have data to perform stored in rear continuation.
Step S108, dispatch thread pond thread gets AFC (Automatic Fare Collection) data, and resolution data bag puts into corresponding secondary queue according to type.
Again then, as shown in Figure 3, described secondary AFC (Automatic Fare Collection) flow chart of data processing is as follows:
Step S201, above-mentioned dispatch thread pond thread are attempted to secondary queue stored in AFC (Automatic Fare Collection) data.
Step S202, judge whether have the pending datas such as thread block in processing threads pond, if having, perform S208, wait for secondary queue data stored in; Otherwise perform S203.
In step S203, secondary queue, whether AFC (Automatic Fare Collection) data reach the upper limit, if then perform S204, otherwise perform S205.
Attempt the thread block stored in AFC (Automatic Fare Collection) data in step S204, dispatch thread pond, wait for and continue to perform after having living space in secondary queue.
Step S205, AFC (Automatic Fare Collection) data are stored in secondary queue.
Step S206, business processing thread pool thread are attempted obtaining AFC (Automatic Fare Collection) data from secondary queue.
Whether step S207, secondary queue are empty, if then perform S208, otherwise perform S209.
Attempt the thread block obtaining AFC (Automatic Fare Collection) data in step S208, business processing thread pool, wait in secondary queue and continue to perform after having data.
Step S209, business processing thread pool thread are got AFC (Automatic Fare Collection) data and are processed.
Whether have obstruction thread in step S210, dispatch thread pond, if having, perform S204, otherwise this process terminates.
In said process, the capacity of one-level queue and the capacity of secondary queue calculate from corresponding computer equipment memory size and anticipatory data bag treatment capacity respectively, and formula is as follows:
Wherein, N is the number of secondary queue, DT1... DTnfor the data number of each queue expection process per second, PM expects the size of every bar data, and TM is computer equipment memory size, and FQ is one-level queue assignment size, SQiit is the allocated size of i-th secondary queue.
And dispatch thread pond thread quantity and business processing thread pool thread quantity calculate from the CPU quantity of computer equipment and anticipatory data bag treatment effeciency respectively, formula is as follows:
Wherein N is the number of secondary queue, DT1... DTnfor the data number of each queue expection process per second, UT is CPU sum in computer equipment, and FT is the number of threads that dispatch thread pond is distributed, STibe i-th secondary queue business processing thread pool thread quantity allotted.
Certainly, after information processing completes, if packet requires to return, then the packet that the data assembling completed business processing returns, and sent back to by network service.
By the description of above implementation process, those skilled in the art can be well understood to the realization of the present invention at software view.Based on such understanding, technical scheme of the present invention embodies with the form of software product in essence or to the contribution of prior art, this computer software product is stored in a storage medium, comprises all or part of step of some instructions in order to make a computer equipment perform method described in each embodiment of the present invention.And aforesaid storage medium comprises: ROM (read-only memory) (ROM), random access memory (RAM), magnetic disc or CD etc. various can be program code stored medium.
Obviously, said process is only a specific embodiment of the present invention, instead of whole embodiments.Based on the content that the present invention describes, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.

Claims (5)

CN201310128727.3A2013-04-152013-04-15A kind of AFC (Automatic Fare Collection) data processing method of many queuesActiveCN103218254B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201310128727.3ACN103218254B (en)2013-04-152013-04-15A kind of AFC (Automatic Fare Collection) data processing method of many queues

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201310128727.3ACN103218254B (en)2013-04-152013-04-15A kind of AFC (Automatic Fare Collection) data processing method of many queues

Publications (2)

Publication NumberPublication Date
CN103218254A CN103218254A (en)2013-07-24
CN103218254Btrue CN103218254B (en)2016-04-27

Family

ID=48816078

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201310128727.3AActiveCN103218254B (en)2013-04-152013-04-15A kind of AFC (Automatic Fare Collection) data processing method of many queues

Country Status (1)

CountryLink
CN (1)CN103218254B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106681832A (en)*2016-12-232017-05-17昆明联诚科技股份有限公司Video stream distributing method
CN107688907B (en)*2017-09-052022-01-18江苏电力信息技术有限公司Material sampling inspection method based on queue layering processing mechanism
CN107908471B (en)*2017-09-262021-06-08聚好看科技股份有限公司Task parallel processing method and processing system
CN109783255B (en)*2019-01-072021-02-23中国银行股份有限公司Data analysis and distribution device and high-concurrency data processing method
CN113630408B (en)*2021-08-032023-06-16Oppo广东移动通信有限公司Data processing method, device, storage medium and server
CN116302437A (en)*2023-03-282023-06-23重庆长安汽车股份有限公司Data analysis method, device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP2004272543A (en)*2003-03-072004-09-30Nippon Signal Co Ltd:TheTicket checking and collecting system
CN101236630A (en)*2007-01-312008-08-06北京宏德信智源信息技术有限公司Railway automatic ticket-selling system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US7061383B2 (en)*2001-11-152006-06-13United Air Lines, Inc.Radio frequency check-in

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP2004272543A (en)*2003-03-072004-09-30Nippon Signal Co Ltd:TheTicket checking and collecting system
CN101236630A (en)*2007-01-312008-08-06北京宏德信智源信息技术有限公司Railway automatic ticket-selling system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
自动售检票系统大数据量的分类队列传输处理;赵时旻等;《城市轨道交通研究》;20070228(第2期);第20-23、27页*

Also Published As

Publication numberPublication date
CN103218254A (en)2013-07-24

Similar Documents

PublicationPublication DateTitle
CN103218254B (en)A kind of AFC (Automatic Fare Collection) data processing method of many queues
Li et al.An energy-aware edge server placement algorithm in mobile edge computing
CN103150259B (en)A kind of method for recovering internal storage and device
CN107341041B (en) Multidimensional constraint backfill scheduling method for cloud tasks based on priority queue
CN106569727A (en)Shared parallel data reading-writing apparatus of multi memories among multi controllers, and reading-writing method of the same
CN102156665A (en)Differential serving method for virtual system competition resources
CN108234603A (en)A kind of edge calculations resource allocation methods and system based on price
CN106125888B (en)The efficient power-economizing method of the utilization of resources in cloud data center based on virtual machine (vm) migration
CN106502875A (en)A kind of daily record generation method and system based on cloud computing
CN107256180A (en)Data processing method, device and terminal
CN108696594A (en)A kind of the big data traffic load equalization methods and device of market surpervision block chain
CN102929724A (en)Multistage memory access method and discrete memory access method based on heterogeneous multi-core processor
CN108304256A (en) A low-overhead task scheduling method and device in edge computing
CN104363282A (en)Cloud computing resource scheduling method and device
CN106933673B (en)Method and device for adjusting number of logical threads of component
CN104572498A (en)Cache management method for message and device
CN107729137A (en)Server, the method and storage medium of the decryption of block chain sign test
CN117707797A (en) Task scheduling method, device and related equipment based on distributed cloud platform
CN106936867A (en)The response method and device of a kind of service request
CN105426163A (en)Single data stream quantile processing method based on MIC coprocessor
CN110308991B (en) A method and system for energy-saving optimization of data center based on random tasks
CN206489563U (en)Heterogeneous computing system
CN104679575A (en) Input and output flow control system and method
CN112073327A (en)Anti-congestion software distribution method, device and storage medium
CN108388498B (en) Power Modeling Method and Power Management Method for In-Memory Computing

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
C14Grant of patent or utility model
GR01Patent grant
TR01Transfer of patent right
TR01Transfer of patent right

Effective date of registration:20210825

Address after:511455 room 1009, No. 3, Chenghui street, Nansha District, Guangzhou City, Guangdong Province

Patentee after:Guangzhou Huajia Software Co.,Ltd.

Address before:510000 floor 6, No. 4, Jiangong Road, Tianhe District, Guangzhou City, Guangdong Province

Patentee before:GUANGZHOU XINKE JIADU TECHNOLOGY Co.,Ltd.


[8]ページ先頭

©2009-2025 Movatter.jp