Summary of the invention
The embodiment of the present invention provides a kind of method for processing business based on multi-services device and service server, is used for carryingThe high reliability that business service is provided to terminal unit.
First aspect, the embodiment of the present invention provides a kind of method for processing business based on multi-services device, is applied to work asFront service server, described method includes:
The Business Processing request that receiving terminal apparatus sends, pending business is entered by the request of described Business Processing for requestRow processes;
Obtain the target histories business record that described terminal unit is corresponding, the business that described target histories business record is correspondingType is identical with the type of service of described pending business, and described target histories business record includes target service serverMark;
According to described target histories business record, obtain in described target service server or described current business serverTake up-to-date business datum, according to described up-to-date business datum, described pending business is processed.
In a kind of possible embodiment, the request of described Business Processing includes described target histories business record, phaseAnswer, the target histories business record that the described terminal unit of described acquisition is corresponding, including:
Obtain, in described Business Processing is asked, the target histories business record that described terminal unit is corresponding.
In alternatively possible embodiment, the target histories business record that the described terminal unit of described acquisition is corresponding,Including:
The history service set of records ends that described terminal unit is corresponding, described history service is obtained to described premises equipment requestsWhen set of records ends includes at least one history service record and type of service corresponding to each history service record and service endingCarve;
By identical with the type of service of described pending business in described history service set of records ends, the service ending momentThe history service record nearest with current time is defined as described target histories business record.
In alternatively possible embodiment, described target histories business record also includes described target histories businessThe target service finish time that record is corresponding;
Accordingly, described according to described target histories business record, in described target service server or described current industryBusiness server obtains up-to-date business datum, including:
Judge whether described target service server and described current business server are same service server;
In described current business server, the most then obtain described up-to-date business datum;
If it is not, then judge whether the time difference of current time and described target service finish time updates week more than presettingPhase, the most then in described current business server, obtain described up-to-date business datum, if it is not, then take in described target serviceBusiness device obtains described up-to-date business datum.
In alternatively possible embodiment, described target service server obtains described up-to-date business datum,Including:
Obtain the latest update moment;
Described target service server obtains and when generating, is engraved in described latest update moment and described target service knotBusiness datum between the bundle moment.
Second aspect, the embodiment of the present invention provides a kind of service server, including:
Receiver module, the Business Processing request sent for receiving terminal apparatus, the request of described Business Processing is used for askingPending business is processed;
First acquisition module, for obtaining the target histories business record that described terminal unit is corresponding, described target historiesThe type of service that business record is corresponding is identical with the type of service of described pending business, wraps in described target histories business recordInclude the mark of target service server;
Second acquisition module, for according to described target histories business record, at described target service server or describedCurrent business server obtains up-to-date business datum;
Processing module, for processing described pending business according to described up-to-date business datum.
In a kind of possible embodiment, the request of described Business Processing includes described target histories business record, instituteState the first acquisition module specifically for:
Obtain, in described Business Processing is asked, the target histories business record that described terminal unit is corresponding.
In alternatively possible embodiment, described first acquisition module specifically for:
The history service set of records ends that described terminal unit is corresponding, described history service is obtained to described premises equipment requestsWhen set of records ends includes at least one history service record and type of service corresponding to each history service record and service endingCarve;
By identical with the type of service of described pending business in described history service set of records ends, the service ending momentThe history service record nearest with current time is defined as described target histories business record.
In alternatively possible embodiment, described target histories business record also includes described target histories businessThe target service finish time that record is corresponding;
Accordingly, described second acquisition module includes judging unit and acquiring unit, wherein,
Described judging unit is used for, it is judged that whether described target service server and described current business server are sameService server;
Described acquiring unit is used for, and judges described target service server and described current business clothes at described judging unitWhen business device is same service server, described current business server obtains described up-to-date business datum;
Described judging unit is additionally operable to, and judges described target service server and described current business at described judging unitWhen server is not same service server, it is judged that whether the time difference of current time and described target service finish time is more thanPreset the update cycle;
Described acquiring unit is additionally operable to, and judges current time and described target service finish time at described judging unitTime difference, whether more than when presetting the update cycle, obtains described up-to-date business datum in described current business server, describedAcquiring unit is additionally operable to, described judging unit judge the time difference of current time and described target service finish time less than orEqual to when presetting the update cycle, described target service server obtains described up-to-date business datum.
In alternatively possible embodiment, described acquiring unit specifically for:
Obtain the latest update moment;
Described target service server obtains and when generating, is engraved in described latest update moment and described target service knotBusiness datum between the bundle moment.
The method for processing business based on multi-services device of embodiment of the present invention offer and service server, in current industryAfter business server receives the Business Processing request that terminal unit sends, it is corresponding that current business server obtains terminal unitTarget histories business record, and according to target histories business record, obtain in target service server or current business serverTake up-to-date business datum, according to up-to-date business datum, pending business is processed.In above process, current business serviceDevice necessarily can acquire the up-to-date business datum that pending business is corresponding so that current business server is according to up-to-date businessData can provide data server accurately to terminal unit, and then improve and provide the reliable of business service to terminal unitProperty.
Detailed description of the invention
For making the purpose of the embodiment of the present invention, technical scheme and advantage clearer, below in conjunction with the embodiment of the present inventionIn accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment isThe a part of embodiment of the present invention rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the artThe every other embodiment obtained under not making creative work premise, broadly falls into the scope of protection of the invention.
The application scenarios schematic diagram of the Business Processing based on multi-services device that Fig. 1 provides for the present invention, refers to figure1, including terminal unit 101, load-balancing device 102 and multiple service server (being designated as 103-1 to 103-N respectively).This is eventuallyEnd equipment can be the equipment such as TV, computer, mobile phone.Each service server can provide identical business to take to terminal unitBusiness, wherein, different service servers may be located at different machine rooms.In actual application, true by load-balancing deviceDirectional terminals equipment provides the service server of business service.In this application, industry is provided at service server to terminal unitDuring business service, service server can obtain up-to-date business datum according to the history service record of terminal unit, and according to up-to-dateBusiness datum provides service server to terminal unit so that service server can be according to up-to-date business datum to terminal unitBusiness service accurately is provided, and then improves the reliability that business service is provided to terminal unit.Below, by being embodied asExample, is described in detail to the technical scheme shown in the application.
It should be noted that these specific embodiments can be combined with each other, for same or analogous concept belowOr process may repeat no more in certain embodiments.
The flow chart of the method for processing business based on multi-services device that Fig. 2 provides for the present invention, refers to Fig. 2, shouldMethod may include that
The Business Processing request that S201, receiving terminal apparatus send, Business Processing request is for asking pending businessProcess;
S202, the target histories business record that acquisition terminal unit is corresponding, the service class that target histories business record is correspondingType is identical with the type of service of pending business, and target histories business record includes the mark of target service server;
S203, according to target histories business record, obtain up-to-date in target service server or current business serverBusiness datum, processes pending business according to up-to-date business datum.
It should be noted that the executive agent of the embodiment of the present invention is current business server, this current service serverIt can be any one service server in multi-services device.For the ease of describing, will currently provide the industry of business serviceBusiness server is referred to as current business server.
In embodiments of the present invention, when terminal unit needs service server to process pending business, terminalEquipment can ask load-balancing device to be the service server that terminal unit determines correspondence.Further, in order to reduce loadThe burden of balancing equipment, terminal unit can be that its address of service server determined caches, to have to load balancingService to this service server requested service in the effect period.Optionally, this effectual time can be 5 minutes, 10 minutes etc..
Accordingly, when terminal unit needs service server to process pending business, terminal unit can be firstJudge whether this locality caches effective address of service server;The most then terminal unit can be according to the effective industry of this cachingBusiness server address, asks corresponding service server to process pending business;If it is not, then terminal unit is equal to loadWeighing apparatus equipment sends service request, load-balancing device determine service server to terminal unit, then this industry of premises equipment requestsPending business is processed by business server.
After current business server receives the Business Processing request that terminal unit sends, current business server obtainsTake the target histories business record that this terminal unit is corresponding.Type of service corresponding to this target histories business record and pending industryThe type of service of business is identical, and this target histories business record includes that the mark of target service server and target service terminateIn the moment, this target service server for providing the server of target histories business to terminal unit.This target histories business recordCan be the last business note identical to the type of service with pending business of terminal unit offer before current timeRecord.It should be noted that other guide can also be included in this target histories business record, such as, target service record is correspondingBusiness initial time etc..
After current business server acquires target histories business record, current business server is gone through according to targetHistory business record, obtains up-to-date business datum in target service server or current business server, and according to up-to-date businessPending business is processed by data.Concrete, owing to, before current time, target service server carries to terminal unitSupplied the business service with type, therefore, target service server store the up-to-date industry that target histories business record is correspondingBusiness data.
If the business datum corresponding with target histories business record of storage is synchronized to the most in time in target service serverCurrent business server, then in this target service server, the business datum of storage is up-to-date business datum, current business serviceIn device, the business datum of storage is not up-to-date business datum.
If the business datum corresponding with target histories business record of storage has been synchronized to currently in target service serverService server, then the business datum stored in current business server and in target service server is up-to-date business numberAccording to.
The method for processing business based on multi-services device that the embodiment of the present invention provides, receives at current business serverAfter the Business Processing request that terminal unit sends, current business server obtains the target histories business that terminal unit is correspondingRecord, and according to target histories business record, target service server or current business server obtain up-to-date business numberAccording to, according to up-to-date business datum, pending business is processed.In above process, current business server necessarily can obtainObtain the up-to-date business datum that pending business is corresponding so that current business server can be to end according to up-to-date business datumEnd equipment provides data server accurately, and then improves the reliability providing business service to terminal unit.
On the basis of embodiment illustrated in fig. 2, according to the difference of the content that Business Processing request includes, obtain target and go throughThe process of Records of the Historian record also differs, below, by the embodiment shown in Fig. 3-Fig. 4, introduce two kinds of feasible implementations.ItsIn, in the embodiment shown in fig. 3, Business Processing request includes target histories business record;In the embodiment shown in Fig. 4In, Business Processing request does not include target histories business record.
The schematic flow sheet one obtaining target histories recording method that Fig. 3 provides for the present invention, refers to Fig. 3, the methodMay include that
S301, the target histories business record that acquisition terminal unit is corresponding in Business Processing is asked.
During terminal unit runs, terminal unit can provide with record traffic server for it, all types of industryThe up-to-date business record that business is corresponding.Optionally, up-to-date business record can include type of service, the mark of service server,Business initial time, service ending moment etc..In actual application, can arrange according to actual needs in business record and wrapThe content included.
In the embodiment shown in fig. 3, when terminal unit sends Business Processing request to current business server, terminalEquipment carries target histories business record, so that current business server can be in Business Processing in Business Processing is askedQuick obtaining target histories business record in request, and then improve current business server to terminal unit offer business serviceEfficiency.
Exemplary, it is assumed that terminal unit is TV, then during TV runs, for class each of in TVThe business of type, TV can record the up-to-date business record that all types of business is corresponding, optionally, each type of television recordingCorresponding up-to-date business record can be as shown in table 1:
Table 1
| Business record | The type of business | The mark of service server | Business initial time | The service ending moment |
| Business record 1 | TV play business | Service server 1 | 10: 10 | 10: 12 |
| Business record 2 | Film business | Service server 4 | 13: 15 | 13: 20 |
| Business record 3 | Game service | Service server 3 | 12: 30 | 12: 40 |
| …… | …… | …… | …… | …… |
In Table 1, business record 1 is the up-to-date business record that TV play business is corresponding.When TV needs to business serviceWhen the business service of TV play business asked again by device, TV carries business record 1 in Business Processing is asked.If 10: 10After Fen, service server provides, to TV, the new business service that TV play business is corresponding, then TV is to shown in table 1Business record 1 is updated.
It should be noted that the content that the business record in table 1 signal TV the most in exemplary fashion includes, notIt is the restriction of the content that business record is included, in actual application, business record can be set according to actual needsThe content included, this is not especially limited by the present invention.
The schematic flow sheet two obtaining target histories recording method that Fig. 4 provides for the present invention, refers to Fig. 4, the methodMay include that
S401, obtain history service set of records ends corresponding to terminal unit to premises equipment requests;Wherein, history service noteWhen record set includes at least one history service record and type of service corresponding to each history service record and service endingCarve;
S402, by identical with the type of service of pending business in history service set of records ends, service ending moment withThe nearest history service record of current time is defined as target histories business record.
During terminal unit runs, terminal unit can be remembered with record traffic server for its history service providedRecord set, this history service set of records ends includes at least one history service record and industry corresponding to each history service recordService type and service ending moment.Certainly, in actual application, in history service set of records ends can also include otherHold.
When current business server needs to obtain target histories record corresponding to terminal unit, current business server toPremises equipment requests obtains history service set of records ends corresponding to terminal unit, and in history service set of records ends with pending industryBusiness type of service is identical, history service record that the service ending moment is nearest with current time be defined as target histories businessRecord, accordingly, this target histories business record for before current time the last to terminal unit provide with pendingThe business record that the type of service of business is identical.
In the embodiment shown in fig. 4, service server determine to target histories business record, it is not necessary to terminal unit is trueSet the goal history service record, and then reduces the burden of terminal unit.
Exemplary, it is assumed that terminal unit is TV, then, during TV runs, TV can record all types ofAll business records that business is corresponding, optionally, the business record of television recording can be as shown in table 2:
Table 2
Assume that current time is point in 10 days 12 January, receive, at service server 2, the TV play service request that TV sendsAfterwards, service server 2 obtains the history service set of records ends shown in table 2, and in the history service set of records ends shown in table 2Obtain and TV play type of service, service ending moment and the nearest business record of current time 11, and by true for business record 11It is set to target histories business record.
On the basis of any one embodiment above-mentioned, optionally, can be by the most feasible implementation according to meshMark history service record, obtains up-to-date business datum in target service server or current business server and (implements shown in Fig. 2S203 in example), concrete, shown in Figure 5 embodiment.
The schematic flow sheet obtaining up-to-date business datum method that Fig. 5 provides for the present invention, refers to Fig. 5, and the method canTo include:
S501, judge whether target service server and current business server are same service server;
The most then perform S502;
If it is not, then perform S503-S504;
S502, in current business server, obtain up-to-date business datum;
S503, judge that the time difference of current time and target service finish time is whether more than presetting the update cycle;
The most then perform S502;
If it is not, then perform S504;
S504, in target service server, obtain up-to-date business datum.
In the embodiment shown in fig. 5, after current business server acquires target histories business record, currentlyService server obtains mark and the target service finish time of target service server in target histories business record.CurrentlyWhether service server judging target service server and current business server are same service server, optionally, currentlyService server may determine that the mark of target service server and current business server identify whether consistent, target serviceThe mark of server can be preset numbers or target service server Internet protocol (Internet Protocol,It is called for short IP) address or media interviews control (Medium Access Control is called for short MAC) address etc..
If target service server and current business server are same service server, then current business server is being worked asFront service server obtains the up-to-date business datum that pending business is corresponding.
If target service server and current business server are not same service server, then current business server is sentencedWhether disconnected current time and the time difference of target service finish time be more than presetting the update cycle, and this default update cycle is targetThe cycle of data syn-chronization is carried out between service server and current business server.
Business datum that the most then store in explanation target service server, that pending business is corresponding is synchronized toIn current business server, target service server and current business server, storage is up-to-date business datum, in order to addThe fast speed obtaining business datum, can obtain up-to-date business datum in current business server.
If it is not, then illustrate that business datum that store in target service server, that pending business is corresponding is not synchronized toCurrent business server, for the up-to-date business datum acquired, then current business server is from target service serverObtain up-to-date business datum.Optionally, current business server can obtain the latest update moment, in target service serverObtain and be engraved in the business datum between latest update moment and target service finish time when generating.
In actual application, current business server can also judge target industry by the most feasible implementationWhether business datum that store in business server, that pending business is corresponding is synchronized to current business server, concrete: currentService server can also obtain the latest update moment, this latest update moment be between each service server the last time carry outThe moment of data syn-chronization, and judge that this latest update moment whether after target service finish time, the most then illustrates targetBusiness datum that store in service server, that pending business is corresponding has been synchronized to current business server, if it is not, then illustrateBusiness datum that store in target service server, that pending business is corresponding is not synchronized to current business server.
Below, by concrete example, the method shown in above-described embodiment is described in detail.
Exemplary, it is assumed that terminal unit is TV, and service server 1-service server 5 all can provide industry to TVBusiness service, it is assumed that the default update cycle carrying out data syn-chronization between service server is 10 minutes.
When TV needs to the business of service server request TV play type, TV sends to load-balancing device pleaseSeek message, so that load-balancing device distributes a service server to TV, it is assumed that load-balancing device distributes to TVService server is service server 2.
Assume before current time, service server 1 business service of the TV play type provided to TV, and industryBusiness server 1 to TV provide business finish time be 1 and No. 1 10: 5.Then TV is sending industry to service server 2When business processes request, carry in Business Processing is asked and once go through to the target that the business of TV offer TV play type is correspondingHistory business record, it is assumed that the target service server that target histories business record includes is service server 1, target histories industryThe target service finish time that business record includes is 10: 5 on the 1st January.
After the Business Processing request that service server 2 receives, service server 2 obtains mesh in Business Processing is askedMark history service record, and in target histories business record obtain target service server mark (service server 1) andTarget service finish time (10: 5 on the 1st January).
Service server 2 judges that target service server (service server 1) and service server 2 are not same businessServer, then at the end of service server 2 continues to judge current time (assuming that current time is 10: 10) and target serviceThe time difference (5 minutes) carving (10: 5 on the 1st January) is less than the default update cycle (10 minutes), then in explanation service server 1The business datum relevant to TV play business of storage is not updated in service server 2, then service server 2 obtains up-to-dateRenewable time (1 and No. 1 10: 2), then service server 2 is engraved in January 1 day 10: 2 when obtaining generation in service server 1Point to the business datum in 1 day 10: 5/January, and be engraved in during by generation 10: 2 on the 1st January to 1 day 10: 5 January/Between business datum be defined as up-to-date business datum.
The structural representation one of the service server that Fig. 6 provides for the present invention, refers to Fig. 6, this service server can:
Receiver module 601, the Business Processing request sent for receiving terminal apparatus, it is right that Business Processing request is used for askingPending business processes;
First acquisition module 602, for obtaining the target histories business record that terminal unit is corresponding, target histories business is rememberedThe type of service of record correspondence is identical with the type of service of pending business, and target histories business record includes target service serviceThe mark of device;
Second acquisition module 603, for according to target histories business record, taking at target service server or current businessBusiness device obtains up-to-date business datum;
Processing module 604, for processing pending business according to up-to-date business datum.
Service server shown in the embodiment of the present invention can perform the technical scheme shown in said method embodiment, in factExisting principle and beneficial effect are similar to, and the most no longer repeat.
In a kind of possible embodiment, Business Processing request includes target histories business record, accordingly, firstAcquisition module 602 specifically for:
The target histories business record that terminal unit is corresponding is obtained in Business Processing is asked.
In alternatively possible embodiment, the first acquisition module 602 specifically for:
Obtain, to premises equipment requests, the history service set of records ends that terminal unit is corresponding, history service set of records ends is wrappedInclude at least one history service record and type of service corresponding to each history service record and service ending moment;
By identical with the type of service of pending business in history service set of records ends, service ending moment with time currentCarve nearest history service record and be defined as target histories business record.
The structural representation two of the service server that Fig. 7 provides for the present invention, on the basis of embodiment illustrated in fig. 6, pleaseSeeing Fig. 7, the second acquisition module 603 includes judging unit 6031 and acquiring unit 6032, wherein,
Judging unit 6031 is used for, it is judged that whether target service server and current business server are same business serviceDevice;
Acquiring unit 6032 is used for, and judges that target service server and current business server are same at judging unit 6031During one service server, current business server obtains up-to-date business datum;
Judging unit 6031 is additionally operable to, and judges target service server and current business server not at judging unit 6031When being same service server, it is judged that whether the time difference of current time and target service finish time updates week more than presettingPhase;
Acquiring unit 6032 is additionally operable to, and judges current time and the time of target service finish time at judging unit 6031Difference, whether more than when presetting the update cycle, obtains up-to-date business datum in current business server, and acquiring unit 6032 is also usedIn, judge that the time difference of current time and target service finish time is less than or equal to presetting the update cycle at judging unit 6031Time, target service server obtains up-to-date business datum.
In alternatively possible embodiment, acquiring unit 6032 specifically for:
Obtain the latest update moment;
Target service server obtains when generating and be engraved between latest update moment and target service finish timeBusiness datum.
Service server shown in the embodiment of the present invention can perform the technical scheme shown in said method embodiment, in factExisting principle and beneficial effect are similar to, and the most no longer repeat.
One of ordinary skill in the art will appreciate that: all or part of step realizing above-mentioned each method embodiment can be led toThe hardware crossing programmed instruction relevant completes.Aforesaid program can be stored in a computer read/write memory medium.This journeySequence upon execution, performs to include the step of above-mentioned each method embodiment;And aforesaid storage medium includes: ROM, RAM, magnetic disc orThe various media that can store program code such as person's CD.
Last it is noted that various embodiments above is only in order to illustrate technical scheme, it is not intended to limit;To the greatest extentThe present invention has been described in detail by pipe with reference to foregoing embodiments, it will be understood by those within the art that: it depends onSo the technical scheme described in foregoing embodiments can be modified, or the most some or all of technical characteristic is enteredRow equivalent;And these amendments or replacement, do not make the essence of appropriate technical solution depart from various embodiments of the present invention technologyThe scope of scheme.