Summary of the invention
Can cause for the processing method of present charge information can't charging or the lower problem for the treatment of effeciency and propose the present invention, and for this reason, the present invention aims to provide a kind of processing method and device of charge information, to solve at least one of the problems referred to above.
A kind of processing method of charge information is provided according to an aspect of the present invention.
Processing method according to charge information of the present invention, be applied to comprise the gateway of a plurality of service processors, said method comprises: in each service processor memory is set, and in gateway state machine is set, wherein, memory and state machine are used for the storage charge information; Successfully carry out the first charge information that service processor that message transmits will represent to transmit successfully in a plurality of service processors and store in the memory of this service processor, and the first charge information is sent to state machine preserve.
Preferably, the processing that state machine is set further comprises: state machine is arranged internal storage and external memory storage.
Preferably, be provided with in gateway after the state machine, said method also comprises: state machine regular check internal storage; With charging message that memory time in the internal storage, length surpassed scheduled duration internally memory dump in the external memory storage.
Preferably, after state machine received the first charge information, said method also comprised: state machine judges whether the memory space of internal storage reaches the first predetermined threshold; Be in the situation that is in judged result, the second charge information that state machine preferentially will deposit in the internal storage the earliest dumps in the external memory storage, and the first charge information is stored in the internal storage; In the situation that the determination result is NO, state machine stores the first charge information in the internal storage into.
Preferably, the processing the first charge information stored in the memory of service processor of service processor specifically comprises: service processor judges whether the memory space of memory reaches the second predetermined threshold; Be in the situation that is in judged result, service processor will deposit the earliest the 3rd charge information of memory in and delete from memory, and the first charge information is stored in the memory; In the situation that the determination result is NO, service processor stores the first charge information in the memory into.
Preferably, the first charge information is sent to after state machine preserves at service processor, said method also comprises: the service processor that successfully carries out the message forwarding receives the receipt of forwarding messages from the lower level network element that receives forwarding messages, and judges the first charge information that whether exists in the memory corresponding to forwarding messages; For being in the situation, carry out charging according to the first charge information in judged result, and superior network element forwarding receipt, send deletion message to state machine, wherein, deletion message is used to indicate deletion the first charge information; In the situation that the determination result is NO, successfully carry out the service processor of message forwarding and inquire about the first charge information to state machine.
Preferably, after inquiring about the first charge information to state machine, said method also comprises: state machine judges whether there is the first charge information in the internal storage; Be in the situation that is in judged result, the first charge information is sent to service processor, and deletion the first charge information in the memory internally; In the situation that the determination result is NO, externally search the first charging message in the memory, the first charge information that finds is sent to service processor, and from external memory storage, delete the first charge information.
Preferably, after state machine sent to service processor with the first charge information, said method also comprises: service processor received the first charge information, carries out charging according to the first charge information, and the superior network element is transmitted receipt.
Preferably, in the situation about breaking down in a plurality of service processors, said method also comprises: other service processors obtain the charge information of the service processor that breaks down and substitute the service processor that breaks down and process from state machine.
A kind of processing unit of charge information is provided according to a further aspect in the invention.
According to the processing unit of charge information of the present invention, be applied to comprise the gateway of a plurality of service processors, said apparatus comprises: first arranges module, is used at each service processor memory being set, and wherein, memory is used for the storage charge information; Second arranges module, is used at gateway state machine being set, and wherein, state machine is used for the storage charge information; Memory module, the first charge information that is used for will representing to transmit successfully stores memory into; Sending module is used for that the first charge information is sent to state machine and preserves.
By the present invention, the method that employing arranges memory and state machine is set in gateway in each service processor, the processing method that has solved present charge information can cause can't charging or the lower problem for the treatment of effeciency, and then has improved the disposal ability of system.
Embodiment
Functional overview
The invention provides a kind of processing method and device of charge information, be applied to comprise the gateway of a plurality of service processors.In the internal memory of each service processor module, open up a charge information memory block, in multi-module system, increase state machine module, be responsible for the concentrated buffer memory of charge information, not only comprise memory storage area but also comprise the external memory memory block.
The below is that example is described in detail to implement process of the present invention in Short Message Service Gateway.Fig. 1 is the structured flowchart for the gateway of implementing the embodiment of the invention, as shown in Figure 1, a plurality of interface message processor (IMP)s (interface message processor (IMP) 1 is to interface message processor (IMP) n) are connected to respectively a plurality of service processors (service processor 1 is to service processor n), a plurality of service processors are connected to state machine, wherein, be provided with the memory for the storage charge information in each service processor, comprise internal storage and external memory storage in the state machine.
Describe below with reference to the accompanying drawings and in conjunction with the embodiments the present invention in detail.
Embodiment of the method
According to embodiments of the invention, a kind of processing method of charge information is provided, be applied to comprise the gateway of a plurality of service processors.The method comprises the management of the memory of service processor at least, the management of state machine internal storage, external memory storage, charge information is preserved, deletes, inquired about to service processor to state machine, the synchronous and cleaning of state machine internal storage data and external memory storage data.
Fig. 2 is the flow chart according to the processing method of the charge information of the embodiment of the invention, and as shown in Figure 2, the method comprises:
Step S202 arranges memory, and in gateway state machine is set in each service processor, wherein, memory and state machine are used for the storage charge information; The processing that state machine is set further comprises: state machine is arranged internal storage and external memory storage; Particularly, when system starts, each service processor application has a certain size memory, and the state machine application has a certain size internal storage and initialization external memory storage (can be set to a database), sets up communication link between service processor and the state machine; After this, state machine regularly (regularly) checks internal storage, with in the internal storage memory time length above the charging message of scheduled duration internally memory dump in the external memory storage; That is, with depositing internal storage in above the message of certain hour, remove in the memory internally, and be saved in the external memory storage, the message that the access time surpasses the fixed time then continues to be retained in the internal storage;
Wherein, the processing the first charge information stored in the memory of service processor of service processor specifically comprises: service processor judges whether the memory space of memory reaches the second predetermined threshold; Be in the situation that is in judged result, service processor will deposit the earliest the 3rd charge information of memory in and delete from memory, and the first charge information is stored in the memory; In the situation that the determination result is NO, service processor stores the first charge information in the memory into; That is, if find that when depositing local internal storage (that is, the memory of service processor) in internal storage is full, then first deletion deposits the charge information of this internal storage the earliest in, preserves this charge information to internal memory again;
Step S204, successfully carrying out the first charge information that service processor that message transmits will represent to transmit successfully in a plurality of service processors stores in the memory of this service processor, namely, after each service processor forwards the message to the lower level network element success, the charge information of this message is deposited in the local memory, and the first charge information is sent to state machine preserve;
After this, state machine judges whether the memory space of internal storage reaches the first predetermined threshold; Be in the situation that is in judged result, the second charge information that state machine preferentially will deposit in the internal storage the earliest dumps in the external memory storage, and the first charge information is stored in the internal storage; In the situation that the determination result is NO, state machine stores the first charge information in the internal storage into; Namely, after state machine receives the message of preserving charge information, this message is deposited in the internal storage of state machine, if the occupancy of its internal storage has reached certain proportion, then will deposit the earliest the message of internal storage in first, remove in the memory internally, and be saved in the external memory storage, guarantee that new information can store internal storage into.
By the present invention, the method that employing arranges memory and state machine is set in gateway in each service processor, the processing method that has solved present charge information can cause can't charging or the lower problem for the treatment of effeciency, and then has improved the disposal ability of system.
After step S204, said method also comprises: after service processor is received receipt from lower level network element, the charge information of message corresponding to inquiry return receipt in the internal storage of this locality at first, if find then produce ticket, and to upper level network element forwarding receipt, the charge information of preserving in the deletion state machine that sends a request message simultaneously; If do not find corresponding charge information in the internal storage, then send a request message to charge information corresponding to inquiry in the state machine, after state machine is received query requests, at first in internal memory, inquire about, do not find again and in external memory storage, inquire about.After the charge information that inquires message corresponding to receipt, charge information is returned to corresponding service processor, and this charge information is deleted from state machine; Service processor receives this charge information and produces ticket again, and transmits receipt to upper level network element.
Particularly, said process can be implemented in the following way:
(1) successfully carries out the service processor that message transmits and receive the receipt of forwarding messages from the lower level network element that receives forwarding messages, and judge the first charge information that whether exists in the memory corresponding to forwarding messages.
(2) in memory, exist in the situation corresponding to the first charge information of forwarding messages, carry out charging according to the first charge information, and superior network element forwarding receipt, deletion message sent to state machine, wherein, deletion message is used to indicate deletion the first charge information.
(3) in memory, do not exist in the situation corresponding to the first charge information of forwarding messages, successfully carry out the service processor that message transmits and inquire about the first charge information to state machine.
(4) state machine judges whether there is the first charge information in the internal storage.
(5) in internal storage, exist in the situation of the first charge information, the first charge information is sent to service processor, and delete the first charge information in the memory internally; After this, service processor receives the first charge information, carries out charging according to the first charge information, and the superior network element is transmitted receipt.
(6) in internal storage, do not exist in the situation of the first charge information, externally search the first charging message in the memory, the first charge information that finds is sent to service processor, and from external memory storage, delete the first charge information; After this, service processor receives the first charge information, carries out charging according to the first charge information, and the superior network element is transmitted receipt.
In addition, in the situation about breaking down in a plurality of service processors, other service processors obtain the charge information of the service processor that breaks down and substitute the service processor that breaks down and process from state machine.This processing has taken into account the disaster tolerance of multi-module system and has processed.
Describe implementation method of the present invention and handling process in detail below in conjunction with Fig. 3, external memory storage is take database as example.Fig. 3 is the schematic diagram according to the processing method of the charge information of the embodiment of the invention, as shown in Figure 3, may further comprise the steps:
Step 1, initialization; According to the design disposal ability of gateway and the statistical law of lower level network element receipt message delay return time, determine that (the affirmation principle of internal storage capacity is: with message buffering as much as possible in internal storage for the capacity of the internal storage that service processor, state machine need to distribute and the maximum storage time of the medium receipt message of state machine internal storage, for example, guarantee that 80% the receipt message that waits can directly find, and takes into account the total capacity restriction of internal storage simultaneously in internal memory); Distribute internal storage according to the internal storage capacity of determining, state machine internal storage clearance time T0 is set, the state machine building database connects.
Step 2, service processor short-message store the charge information of message in the middle of the internal storage into after the lower level network element success, send the request message (that is, 32 among the figure) of preserving charge information to state machine simultaneously; If the service processor internal storage is full, then when storage, delete first one that deposits in the earliest, preserve again new record; When state machine is preserved charge information, be saved in the internal memory first, if the occupancy of internal memory reaches certain ratio, then will remove in the memory internally above the message of occupancy, and be saved in the middle of the database.(wherein, above-mentioned occupancy can be configured according to the system configuration situation, under the extreme case, can only keep the free space that can store a piece of news.)
Step 3, state machine are regularly carried out the internal storage cleaning operation, when finding have message to surpass maximum storage time T0 the memory time in internal storage, then will remove in the memory internally above the message of memory time, and be saved in the middle of the database.
Step 4, after service processor receives receipt from lower level network element, charge information corresponding to inquiry return receipt in internal storage at first, if find, then according to short message sending status call list in the receipt, transmit receipt to upper level network element, the request message that sends the deletion charge information to state machine simultaneously is (namely, among the figure 34), the charge information that keeps in the deletion state machine; If do not find corresponding charge information in the internal storage, the query requests that then sends the inquiry charge information to state machine (namely, among the figure 36), state machine is inquired about first charge information in internal memory, if find charge information, return inquiry charging response (namely to service processor, among the figure 38), if do not find, then state machine is inquired about corresponding charge information in database, and Query Result is returned to service processor, after this, service processor is according to the short message sending status call list in the receipt, and transmits receipt to upper level network element; If do not find charge information, then service processor carries out abnormality processing, and simultaneously, state machine will send to the charge information deletion of service processor.
According to above processing method, when certain service processor fault, other service processor can be taken over the business of this processor, and does not affect the charging of the message of transmitting before this service processor.
Device embodiment
According to embodiments of the invention, a kind of processing unit of charge information is provided, be applied to comprise the gateway of a plurality of service processors.
Fig. 4 is the structured flowchart according to the processing unit of the charge information of the embodiment of the invention, and as shown in Figure 4, this device comprises: first arranges module 42, second arranges module 44, memory module 46, sending module 48, and the below is described said structure.
First arranges module 42, is used at each service processor memory being set, and wherein, memory is used for the storage charge information.
Second arranges module 44, is used at gateway state machine being set, and wherein, state machine is used for the storage charge information.
Memory module 46 is connected to first module 42 is set, and is used for will represent to transmit successful the first charge information and stores the first memory that module 42 settings are set into.
Sending module 48 is connected to memory module 46 and second module 44 is set, and is used for that the first charge information that memory module 46 is stored is sent to the second state machine that module 44 settings are set and preserves.
By the present invention, the method that employing arranges memory and state machine is set in gateway in each service processor, both utilized the high-speed of internal storage, utilized again the large capacity of external memory storage, the processing method that has solved present charge information can cause can't charging or the lower problem for the treatment of effeciency, and then improved the disposal ability of system, taken into account again the disaster tolerance of multimode simultaneously and processed.
Obviously, those skilled in the art should be understood that, above-mentioned each module of the present invention or each step can realize with general calculation element, they can concentrate on the single calculation element, perhaps be distributed on the network that a plurality of calculation elements form, alternatively, they can be realized with the executable program code of calculation element, thereby, they can be stored in the storage device and be carried out by calculation element, perhaps they are made into respectively each integrated circuit modules, perhaps a plurality of modules in them or step are made into the single integrated circuit module and realize.Like this, the present invention is not restricted to any specific hardware and software combination.
The above is the preferred embodiments of the present invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.