Movatterモバイル変換


[0]ホーム

URL:


CN103677844B - Lightweight class data processing method based on message chain - Google Patents

Lightweight class data processing method based on message chain
Download PDF

Info

Publication number
CN103677844B
CN103677844BCN201310714072.8ACN201310714072ACN103677844BCN 103677844 BCN103677844 BCN 103677844BCN 201310714072 ACN201310714072 ACN 201310714072ACN 103677844 BCN103677844 BCN 103677844B
Authority
CN
China
Prior art keywords
message
chain
observer
queue
messages
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
CN201310714072.8A
Other languages
Chinese (zh)
Other versions
CN103677844A (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.)
Hunan Zhongke Guoyun big data industry development Co.,Ltd.
Original Assignee
G Cloud 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 G Cloud Technology Co LtdfiledCriticalG Cloud Technology Co Ltd
Priority to CN201310714072.8ApriorityCriticalpatent/CN103677844B/en
Publication of CN103677844ApublicationCriticalpatent/CN103677844A/en
Application grantedgrantedCritical
Publication of CN103677844BpublicationCriticalpatent/CN103677844B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Landscapes

Abstract

The invention relates to the technical field of distributed computation, in particular to a lightweight class data processing frame based on a message chain. Messages are cached into an uplink message queue after being received, entering a message processing chain module and then being processed by uplink processing logic on all processors on the chain; a manager thread of the uplink message queue fetches the messages and puts the messages into a massage thread pool; the message thread pool analyzes the messages into objects or structural bodies; a message observer determines whether to receive the messages or not according to types and conducts special service logic processing on the messages; user requests or responses are converted into messages through a message analysis module, and then the messages are cached into a downlink message queue; the message queue stores the downlink messages into a queue to be sent; the messages dequeue in sequence, enter the message processing chain and are sent to a message channel after being processed by downlink processing logic of all the processors on the chain. The lightweight class data processing frame solves the problem of message-oriented middleware, and can be used for rapid integrated development of third party software and hardware based on the data processing frame.

Description

A kind of lightweight data processing method based on chain of messages
Technical field
The present invention relates to distributed computing technology field, particularly relate to a kind of lightweight data processing side based on chain of messagesMethod.
Background technology
One distributed system needs to process different types of message, and the process logic of message was both had something in common, and also couldNeed special process logic according to the difference of type of message.We typically to process the general character of message using message-oriented middlewareProblem, its process step is such that
1st, typically there are three roles in message-oriented middleware: message-oriented middleware, consumer, ISP;
2nd, consumer's assembling request of data message is sent to message;
3rd, customer requests' message is transmitted to each ISP and monitors queue by message-oriented middleware, and ISP receivesRequested service message;
4th, the asynchronous response message returning request message of ISP;
5th, the response message of customer requests' message is returned to the response queue of corresponding consumer, consumer by message-oriented middlewareReceive the response message of request, and do respective handling;
6th, the data needed for ISP generates consumer, and send message to message-oriented middleware;
7th, notice message is transmitted to each consumer and monitors queue by message-oriented middleware, and consumer receives notice business reportLiterary composition;
8th, the asynchronous response message returning notice message of consumer.
But, message-oriented middleware there is also problem below in the little distributed environment of size of message:
1st, message-oriented middleware is an independent message engine, can take part of server resource, for size of message notIt is not necessary that increasing such expense for big Distributed Application, and introduce the role of the third party, message (message) is passingTemporary through an excessive layer queue during defeated, the real-time of message can be lowered.
2nd, message-oriented middleware does not have the treatment mechanism of flexible design to message processing logic, once message processing logic becomesChange, need to recompile realization.
3rd, message-oriented middleware does not design the special handling logic mechanism to message, to the exploitation of particular service logic notProfit.
Content of the invention
Present invention solves the technical problem that being to provide a kind of lightweight data processing method based on chain of messages, solve meshThe problem that the Message Processing that front universal information middleware exists is dumb, development efficiency is low, message real-time is low;
The technical scheme that the present invention solves above-mentioned technical problem is:
Including step:
Upstream message enters source processing chain module after being received from message channel;
After message sequentially passes through the process of the up process logic of each processor on chain, it is cached in upstream message queue;
Upstream message queue management thread takes out message from message queue and puts into message threads pond;
Message is parsed into object or structure by message threads pond;
Message observer decides whether received message according to the type of message object or structure, and carries out special industry to itBusiness logical process;
Process response or user's request changes into message through message resolution module and is cached in downstream message queue;
Message queue is saved in downstream message in queue to be sent;
In queue to be sent, message is fallen out inbound message process chain in order, sequentially passes through the descending place of each processor on chainSend to message channel after reason logical process;
Described message is divided into upstream message and downstream message;Upstream message refers to that system receives from message channel and needsCarry out the request of the corresponding command operation, downstream message then refer to command operation processed after response or user need sendThe request gone out;
Described source processing chain is the chain type set of Message Processing instrument, at upstream message process chain and downstream messageReason chain;The Message Processing instrument that upstream message process chain includes has message unpacking, message decompression, message deciphering and message authentication;The Message Processing instrument that downstream message process chain includes then has message authentication, message encryption, message compression and message to beat accordinglyBag;
Described message threads pond refers to the set of each Message Processing thread, have by message be parsed into each object orThe function of person's structure;
Described message observer refers to carry out the interface of various different disposal for the message object parsingObject, including daily record observer, audit observation person, virtual machine observer, logical volume observer;Message observer adopts observerModel Design is realized, and same message is supported successively by multiple observer's reception processings;Observer Pattern is one in Programming DesignPlant programming realization method.
The tool set of described described upstream message process chain and downstream message process chain supports dynamic scalable.
Described up-downgoing message queue supports internal memory form database form;
Described internal memory form message queue refers to apply for that in internal memory a certain size space, as message format, hasThe characteristic of efficiency high;
Described database form refers to first be saved in message data base, waits for the arrival of news and processes the scheduling of thread, hasPersistence characteristic, supports that service fault recovers the feature that message is processed again.
Described message observer's particular service logical process refers to carry out log recording similar to daily record observer, auditObserver is audited, and virtual machine observer carries out creating virtual machine, the logical process of closing virtual machine business.
The present invention program has the beneficial effect that:
1st, the framework of the present invention is lightweight, less to the expense of the extra increase of system, and the real-time of message is high.
2nd, the framework of the present invention is high flexible, and the process logic in source processing chain can be passed through to configure to carry out on demandIncrease and decrease, need not recompile and can run;Increase the special handling logic to message to be relatively easy to.
3rd, the method for the present invention can develop distributed treatment application at short notice, and the processor in source processing chain is allIt is the general purpose module processing logic development according to general character, only needing to be configured or done a small amount of coding in actual use isCan.
4th, the quality of distributed application development can be improved, increase CSAT.Due to applying this framework can accomplish not compileWrite code or only write very small amount code, therefore decrease the mistake encoding generation in development process, improve software quality.
Brief description
The present invention is further described below in conjunction with the accompanying drawings:
Fig. 1 is flow chart of the present invention;
Fig. 2 processes framework exploded view for upstream data of the present invention;
Specific embodiment
As shown in figure 1, the present invention is comprised the steps: based on the lightweight data processing method of chain of messages
Upstream message enters source processing chain module after being received from message channel;
After message sequentially passes through the process of the up process logic of each processor on chain, it is cached in upstream message queue;
Upstream message queue management thread takes out message from message queue and puts into message threads pond;
Message is parsed into object or structure by message threads pond;
Message observer decides whether received message according to the type of message object or structure, and carries out special industry to itBusiness logical process;
Process accordingly or user's request changes into message through message resolution module and is cached in downstream message queue;
Message queue is saved in downstream message in queue to be sent;
In queue to be sent, message is fallen out inbound message process chain in order, sequentially passes through the descending place of each processor on chainSend to message channel after reason logical process.
Described message is divided into upstream message and downstream message;Upstream message refers to that system receives from message channel and needsCarry out the request of the corresponding command operation, downstream message then refer to command operation processed after response or user need sendThe request gone out.
Source processing chain is the chain type set of Message Processing instrument, processes including upstream message process chain and downstream messageChain;The Message Processing instrument that upstream message process chain includes has message unpacking, message decompression, message deciphering and message authentication etc.;The Message Processing instrument that downstream message process chain includes then has message authentication, message encryption, message compression and message to beat accordinglyBag etc.;
Message threads pond refers to the set of each Message Processing thread, has and for message to be parsed into each object or structureThe function of body;
Message observer refers to carry out the interface object of various different disposal, bag for the message object parsingInclude daily record observer, audit observation person, virtual machine observer, logical volume observer etc.;Message observer adopts Observer PatternDesign is realized, and same message is supported successively by multiple observer's reception processings;, Observer Pattern is a kind of in Programming Design volumeJourney implementation method.
Up-downgoing source processing chain tool set supports dynamic scalable.
Up-downgoing message queue supports internal memory form database form;Internal memory form message queue refers to Shen in internal memoryPlease a certain size space as message format, there is the characteristic of efficiency high;Database form refers to first be saved in message numberAccording to storehouse, wait for the arrival of news and process the scheduling of thread, there is persistence characteristic, support that service fault recovers the spy that message is processed againPoint.
Message observer's particular service logical process refers to carry out log recording, audit observation person similar to daily record observerAudited, virtual machine observer carries out creating virtual machine, closes the business logic processing such as virtual machine.
In conjunction with shown in Fig. 2, in data processing shelf, source processing chain is in the stage of text message turnover, comprises to solveThe processing procedures such as bag, decompression, deciphering, certification, each processing procedure is a handler, and each handler needs to inheritMsghandler base class, the design of msghandler base class is as follows:
Each message processing procedure on demand dynamic scalable be assembled into upstream message process chain incomemsgchainWith downstream message process chain outcomemsgchain.Assembling process is exactly to process handler for each to call unified interfaceSetsuccessor, being allowed in succession link together becomes a source processing chain, and link assembling process is as follows:
Upstream message process chain construction process is as follows:
Downstream message process chain construction process is as follows:
Downstream message process chain has carried out encryption, pressurization, compressed logic process successively to message.
The same with source processing chain, message queue is also designed to upstream message queue and downstream message queue, message teamRow management Similar integral imqmng interface, Interface design is as follows:
The team that goes out of queue has two lines thread management respectively.Incomemqpollthread and outcomemqpollthread.Their two work are exactly constantly to take out message from queue, then put thread pool execution into.Thread pool is accomplished by
Message observer receives specific message object and structure, carries out specific business logic processing.Realization sideIn case, message observer inherits commandobserver abstract class, and its code is as follows:
All message observers are managed collectively by message observer management class, and implementation method employs ObserverFormula, code is as follows:

Claims (5)

CN201310714072.8A2013-12-202013-12-20Lightweight class data processing method based on message chainActiveCN103677844B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201310714072.8ACN103677844B (en)2013-12-202013-12-20Lightweight class data processing method based on message chain

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201310714072.8ACN103677844B (en)2013-12-202013-12-20Lightweight class data processing method based on message chain

Publications (2)

Publication NumberPublication Date
CN103677844A CN103677844A (en)2014-03-26
CN103677844Btrue CN103677844B (en)2017-02-01

Family

ID=50315511

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201310714072.8AActiveCN103677844B (en)2013-12-202013-12-20Lightweight class data processing method based on message chain

Country Status (1)

CountryLink
CN (1)CN103677844B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106648444B (en)*2015-10-302019-06-28大唐移动通信设备有限公司A kind of message treatment method and equipment
CN106648816B (en)*2016-12-092020-03-17武汉斗鱼网络科技有限公司Multithreading system and method
CN107545489A (en)*2017-08-182018-01-05秒啊(北京)科技有限公司A kind of time method of commerce
CN111555955B (en)*2020-03-262022-08-05福州慧校通教育信息技术有限公司Method, device, equipment and medium for implementing message center
CN114490112B (en)*2021-12-202024-09-20阿里巴巴(中国)有限公司Message processing method, device and system
CN114615213B (en)*2022-01-262024-04-12福达新创通讯科技(厦门)有限公司Method and system for implementing multi-network link interface based on message queue
CN118072425B (en)*2024-04-172024-06-21苏州琨山通用锁具有限公司Redis-based intelligent lockset high-reliability communication method and system

Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101742728A (en)*2010-01-122010-06-16深圳市五巨科技有限公司Method for realizing dynamic task of mobile phone platform
CN102523177A (en)*2011-12-192012-06-27北京新媒传信科技有限公司Method and system for realization of message push service
US8359574B1 (en)*2009-01-162013-01-22Adobe Systems IncorporatedOffline mode in IDE for seamless service-oriented-architecture-based application development
CN103024014A (en)*2012-12-032013-04-03北京京东世纪贸易有限公司Method and system for distributing and processing mass data passing through message queues
CN103188140A (en)*2011-12-312013-07-03国民技术股份有限公司Service request processing system
CN103370917A (en)*2012-11-202013-10-23华为技术有限公司Message processing method and server

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US8359574B1 (en)*2009-01-162013-01-22Adobe Systems IncorporatedOffline mode in IDE for seamless service-oriented-architecture-based application development
CN101742728A (en)*2010-01-122010-06-16深圳市五巨科技有限公司Method for realizing dynamic task of mobile phone platform
CN102523177A (en)*2011-12-192012-06-27北京新媒传信科技有限公司Method and system for realization of message push service
CN103188140A (en)*2011-12-312013-07-03国民技术股份有限公司Service request processing system
CN103370917A (en)*2012-11-202013-10-23华为技术有限公司Message processing method and server
CN103024014A (en)*2012-12-032013-04-03北京京东世纪贸易有限公司Method and system for distributing and processing mass data passing through message queues

Also Published As

Publication numberPublication date
CN103677844A (en)2014-03-26

Similar Documents

PublicationPublication DateTitle
CN103677844B (en)Lightweight class data processing method based on message chain
JP6523354B2 (en) State machine builder with improved interface and handling of state independent events
US9146830B2 (en)Hybrid local/remote infrastructure for data processing with lightweight setup, powerful debuggability, controllability, integration, and productivity features
WO2020108303A1 (en)Heterogeneous computing-based task processing method and software-hardware framework system
CN104050261B (en)The general data processing system and method for variable logic based on Storm
US20170083396A1 (en)Recovery strategy for a stream processing system
CN104021452A (en)Method for integrating various service systems at cloud computing server side
CN109726004B (en)Data processing method and device
US20150379022A1 (en)Integrating Execution of Computing Analytics within a Mapreduce Processing Environment
US20220043731A1 (en)Performance analysis
CN112418427A (en)Method, device, system and equipment for providing deep learning unified reasoning service
CN102737016B (en)A system and a method for generating information files based on parallel processing
CN103324479A (en)Distributed big-data computation middleware system framework in loose environment
CN115268851A (en)Service processing method and device, electronic equipment and storage medium
DE102023122035A1 (en) APPLICATION PROGRAMMING INTERFACE FOR MONITORING SOFTWARE WORKLOADS
CN102137162B (en)CAD (Computer Aided Design) integrated system based on mode of software used as service
CN103152433A (en)Distributed server side framework and use, interaction and request processing method thereof
CN112597171B (en)Table relation visualization method and device, electronic equipment and storage medium
CN114579405A (en)Data processing method, data processing apparatus, electronic device, and storage medium
CN105302818A (en)Query processing method and apparatus
CN105260179A (en)Method for achieving flex and servlet interaction
Wang et al.Transformer: A new paradigm for building data-parallel programming models
CN117177298A (en)Method and system for realizing 5G service data load balance based on assembly line
CN111881025B (en)Automatic test task scheduling method, device and system
CN115460265A (en)Interface calling method, device, equipment and medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
C14Grant of patent or utility model
GR01Patent grant
CP02Change in the address of a patent holder

Address after:523808 19th Floor, Cloud Computing Center, Chinese Academy of Sciences, No. 1 Kehui Road, Songshan Lake Hi-tech Industrial Development Zone, Dongguan City, Guangdong Province

Patentee after:G-Cloud Technology Co., Ltd.

Address before:523808 No. 14 Building, Songke Garden, Songshan Lake Science and Technology Industrial Park, Dongguan City, Guangdong Province

Patentee before:G-Cloud Technology Co., Ltd.

CP02Change in the address of a patent holder
TR01Transfer of patent right

Effective date of registration:20201209

Address after:Room 203, 2 / F, building 6, modern service industry headquarters park, 1769 Yunfeng Avenue, Yunlong demonstration zone, Zhuzhou City, Hunan Province

Patentee after:Hunan Zhongke Guoyun big data industry development Co.,Ltd.

Address before:523808 19th floor, Cloud Computing Center, Chinese Academy of Sciences, No.1 Kehui Road, Songshanhu high tech Industrial Development Zone, Dongguan City, Guangdong Province

Patentee before:G-CLOUD TECHNOLOGY Co.,Ltd.

TR01Transfer of patent right

[8]ページ先頭

©2009-2025 Movatter.jp