[go: up one dir, main page]

CN104765638B - Concurrent modules, business systems, pre-assembly methods, and creation methods - Google Patents

Concurrent modules, business systems, pre-assembly methods, and creation methods Download PDF

Info

Publication number
CN104765638B
CN104765638B CN201410008811.6A CN201410008811A CN104765638B CN 104765638 B CN104765638 B CN 104765638B CN 201410008811 A CN201410008811 A CN 201410008811A CN 104765638 B CN104765638 B CN 104765638B
Authority
CN
China
Prior art keywords
unit
business
concurrent
business result
type
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
CN201410008811.6A
Other languages
Chinese (zh)
Other versions
CN104765638A (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.)
Ctrip Computer Technology Shanghai Co Ltd
Original Assignee
Ctrip Computer Technology Shanghai 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 Ctrip Computer Technology Shanghai Co Ltd filed Critical Ctrip Computer Technology Shanghai Co Ltd
Priority to CN201410008811.6A priority Critical patent/CN104765638B/en
Publication of CN104765638A publication Critical patent/CN104765638A/en
Application granted granted Critical
Publication of CN104765638B publication Critical patent/CN104765638B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

It includes processing unit, concurrent queue, several pre-assembled units, the first judging unit and second judgment unit that the present invention, which provides a kind of concurrent module, operation system, prepackage method of completing the square and creation method, concurrent module,;Processing unit obtains data mart modeling processing from data source, and the business result of generation is reached concurrent queue;First judging unit is used to judge the type of business result, and business result is transferred to the pre-assembled unit of the business result of pre-stored the type;Second judgment unit is used to judge whether the business result in the pre-assembled unit that business result is transferred to all to have generated, if the corresponding ranking functions of the pre-assembled unit for then calling business result to be transferred to, all business results in the pre-assembled unit for being transferred to business result are ranked up according to corresponding ranking functions.The present invention releases the high coupling between operation system and concurrent code, and in order to the independent tuning of concurrent module, while operation system has better scalability and maintainability.

Description

Concurrent module, operation system, prepackage method of completing the square and creation method
Technical field
The present invention relates to the communication between high concurrent system and operation system, in particular to a kind of concurrent module, operation system, The prepackage method of completing the square realized using the concurrent module and the creation method realized using the operation system.
Background technique
In high concurrent system, concurrent module business result generated is usually disorderly placed on concurrent data structure In, i.e., different types of business result is alternately stored in the same place.And operation system usually requires that and is meeting certain item When part, the business result that high concurrent system generates sequentially is handled.Generally, operation system can directly arrive concurrent module In go extraction business as a result, assembling up again by certain service logic.
This mode has two: the code needs of operation system are come into contacts with concurrency, are readily incorporated mistake;Its Secondary, excessive thread participates in competition concurrent data structure, leads to degradation, is unfavorable for system adjustment and optimization.
Summary of the invention
The technical problem to be solved by the present invention is in order to overcome in the prior art high performance operation system directly handle height Concurrency operation provides a kind of concurrent so as to cause the defect that service logic and high concurrent logic interact, are mutually coupled Module, operation system, prepackage method of completing the square and creation method, release the high coupling between operation system and concurrent code, will High concurrent code is isolated from operation system, so that coupled between operation system and concurrent module with loose form, this Sample not only improves the following extension of operation system, also facilitates the tuning to concurrent module.
The present invention is to solve above-mentioned technical problem by following technical proposals:
The present invention provides a kind of concurrent module comprising a processing unit and a concurrent queue, it is characterized in that, this is concurrent Module further includes several pre-assembled units, one first judging unit and a second judgment unit, and each pre-assembled unit is corresponding There are unique identification information and ranking functions, and the identification information of different pre-assembled units is different, each pre-assembled list The business result that member is used to be pre-stored the business result of a unique type and different pre-assembled units is pre-stored is different;
The processing unit is used to obtain data from a data source and be processed, and the business result of generation is transmitted to The concurrent queue;
First judging unit is used to judge the type of the business result, and the business result is shifted from the concurrent queue To the pre-assembled unit of the business result of pre-stored the type;
Whether the second judgment unit is used to judge the business result in the pre-assembled unit that the business result is transferred to Through whole generations, if the corresponding ranking functions of pre-assembled unit for then calling the business result to be transferred to, so that the business As a result all business results in the pre-assembled unit being transferred to are ranked up according to the corresponding ranking functions.
In the present solution, concurrent module operates concurrency in inside, it does not come into contacts with actual service logic, and is Operation system is returned to after the unordered result obtained after concurrent processing is ranked up by the requirement of operation system, is classified, in Common multithreading and concurrent program design technology are continued to use in the concurrency processing in portion.
The present invention also provides a kind of operation systems, it is characterized in that, which includes a setting unit, a creation list Member and a call unit, if the setting unit is used to for business result being divided into dry type, and each type is equipped with corresponding unique Identification information and ranking functions, and the identification information of different types is different;
The creating unit is used for the collection cooperation of all types and the corresponding identification information of each type and ranking functions For the example that the parameter of constructed fuction creates a concurrent module, so that the concurrent module is corresponding pre- according to the creation of those types Assembly unit;
The call unit is for calling the output interface of the concurrent module with the return of latency services result.
This programme introduces preassembled concept, and dependency rule is injected into this concurrently by the creating unit in the operation system In module, which is encapsulated in concurrent operations in concurrent module according to the relevant pre-assembled unit of regular Dynamic Maintenance Portion.The operation system obtains business result that is orderly, meeting business demand in a manner of traditional function call.Such one Come, the developer of the operation system can obtain the business of concurrent processing as a result, and simultaneously in the way of known function call The developer for sending out module will not be too much by the constraint of service logic.
Moreover, the operation system is injected into this after need to only abstracting the expectation form of the type of business result, sequence etc. In concurrent module, the interface function for then calling the concurrent module to provide, obstruction waiting is returned up to business result, the business system System is not relevant for specific concurrent processing process.
The present invention also provides a kind of prepackage methods of completing the square, it is characterized in that, it is realized using above-mentioned concurrent module, the prepackage Method of completing the square the following steps are included:
S1, obtain data from the data source and be processed, and the business result of generation is transmitted to the concurrent queue;
S2, judge the type of the business result, and the business result is transferred to pre-stored the type from the concurrent queue Business result pre-assembled unit;
S3, judge whether the business result in pre-assembled unit that the business result is transferred to all has generated, if The corresponding ranking functions of pre-assembled unit for then calling the business result to be transferred to, so that the prepackage that the business result is transferred to It is ranked up with all business results in unit according to the corresponding ranking functions, if otherwise repeating step S3
The present invention also provides a kind of creation methods, it is characterized in that, it is realized using above-mentioned operation system, the creation side Method the following steps are included:
S1, if business result is divided into dry type, and each type is equipped with corresponding unique identification information and sequence letter Number, and the identification information of different types is different;
S2, by the set of all types and the corresponding identification information of each type and ranking functions as constructed fuction The example that parameter creates the concurrent module, so that the concurrent module creates corresponding pre-assembled unit according to those types.
On the basis of common knowledge of the art, above-mentioned each optimum condition, can any combination to get each preferable reality of the present invention Example.
The positive effect of the present invention is that:
The present invention provides a kind of concurrent module, operation system, prepackage method of completing the square and creation method, relieves operation system High coupling between concurrent code, high concurrent code is isolated from operation system so that operation system with simultaneously It is coupled between hair module with loose form, not only improving operation system in this way has better scalability and maintainability, also side To the tuning of concurrent module, without excessively considering service logic in terms of demand.
Detailed description of the invention
Fig. 1 is the structural block diagram of the operation system of present pre-ferred embodiments.
Fig. 2 is the structural block diagram of the concurrent module of present pre-ferred embodiments.
Fig. 3 is the flow chart of the prepackage method of completing the square of present pre-ferred embodiments.
Fig. 4 is the flow chart of the creation method of present pre-ferred embodiments.
Specific embodiment
The present invention is further illustrated below by the mode of embodiment, but does not therefore limit the present invention to the reality It applies among a range.
As shown in Figure 1, the present embodiment provides a kind of operation systems comprising a setting unit 11,12 and of a creating unit One call unit 13, if the setting unit 11 is used to for business result being divided into dry type, and each type is equipped with and corresponds to uniquely Identification information and ranking functions, and the identification information of different types is different.
The creating unit 12 is used for the set of all types and each type corresponding identification information and ranking functions The example that parameter as constructed fuction creates a concurrent module, so that the concurrent module creates accordingly according to those types Pre-assembled unit there is several pre-assembled units in the concurrent module in this way.
The call unit 13 is for calling the output interface of the concurrent module with the return of latency services result.
As shown in Fig. 2, the present embodiment also provides a kind of concurrent module comprising a processing unit 21 and a concurrent queue 22, one first judging unit 23, a second judgment unit 24 and several pre-assembled units 25, each pre-assembled unit 25 are corresponding There are unique identification information and ranking functions, and the identification information of different pre-assembled units 25 is different, each pre-assembled Unit 25 be used to be pre-stored the business result of a unique type and the pre-stored business result of different pre-assembled unit 25 mutually not It is identical.
The processing unit 21 is used to obtain data from a data source and be processed, and the business result of generation is transmitted To the concurrent queue 22.
First judging unit 23 is used to judge the type of the business result, and by the business result from the concurrent queue 22 It is transferred to the pre-assembled unit 25 of the business result of pre-stored the type;
Whether the second judgment unit 24 is used to judge the business result in the pre-assembled unit that the business result is transferred to It all generates, if the corresponding ranking functions of pre-assembled unit 25 for then calling the business result to be transferred to, so that should All business results in the pre-assembled unit that business result is transferred to are ranked up according to the corresponding ranking functions.
Moreover, the present embodiment also provides a kind of prepackage method of completing the square and a kind of creation method, wherein the prepackage method of completing the square is utilized Above-mentioned concurrent module realizes that the creation method is realized using above-mentioned operation system.
As shown in figure 3, the prepackage method of completing the square the following steps are included:
Step 101 is processed from data source acquisition data, and the business result of generation is transmitted to this concurrently Queue;
Step 102, the type for judging the business result, and the business result is transferred to pre-stored be somebody's turn to do from the concurrent queue The pre-assembled unit of the business result of type;
Step 103 judges whether the business result in pre-assembled unit that the business result is transferred to all has generated, If then entering step 104, if otherwise repeating step 103;
Step 104, the corresponding ranking functions of pre-assembled unit for calling the business result to be transferred to, so that the business knot All business results in the pre-assembled unit that fruit is transferred to are ranked up according to the corresponding ranking functions.
As shown in figure 4, the creation method the following steps are included:
If business result is divided into dry type by step 201, and each type is equipped with corresponding unique identification information and row Order function, and the identification information of different types is different;
Step 202, using all types and the corresponding identification information of each type and the set of ranking functions as construction The example that the parameter of function creates the concurrent module, so that the concurrent module creates corresponding pre-assembled list according to those types Member.
A specific example is named to illustrate the present embodiment, so that those skilled in the art more fully understand this hair It is bright:
The setting unit 11 classifies to required business result according to type, and business result is divided into four types Type, and one unique identification information is set for each type, and the identification information of different types is different, such as these four The identification information of type is respectively ID1, ID2, ID3 and ID4.And also a sequence is arranged for each type in the setting unit 11 Function, the business result if identification information is respectively the type of ID1 and ID2 sort according to functional relation from small to large, identification Information is respectively that the business result of the type of ID3 and ID4 sorts according to functional relation from big to small.
The creating unit 12 be used for by these four types and the corresponding identification information of each type (ID1, ID2, ID3 and ID4) and ranking functions (functional relation from small to large, functional relation from small to large, functional relation from big to small, from big To small functional relation) the parameter example that creates the concurrent module of the set as constructed fuction so that the concurrent module Corresponding pre-assembled unit is created according to those types.It there is four pre-assembled units 25 in the concurrent module in this way, it is each Pre-assembled unit 25 is corresponding with unique identification information (ID1, ID2, ID3 and ID4) and ranking functions (from small to large respectively Functional relation, functional relation from small to large, functional relation from big to small, functional relation from big to small).Each pre-assembled The mutual not phase of the business result that unit 25 is pre-stored a type of business result respectively and different pre-assembled units 25 is pre-stored Together.
The processing unit 21 obtains data from a data source and is processed, and the business result of generation is transmitted to this Concurrent queue 22.First judging unit 23 judges the type of the business result, such as the type of the business result is the first The business result is then sent in the corresponding pre-assembled unit 25 of first seed type by type, which sentences Whether the business result broken in the pre-assembled unit that the business result is transferred to all has generated, if then calling the business knot The corresponding ranking functions of pre-assembled unit 25 (functional relation from small to large) that fruit is transferred to, so that the business result shifts All business results in pre-assembled unit extremely are ranked up according to the corresponding ranking functions.If first judging unit 23 The type for the business result judged is other types, then the business result is sent to the corresponding pre-assembled list of other types In member.
Later, if the operation system need the first seed type business as a result, if the call unit 13 pass through interface function Get(ID1 the output interface of the concurrent module is called) to wait the return of the business result of the first seed type, if the operation system Other kinds of business is needed as a result, then the call unit 13 passes through interface function get() call the output of the concurrent module to connect Mouthful to wait the return of other kinds of business result.
The present invention utilizes pre-assembled unit, and Lai Shixian concurrent operations are isolated with operation system, has reached good decoupling effect Fruit, convenient for safeguarding and extension;Concurrent inside modules can according to need dynamic adjustment Thread Count, easily reach system load, property The balance of energy.To simplify the exploitation of operation system, and operation system scalability and maintainable premise can not influenced Under, concurrent processing and independent tuning purposefully are made to concurrent module.
In addition, according to actual needs, designer can be in the interface function Get(of concurrent module) in increase overtime, fault-tolerant etc. Bells and whistles, so as to provide on the behavioural characteristic that the obstruction of typical function call waits (i.e. synchronization call) The function of asynchronous waiting.For the high concurrent system for being related to communicating, or even some fault tolerance features can be specified, so that certain meeting It when condition, is considered as data and is ready, without waiting all data all here, be thus avoided that due to communication The mistake of link and caused by infinite waiting.
Although specific embodiments of the present invention have been described above, it will be appreciated by those of skill in the art that these It is merely illustrative of, protection scope of the present invention is defined by the appended claims.Those skilled in the art is not carrying on the back Under the premise of from the principle and substance of the present invention, many changes and modifications may be made, but these are changed Protection scope of the present invention is each fallen with modification.

Claims (4)

1.一种并发处理装置,其包括一处理单元和一并发队列,其特征在于,该并发处理装置还包括若干预装配单元、一第一判断单元和一第二判断单元,每一预装配单元均对应有唯一的识别信息和排序函数,且不同的预装配单元的识别信息互不相同,每一预装配单元用于预存储一唯一类型的业务结果且不同的预装配单元预存储的业务结果互不相同;1. A concurrent processing device comprising a processing unit and a concurrent queue, characterized in that the concurrent processing device also includes several pre-assembled units, a first judgment unit and a second judgment unit, each pre-installed Each pre-assembly unit has unique identification information and sorting function, and the identification information of different pre-assembly units is different from each other. Each pre-assembly unit is used to pre-store a unique type of business result and different pre-assembly units Pre-stored business results are different from each other; 该处理单元用于从一数据源获取数据进行加工处理,并将生成的业务结果传输至该并发队列;The processing unit is used to obtain data from a data source for processing, and transmit the generated business result to the concurrent queue; 该第一判断单元用于判断该业务结果的类型,并将该业务结果从该并发队列转移至预存储该类型的业务结果的预装配单元;The first judging unit is used to judge the type of the business result, and transfer the business result from the concurrent queue to a pre-assembly unit that pre-stores the business result of this type; 该第二判断单元用于判断该业务结果转移至的预装配单元中的业务结果是否已经全部生成,若是则调用该业务结果转移至的预装配单元对应的排序函数,以使得该业务结果转移至的预装配单元中的所有业务结果按照该对应的排序函数进行排序。The second judgment unit is used to judge whether all the business results in the pre-assembly unit to which the business result is transferred have been generated, and if so, call the sorting function corresponding to the pre-assembly unit to which the business result is transferred, so that the business result is transferred All business results in the transferred pre-assembled unit are sorted according to the corresponding sorting function. 2.一种业务系统,其特征在于,该业务系统包括一设置单元、一创建单元和一调用单元,该设置单元用于将业务结果划分为若干类型,并每种类型设有对应唯一的识别信息和排序函数,且不同的类型的识别信息互不相同;2. A business system, characterized in that the business system comprises a setting unit, a creating unit and a calling unit, the setting unit is used to divide the business result into several types, and each type is provided with a corresponding unique identification information and sorting functions, and different types of identification information are different from each other; 该创建单元用于将所有类型以及每一类型对应的识别信息和排序函数的集合作为构造函数的参数创建一并发处理装置的实例,以使得该并发处理装置根据不同类型创建相应的预装配单元;The creation unit is used to create an instance of a concurrent processing device with all types and a set of identification information and sorting functions corresponding to each type as parameters of the constructor, so that the concurrent processing device creates corresponding pre-assembled units according to different types ; 该调用单元用于调用该并发处理装置的输出接口以等待业务结果的返回。The calling unit is used to call the output interface of the concurrent processing device to wait for the return of the business result. 3.一种预装配方法,其特征在于,其利用如权利要求1所述的并发处理装置实现,该预装配方法包括以下步骤:3. A pre-assembly method, characterized in that, it is realized by using the concurrent processing device as claimed in claim 1, and the pre-assembly method comprises the following steps: S1、从该数据源获取数据进行加工处理,并将生成的业务结果传输至该并发队列;S1. Acquire data from the data source for processing, and transmit the generated business results to the concurrent queue; S2、判断该业务结果的类型,并将该业务结果从该并发队列转移至预存储该类型的业务结果的预装配单元;S2, judging the type of the business result, and transferring the business result from the concurrent queue to a pre-assembly unit that pre-stores the business result of this type; S3、判断该业务结果转移至的预装配单元中的业务结果是否已经全部生成,若是则调用该业务结果转移至的预装配单元对应的排序函数,以使得该业务结果转移至的预装配单元中的所有业务结果按照该对应的排序函数进行排序,若否则重复步骤S3。S3. Determine whether all the business results in the pre-assembly unit to which the business result is transferred have been generated, and if so, call the sorting function corresponding to the pre-assembly unit to which the business result is transferred, so that the business result is transferred to the pre-assembly unit to which the business result is transferred. All business results in the allocation unit are sorted according to the corresponding sorting function, otherwise step S3 is repeated. 4.一种创建方法,其特征在于,其利用如权利要求2所述的业务系统实现,该创建方法包括以下步骤:4. a creation method, is characterized in that, it utilizes the business system as claimed in claim 2 to realize, this creation method comprises the following steps: S1、将业务结果划分为若干类型,并每种类型设有对应唯一的识别信息和排序函数,且不同的类型的识别信息互不相同;S1. Divide the business results into several types, and each type is provided with corresponding unique identification information and sorting function, and the identification information of different types is different from each other; S2、将所有类型以及每一类型对应的识别信息和排序函数的集合作为构造函数的参数创建该并发处理装置的实例,以使得该并发处理装置根据不同类型创建相应的预装配单元。S2. Create an instance of the concurrent processing device with all types and the set of identification information and sorting functions corresponding to each type as parameters of the constructor, so that the concurrent processing device creates corresponding pre-assembled units according to different types.
CN201410008811.6A 2014-01-08 2014-01-08 Concurrent modules, business systems, pre-assembly methods, and creation methods Active CN104765638B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410008811.6A CN104765638B (en) 2014-01-08 2014-01-08 Concurrent modules, business systems, pre-assembly methods, and creation methods

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410008811.6A CN104765638B (en) 2014-01-08 2014-01-08 Concurrent modules, business systems, pre-assembly methods, and creation methods

Publications (2)

Publication Number Publication Date
CN104765638A CN104765638A (en) 2015-07-08
CN104765638B true CN104765638B (en) 2019-04-09

Family

ID=53647486

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410008811.6A Active CN104765638B (en) 2014-01-08 2014-01-08 Concurrent modules, business systems, pre-assembly methods, and creation methods

Country Status (1)

Country Link
CN (1) CN104765638B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1524217A (en) * 2000-06-22 2004-08-25 Distributed Computing Service Platform
CN101446897A (en) * 2008-11-26 2009-06-03 重庆邮电大学 Resource management system based on net system business structure platform
CN101741665A (en) * 2009-12-24 2010-06-16 中兴通讯股份有限公司 Method, device and system for notifying service processing result information

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7689560B2 (en) * 2000-10-13 2010-03-30 Miosoft Corporation Persistent data storage techniques

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1524217A (en) * 2000-06-22 2004-08-25 Distributed Computing Service Platform
CN101446897A (en) * 2008-11-26 2009-06-03 重庆邮电大学 Resource management system based on net system business structure platform
CN101741665A (en) * 2009-12-24 2010-06-16 中兴通讯股份有限公司 Method, device and system for notifying service processing result information

Also Published As

Publication number Publication date
CN104765638A (en) 2015-07-08

Similar Documents

Publication Publication Date Title
CN107239335B (en) Job scheduling system and method for distributed system
US9965330B2 (en) Maintaining throughput of a stream processing framework while increasing processing load
CN106095673B (en) Automated testing method and system based on WEB interface
CN102214139B (en) An Execution Control and Scheduling Method for Distributed System-Oriented Automated Testing
CN103136364B (en) Clustered database system and data query processing method thereof
CN110083536B (en) Test resource allocation method and device, electronic equipment and storage medium
CN102279888A (en) Method and system for scheduling tasks
CN103870260A (en) Method and system for service interface development
CN102467532A (en) Task processing method and task processing device
WO2021190087A1 (en) Task execution method, device and system, and server
US7636908B1 (en) Generation of a specification of a network packet processor
US20140059000A1 (en) Computer system and parallel distributed processing method
CN109828790A (en) A kind of data processing method and system based on Shen prestige isomery many-core processor
CN111104309B (en) Method for quickly realizing comprehensive test flow
CN109684616A (en) Dynamic statement formula assembles the method and system made a report on
CN112379884A (en) Spark and parallel memory computing-based process engine implementation method and system
CN114756629A (en) Multi-source heterogeneous data interaction analysis engine and method based on SQL
CN106503274A (en) A kind of Data Integration and searching method and server
CN106095678A (en) Automatization's result inspection method of data bank service operation under windows platform
CN113760297B (en) Strategic class division method, system, computer equipment and medium
CN103198099A (en) Cloud-based data mining application method facing telecommunication service
CN105468682B (en) A kind of event scheduling system
CN101853047B (en) Timer realization method and device
CN104765638B (en) Concurrent modules, business systems, pre-assembly methods, and creation methods
CN103294774B (en) The device and method carrying out data warehouse loading in batches based on zone

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant