Disclosure of Invention
The technical problem to be solved by the present invention is to provide a dual-computer switching method in a charging system, and related device and system, which can solve the problem of message loss in the dual-computer switching process on the premise of ensuring the original performance of the charging system. The technical scheme for solving the technical problems comprises the following steps:
a first aspect of the present application provides a method for dual-computer handover in a charging system, including:
receiving a dual-computer switching starting message sent by a charging network element before switching;
after receiving the dual-computer switching starting message, caching the received charging request message;
receiving a dual-computer switching success message sent by the pre-switching charging network element;
after receiving the dual-computer switching success message, sending the cached charging request message to a switched charging network element, so that the switched charging network element performs charging processing on the charging request message.
In a first possible implementation manner of the first aspect, the method further includes:
receiving a response message sent by the switched charging network element, wherein the response message is sent by the switched charging network element after charging processing is performed on the charging request message;
and deleting the charging request message corresponding to the cached response message.
With reference to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner, the method further includes:
after receiving the dual-computer switching start message sent by the pre-switching charging network element, if the dual-computer switching success message is not received within the threshold time range, ignoring the switching start message.
With reference to the second possible implementation manner of the first aspect, in a third possible implementation manner, the method further includes:
before the receiving of the dual-computer switching success message sent by the pre-switching charging network element, if the receiving of the dual-computer switching start message sent by the pre-switching charging network element is not received, the switching success message is ignored.
A second aspect of the present application provides a dual-computer switching method in a charging system, including:
sending a dual-machine switching start message to a message access adaptation network element when dual-machine switching starts, so that the message access adaptation network element caches the received charging request message after receiving the dual-machine switching start message;
and sending a dual-machine switching success message to a message access adaptation network element when the dual-machine switching is successful, so that the message access adaptation network element sends the cached charging request message to a switched charging network element after receiving the dual-machine switching success message, and the switched charging network element performs charging processing on the charging request message.
A third aspect of the present application provides a dual-computer switching method in a charging system, including:
receiving a charging request message sent by a message access adaptation network element, wherein the charging request message is the received charging request message cached by the message access adaptation network element after receiving a dual-machine switching start message sent by a charging network element before switching and before receiving a dual-machine switching success message sent by the charging network element before switching;
and carrying out charging processing on the charging request message, and returning a response message to the message access adaptation network element.
In a first possible implementation manner of the third aspect, the performing charging processing on the charging request message and returning a response message to the message access adaptation network element includes:
judging whether charging processing is carried out on the charging request message or not;
if the charging processing is not performed on the charging request message, the charging processing is performed on the charging request message, and a response message is returned to the message access adaptation network element, or,
and if the charging processing is carried out aiming at the charging request message, directly returning a response message to the message access adaptation network element.
With reference to the first possible implementation manner of the third aspect, in a second possible implementation manner, the determining whether charging processing has been performed on the charging request message includes:
if the service corresponding to the charging request message is a session type service, judging whether charging processing has been performed on the charging request message according to the session information of the session type service,
or, if the service corresponding to the charging request message is an event-type service, determining whether charging processing has been performed on the charging request message according to the identification information of the event-type service.
With reference to the second possible implementation manner of the third aspect, in a third possible implementation manner, the session information is synchronously copied with the balance information in a data copying process of the pre-handover charging network element and the post-handover charging network element.
A fourth aspect of the present application provides a network element device adapted for message access, including:
the receiving module is used for receiving a dual-computer switching starting message sent by the charging network element before switching;
the cache module caches the received charging request message sent by the charging request party after the receiving module receives the dual-computer switching start message;
the receiving module is further configured to receive a dual-computer handover success message sent by the pre-handover charging network element;
and the sending module is used for sending the cached charging request message to a switched charging network element after the receiving module receives the dual-computer switching success message, so that the switched charging network element performs charging processing according to the charging request message.
In a first possible implementation manner of the fourth aspect, the apparatus further includes a deletion module, wherein,
the receiving module is further configured to receive a response message sent by the post-handover charging network element, where the response message is sent by the post-handover charging network element after performing charging processing on the charging request message;
the deleting module is configured to delete the charging request message corresponding to the cached response message.
With reference to the fourth aspect or the first possible implementation manner of the fourth aspect, in a second possible implementation manner, the apparatus further includes a fault tolerance processing module, where,
the fault-tolerant processing module is configured to ignore the dual-computer handover start message when the receiving module does not receive the dual-computer handover success message within the threshold time range after receiving the dual-computer handover start message sent by the pre-handover charging network element.
With reference to the second possible implementation manner of the fourth aspect, in a third possible implementation manner, the method is characterized in that,
the fault-tolerant processing module is further configured to ignore the dual-computer handover success message when the receiving module receives the dual-computer handover success message when the receiving module does not receive the dual-computer handover start message before receiving the dual-computer handover success message sent by the pre-handover charging network element.
A fifth aspect of the present application provides a pre-handover charging network element device, including:
a first sending module, configured to send a dual-server handover start message to a message access adaptation network element when dual-server handover starts, so that the message access adaptation network element caches a received charging request message after receiving the dual-server handover start message;
and the second sending module is used for sending a dual-machine switching success message to a message access adaptation network element when the dual-machine switching is successful, so that the message access adaptation network element sends the cached charging request message to a switched charging network element after receiving the dual-machine switching success message, and the switched charging network element performs charging processing on the charging request message.
A sixth aspect of the present application provides a charging network element device after handover, including:
a receiving module, configured to receive a charging request message sent by a message access adaptive network element, where the charging request message is a received charging request message that is cached by the message access adaptive network element after receiving a dual-machine handover start message sent by a pre-handover charging network element and before receiving a dual-machine handover success message sent by the pre-handover charging network element;
and the charging processing module is used for performing charging processing on the charging request message sent by the receiving module and returning a response message to the message access adaptation network element.
In a first possible implementation manner of the sixth aspect, the charging processing module includes:
a judging subunit, configured to judge whether charging processing has been performed on the charging request message;
and an executing subunit, configured to perform charging processing on the charging request message and return the response message to the message access adaptation network element when the judging subunit judges that charging processing has not been performed on the charging request message, or directly return the response message to the message access adaptation network element when the judging subunit judges that charging processing has been performed on the charging request message.
With reference to the first possible implementation manner of the sixth aspect, in a second possible implementation manner, the determining subunit is specifically configured to, when the service corresponding to the charging request message is a session-type service, determine whether charging processing has been performed on the charging request message according to session information of the session-type service,
or, when the service corresponding to the charging request message is an event-type service, determining whether charging processing has been performed on the charging request message according to the identification information of the event-type service.
A seventh aspect of the present application provides a dual-machine handover system, which is characterized by including a message access adaptation network element device according to the fourth aspect or a possible implementation manner of the fourth aspect, a charging network element device according to the fifth aspect or a possible implementation manner of the fifth aspect, and a post-handover charging network element device according to the sixth aspect or a possible implementation manner of the sixth aspect.
In the process of dual-computer switching, after the switching is started, the message access adaptation network element caches all received charging request messages in the buffer, and after the switching is successful, the charging request messages are sent to the switched charging network element. Thus, the data replication of the charging request message between the host and the standby machine can adopt an asynchronous replication mode, and even if part of data is not yet urgently replicated to the charging network element after the charging network element before switching fails, the part of data which is not replicated can be cached in the cache of the message access adaptation network element. Therefore, the invention can effectively reduce the message loss in the double-computer switching process on the premise of not influencing the performance of the prior charging system, and furthest ensures the continuity of the service.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a structural diagram of a dual-machine charging system according to an embodiment of the present invention, and as shown in fig. 1, the dual-machine charging system includes a host charging network element, a standby charging network element, and a message access adaptation network element. Wherein:
the charging network elements (the host charging network element and the standby charging network element) comprise a charging processing logic module and a data storage module.
The charging processing logic module is used for receiving the charging request message from the message access adaptation network element, calling different charging processing logics according to different message types of the charging request message, carrying out charging processing, and returning a charging result to the message access adaptation network element after the charging processing is finished. The charging processing logic module is further configured to determine the charging request message, that is, determine whether corresponding charging processing has been performed on the charging request message, so as to avoid repeated charging processing performed on the same charging request message, which may cause repeated charging deduction.
The data storage module is used for storing session data (such as session information), charging-related data (such as balance information and charging request messages) and the like. Before the dual-computer switching, the data stored in the data storage module on the charging network element needs to be copied to the data storage module on the charging network element after the switching.
The message access adaptation network element is responsible for receiving the charging request message sent by the charging request party, performing primary processing after analyzing the message, and then forwarding the route to the charging network element for charging processing. The message access adaptation network element is also used for caching the charging request message.
The bus is disposed on each network element node, and the bus is a message transmission channel between the network element nodes.
A Service Control Point (SCP) or a Gateway General Packet Radio Service Node (GGSN) is a charging requester and is responsible for sending a charging request message to a message access adaptation network element.
In the charging system provided in this embodiment, in order to save cost, the charging processing logic modules in the message access adaptation network element and the charging network element may be combined on the same network node to form a network element device, as shown in fig. 2. In the charging system shown in fig. 2, the message access adaptation module has the same function as the message access adaptation network element in the charging system shown in fig. 1. Compared with the charging system shown in the embodiment of fig. 1, the charging system shown in the embodiment of fig. 2 switches the message access adaptation module and the charging processing logic module from the host charging network element to the standby charging network element when the two computers are switched.
Referring to fig. 3, fig. 3 is a flowchart of a dual-machine switching method in a charging system according to an embodiment of the present invention, where an execution main body of the embodiment may be a message access adaptive network element, and the dual-machine switching method in the charging system shown in fig. 3 includes:
101. receiving a dual-computer switching start message sent by a charging network element before switching.
The charging network element before switching sends a message of starting switching to the message access adaptation network element after the dual-computer switching starts, and the charging network element before switching can uniformly send the message of starting switching to the message access adaptation network element in the network in a broadcast manner through the bus, and can also respectively send the message of starting switching to each message access adaptation network element in the network.
In the charging system adopting the dual-machine redundancy mechanism, the charging network element comprises a host charging network element and a standby charging network element, the host charging network element is used for charging under normal conditions, and data and session data related to charging are backed up to the standby charging network element, when the host charging network element is in fault or other conditions that the charging can not be carried out temporarily, the standby charging network element takes over the host charging network element for charging, so that the charging continuity is ensured. For example, after the original host charging network element is switched to the original standby charging network element, the subsequent charging processing is performed by the original standby charging network element under normal conditions, the original standby charging network element becomes a new host charging network element, and the original host charging network element becomes a new standby charging network element. The charging network element before switching refers to a current host charging network element, and the current host charging network element is to be switched to a current standby charging network element.
102. After receiving the dual-computer switching start message, caching the received charging request message sent by the charging request party.
The charging requesting party may be an SCP or a GGSN.
Before the dual-computer switching, the charging network element receives the charging request message sent by the message access adaptation network element before the switching, and carries out charging processing aiming at the charging request message. When the charging network element before switching is in fault, the charging network element before switching sends a dual-computer switching start message to the message access adapting network element, and after the message access adapting network element receives the dual-computer switching start message, the received charging request message is not sent to the corresponding charging network element before switching, but is cached.
103. And receiving a dual-computer switching success message sent by the charging network element before switching.
The charging network element before switching may uniformly send a message of successful switching to the message access adaptation network element in the network in a broadcast manner through the bus, or may send a message of successful switching to each message access adaptation network element in the network, where the embodiment preferably sends the message in a broadcast manner.
104. After receiving the message of successful dual-computer switching, the cached charging request message is sent to the charging network element after switching, and the charging network element after switching performs charging processing according to the charging request message to complete dual-computer switching of the charging network element.
The specific processing procedure of the charging processing performed by the charging network element according to the charging request message after the switching refers to a common processing method in the current charging system.
And when the message access adaptation network element receives the charging request message sent by the charging network element, the message access adaptation network element caches the charging request message, and if the message access adaptation network element subsequently receives a response message sent by the charging network element, the message access adaptation network element deletes the charging request message corresponding to the response message. In order to ensure the reliability of the charging system, each message access adaptation network element is also configured with a standby message access adaptation network element, and messages stored in the message access adaptation network element need to be backed up to the standby message access adaptation network element.
In this embodiment, the message access adaptation network element may send the cached charging request message to the post-handover charging network element, so that all the cached charging request messages that have not received the response message may be sent to the post-handover charging network element.
After receiving the charging request message, the switched charging network element performs charging processing on the charging request message, and sends a response message after the charging processing, and the message access adaptation network element deletes the cached corresponding charging request message after receiving the response message.
Optionally, in consideration of fault tolerance processing, after receiving the dual-computer handover start message sent by the pre-handover charging network element, the message access adaptation network element ignores the handover start message if the dual-computer handover success message is not received within the threshold time range. Before receiving the dual-computer switching success message sent by the charging network element before switching, if the dual-computer switching start message sent by the charging network element before switching is not received, the switching success message is ignored.
The foregoing implementation manner of ignoring the handover start message may be: and deleting the switching start message, and not caching the received charging request message. The foregoing implementation manner of ignoring the handover success message may be: and directly deleting the successful switching message, and not sending the cached charging request message to the switched charging network element after receiving the successful switching message.
The message broadcast command format of the dual-computer handover start message and the dual-computer handover success message may be:
dual-computer switching start message: hastchnotify-start [ nondeid ] [ duration ]
Message of successful dual-computer switching: haswitch notify-finish [ nodeid ]
The node number of the charging processing logic node in the charging network element before or after switching is the node number of the charging processing logic node in the charging network element before or after switching, and the duration is the average switching duration of the two computers under normal conditions, and can be used as the threshold time.
In the case that the host charging network element does not fail, the host charging network element may also actively switch to the standby charging network element, and the dual-machine switching process in the active switching situation is the same as that in this embodiment.
In this embodiment, after the dual-computer handover starts, the message access adaptation network element caches all charging request messages sent by the charging requester in the buffer, and sends the charging request messages to the post-handover charging network element after the handover is successful. When the charging network element before switching is in fault, even if part of data is not copied to the charging network element after switching, the part of data which is not copied can be cached in the cache of the message access adapting network element. Therefore, the embodiment can effectively reduce the message loss in the dual-computer switching process on the premise of not influencing the performance of the existing charging system, and furthest ensures the continuity of the service.
Referring to fig. 4, fig. 4 is a flowchart of a dual-machine handover method in a charging system according to an embodiment of the present invention, where the embodiment describes a scheme of the present invention from a charging network element side after handover, and the method includes:
201. receiving a charging request message sent by a message access adaptation network element, wherein the charging request message is cached and received by the message access adaptation network element after receiving a dual-machine switching start message sent by a charging network element before switching and before receiving a dual-machine switching success message sent by the charging network element before switching.
202. And charging processing is carried out aiming at the charging request message, and a response message is returned to the message access adaptation network element so as to complete the double-machine switching of the charging network element.
When the charging network element performs charging processing on a certain charging request message before switching and does not send a corresponding response message to the message access adaptation network element, the message access adaptation network element may send the charging request message which has been subjected to charging processing to the switched charging network element again after the dual-computer switching is successful, and if the charging network element performs charging processing on the charging request message again after switching, the situation of repeated fee deduction may occur.
To avoid the above problem, optionally, after the charging network element receives the charging request message after the switching, the charging request message is determined to be repeated, the charging request message that has not been processed is processed, a response message is returned, and a response message is directly constructed for the processed message, which specifically includes:
judging whether charging processing is performed on the charging request message or not;
if the charging processing is not performed on the charging request message, the charging processing is performed according to the charging request message, and the response message is returned to the message access adaptation network element, or if the charging processing is performed on the charging request message, the response message is directly returned to the message access adaptation network element.
Optionally, the manner of determining whether the charging processing has been performed on the charging request message may be:
if the service corresponding to the charging request message is a session service, such as a voice service, a data service (internet access), etc., it is determined whether the charging request message has been subjected to charging processing according to the session information of the session service. After processing the charging request message corresponding to the session type service, the session information of the session type service is stored in a data storage module in the charging network element, and the session information includes a message sequence number. When the switched charging network element judges the session type service repeatedly, whether the message sequence number of the current session type service is stored in the data storage module is inquired, and whether the charging processing is carried out aiming at the current charging request message can be judged. In the process of copying data from a host charging network element to a standby charging network element, session information and balance information of a session type service are not copied as the same transaction at the same time, so that the problem of repeated fee deduction or missed fee deduction due to the fact that the session information and the balance information are not synchronously copied to the standby charging network element can occur. In the embodiment, the session information and the balance information are bound into the same transaction to be copied, so that repeated deduction or deduction omission caused by non-correspondence between the session information and the balance information is avoided.
Or if the service corresponding to the charging request message is an event-type service, such as a short message service, determining whether the charging request message has been charged according to the identification information. After the charging request message corresponding to the event type service is subjected to corresponding charging processing, the session information of the event type service is not stored in a data storage module in the charging network element, but is deleted. In this embodiment, the determination of the duplicate is implemented by adding identification information of the event type service, where the identification information of the event type service may be a session identification (Sessionid), a message number (msgnumber), a timeout time, and the like, and is used to identify a charging request message corresponding to the processed event type service. And the charging network element stores the identification information before switching and backups the identification information to the charging network element after switching. When the charging network element judges the event type service again after switching, whether the identification information such as the Sessionid and/or the msgnumber and/or the timeout time of the event type service corresponding to the charging request message requesting the charging processing currently is stored in the data storage module or not is inquired, and whether the charging processing is carried out aiming at the charging request message requesting the charging processing currently can be judged.
In this embodiment, after the switching, the charging network element determines the charging request message repeatedly before performing corresponding charging processing on the charging request message, so that situations of repeated charging processing on the same charging request message, repeated fee deduction and the like can be avoided, and the reliability of the charging system is further improved.
Referring to fig. 5, fig. 5 is a flowchart of a dual-machine handover method in a charging system according to another embodiment of the present invention, where the method includes:
301. SCP/GGSN sends charging request message to message access adaptive network element.
The SCP/GGSN has charging information collecting function, and can collect charging information related to each practical external data network and GPRS network resource, and the SCP/GGSN in the network is charging request party.
302. And the message access adaptation network element sends the charging request message to the host charging network element.
303. And the host charging network element performs charging processing according to the received charging request message.
304. And the host charging network element sends the charging result and the response message to the message access adaptation network element.
305. And the message access adaptation network element sends a charging response message to the SCP/GGSN according to the charging result.
306. The host charging network element copies the session data and charging related data to the standby charging network element.
The host charging network element copies the session data and the charging related data to the standby charging network element, and the standby charging network element backs up the data, so that when the host charging network element needs to be switched to the standby charging network element, the standby charging network element can perform corresponding charging processing according to the backed-up data.
The data replication between the host computer charging network element and the standby computer charging network element is asynchronous replication, and the performance of the system is slightly influenced by adopting the asynchronous replication.
307. When the dual-computer switching starts, the host charging network element sends a dual-computer switching starting message to the message access adapting network element.
The host charging network element sends a message of starting switching to the message access adaptation network element after the dual-computer switching is started, and the host charging network element can uniformly send the message of starting switching to the message access adaptation network element in the network in a broadcast manner through the bus, and can also respectively send the message of starting switching to each message access adaptation network element in the network.
308. SCP/GGSN sends charging request message to message access adaptive network element.
309. And the message access adaptation network element caches the received charging request message.
After receiving the dual-computer switching start message, the message receiving adaptive network element does not send the received charging request message to the host charging network element, but caches the message.
310. And when the double-machine switching is finished, the host charging network element sends a successful double-machine switching message to the message access adapting network element.
The host charging network element may uniformly send the message of successful switching to the message access adaptation network element in the network in a broadcast manner through the bus, or may send the message of successful switching to each message access adaptation network element in the network, where the embodiment preferably sends the message of successful switching in a broadcast manner.
311. And the message access adaptation network element sends the cached charging request message to the standby charging network element after receiving the dual-computer switching success message.
312. And the standby charging network element judges the charging request message again and performs charging processing on the unprocessed charging request message.
The specific method for the standby charging network element to determine the duplicate of the charging request message refers to the embodiment in fig. 3, which is not described herein again.
313. And the standby charging network element sends the charging result and the response message to the message access adaptation network element.
314. And the message access adaptation network element sends a charging response message to the SCP/GGSN according to the charging result.
Optionally, in consideration of fault tolerance processing, after receiving the dual-computer handover start message sent by the pre-handover charging network element, the message access adaptation network element ignores the handover start message if the dual-computer handover success message is not received within the threshold time range. Before receiving the dual-computer switching success message sent by the charging network element before switching, if the dual-computer switching start message sent by the charging network element before switching is not received, the switching success message is ignored. The specific implementation of the fault tolerance processing is not described herein with reference to the embodiment of fig. 1.
In the dual-computer switching process, all charging request messages sent by the charging request party are cached in the buffer, and after the switching is successful, the charging request messages are sent to the charging network element after the switching. Thus, the data replication between the host charging network element and the standby charging network element can adopt an asynchronous replication mode, and even if part of data is not yet replicated to the charging network element after the charging network element before switching fails, the part of data which is not replicated can be cached in the cache of the message access adaptation network element. Therefore, the embodiment can effectively reduce the message loss in the dual-computer switching process on the premise of not influencing the performance of the existing charging system, and furthest ensures the continuity of the service.
Referring to fig. 6, fig. 6 is a structural diagram of a network element device adapted for message access according to an embodiment of the present invention, including a receiving module 401, a caching module 402, and a sending module 403, where,
a receiving module 401, configured to receive a dual-machine handover start message sent by a charging network element before handover.
The caching module 402 caches the received charging request message sent by the charging requester after the receiving module 401 receives the dual-server switching start message.
The receiving module 401 is further configured to receive a dual-computer handover success message sent by the charging network element before handover.
A sending module 403, configured to send the cached charging request message to the post-switching charging network element after the dual-computer handover success message received by the receiving module 401 is received, so that the post-switching charging network element performs charging processing according to the charging request message, so as to complete dual-computer handover from the pre-switching charging network element to the post-switching charging network element.
Optionally, the message access adaptation network element device may further include a deletion module 404, as shown in fig. 7. Wherein,
the receiving module 401 is further configured to receive a response message sent by the charging network element after the handover, where the response message is sent by the charging network element after the handover performs charging processing according to the charging request message.
The deleting module 404 is configured to delete the charging request message corresponding to the cached response message.
Optionally, the message access adaptation network element device may further include a fault tolerance processing module 405, as shown in fig. 8. Wherein,
the fault tolerance processing module 405 is configured to ignore the dual-computer handover start message when the receiving module 401 receives the dual-computer handover start message sent by the pre-handover charging network element and does not receive a successful dual-computer handover message within a threshold time range.
The fault tolerance processing module 405 is further configured to ignore the dual-computer handover success message when the receiving module 401 receives the dual-computer handover success message sent by the pre-handover charging network element, if the dual-computer handover start message is not received before the receiving module 401 receives the dual-computer handover success message.
The specific manner in which the fault-tolerant processing module 405 ignores the dual-computer switching start message and the dual-computer switching success message is not described herein with reference to the embodiment of fig. 3.
In this embodiment, the message access adaptive network element device caches all received charging request messages in the buffer during the dual-computer switching process, and sends the charging request messages to the switched charging network element after the switching is successful. Therefore, the data replication between the host and the standby machine can adopt an asynchronous replication mode, and even if part of data is not yet urgently replicated to the charging network element after the charging network element before switching fails, the part of data which is not replicated can be cached in the cache of the message access adaptation network element. Therefore, the embodiment can effectively reduce the message loss in the dual-computer switching process on the premise of not influencing the performance of the existing charging system, and furthest ensures the continuity of the service.
Referring to fig. 9, fig. 9 is a block diagram of a message access adapting network element device according to an embodiment of the present invention, including a memory 501 and a processor 502, where the memory 501 stores a set of program codes, and the processor 502 is configured to call the program codes stored in the memory 501, and perform the following operations:
receiving a dual-computer switching starting message sent by a charging network element before switching;
after receiving the dual-computer switching start message, caching the received charging request message sent by the charging request party;
receiving a dual-computer switching success message sent by a charging network element before switching;
after receiving the message of successful dual-computer switching, the cached charging request message is sent to the charging network element after switching, and the charging network element after switching performs charging processing according to the charging request message.
Optionally, the processor 502 is further configured to perform the following operations:
receiving a response message sent by the switched charging network element, wherein the response message is sent by the switched charging network element after charging processing is carried out according to the charging request message;
and deleting the charging request message corresponding to the cached response message.
Considering fault tolerance processing, the processor 502 is further configured to:
after receiving the dual-computer switching starting message sent by the charging network element before switching, if the dual-computer switching success message is not received within the threshold time range, ignoring the switching starting message.
Before receiving the dual-computer switching success message sent by the charging network element before switching, if the dual-computer switching start message sent by the charging network element before switching is not received, ignoring the switching success message when receiving the dual-computer switching success message.
The detailed work flow of the message access adaptation network element refers to the description in the foregoing method embodiment, and is not repeated here.
In this embodiment, the message access adaptive network element device caches all received charging request messages in the buffer during the dual-computer switching process, and sends the charging request messages to the switched charging network element after the switching is successful. Therefore, the data replication between the host and the standby machine can adopt an asynchronous replication mode, and even if part of data is not yet urgently replicated to the charging network element after the charging network element before switching fails, the part of data which is not replicated can be cached in the cache of the message access adaptation network element. Therefore, the embodiment can effectively reduce the message loss in the dual-computer switching process on the premise of not influencing the performance of the existing charging system, and furthest ensures the continuity of the service.
Referring to fig. 10, fig. 10 is a structural diagram of a pre-handover charging network element device according to an embodiment of the present invention, including a first sending module 601 and a second sending module 602, where:
the first sending module 601 is configured to send a dual-server handover start message to the message access adaptation network element when the dual-server handover starts, so that the message access adaptation network element caches the received charging request message after receiving the dual-server handover start message.
A second sending module 602, configured to send a dual-server handover success message to the message access adapter network element when the dual-server handover is successful, so that the message access adapter network element sends the cached charging request message to the post-handover charging network element after receiving the dual-server handover success message, and the post-handover charging network element performs charging processing according to the charging request message, so as to complete dual-server handover from the pre-handover charging network element to the post-handover charging network element.
In this embodiment, the pre-handover charging network element device sends the dual-machine handover start message and the dual-machine handover success message to the message access adaptation network element device, so that the message access adaptation network element device caches the charging request message received in the dual-machine handover process, and sends the cached charging request message which is not subjected to the charging processing to the post-handover charging network element after the pre-handover charging network element is successfully handed over to the standby handover network element. Through the embodiment, the data replication between the host and the standby machine can adopt an asynchronous replication mode, and even if part of the data of the charging request message is not yet copied to the charging network element after the charging network element before switching fails, the part of the data which is not copied can be cached in the cache of the message access adaptation network element and is sent to the standby machine after the switching is successful. Therefore, the embodiment can effectively reduce the message loss in the dual-computer switching process on the premise of not influencing the performance of the existing charging system, and furthest ensures the continuity of the service.
Referring to fig. 11, fig. 11 is a block diagram of a pre-handover charging network element device according to an embodiment of the present invention, which includes a memory 701 and a processor 702, where the memory 701 stores a set of program codes, and the processor 702 is configured to call the program codes stored in the memory 701, so as to perform the following operations:
sending a dual-machine switching starting message to a message access adaptation network element when dual-machine switching is started, so that the message access adaptation network element caches the received charging request message after receiving the dual-machine switching starting message;
and sending a dual-machine switching success message to the message access adaptation network element when the dual-machine switching is successful, so that the message access adaptation network element sends the charging request message cached in the cache to the switched charging network element after receiving the dual-machine switching success message, and the switched charging network element performs charging processing on the charging request message so as to complete dual-machine switching from the pre-switching charging network element to the switched charging network element.
In this embodiment, the pre-handover charging network element device sends the dual-machine handover start message and the dual-machine handover success message to the message access adaptation network element device, so that the message access adaptation network element device caches the charging request message received in the dual-machine handover process, and sends the cached charging request message which is not subjected to the charging processing to the post-handover charging network element after the pre-handover charging network element is successfully handed over to the standby handover network element. Through the embodiment, the data replication between the host and the standby machine can adopt an asynchronous replication mode, and even if part of the data of the charging request message is not yet copied to the charging network element after the charging network element before switching fails, the part of the data which is not copied can be cached in the cache of the message access adaptation network element and is sent to the standby machine after the switching is successful. Therefore, the embodiment can effectively reduce the message loss in the dual-computer switching process on the premise of not influencing the performance of the existing charging system, and furthest ensures the continuity of the service.
Referring to fig. 12, fig. 12 is a structural diagram of a post-handover charging network element device according to an embodiment of the present invention, including a receiving module 801 and a charging processing module 802, wherein,
a receiving module 801, configured to receive a charging request message sent by a message access adaptive network element, where the charging request message is a received charging request message that is cached by the message access adaptive network element after receiving a dual-machine handover start message sent by a pre-handover charging network element and before receiving a dual-machine handover success message sent by the pre-handover charging network element.
The charging processing module 802 is configured to perform charging processing on the charging request message sent by the receiving module, and return a response message to the message access adaptation network element to complete dual-computer switching from the pre-switching charging network element to the post-switching charging network element.
The charging processing module 802 may further include a determining subunit 8021 and an executing subunit 8022, as shown in fig. 13.
A judging subunit 8021, configured to judge whether charging processing has been performed on the charging request message.
The execution subunit 8022 is configured to, when the judging subunit 8021 judges that the charging processing has not been performed on the charging request message, perform the charging processing according to the charging request message, and return a response message to the message access adaptation network element, or, when the judging subunit 8021 judges that the charging processing has been performed on the charging request message, directly return a response message to the message access adaptation network element according to a processing result, so as to complete the dual-computer switching from the charging network element before switching to the charging network element after switching.
The judging subunit 8021 is specifically configured to:
when the service corresponding to the charging request message is a session service, whether charging processing has been performed on the charging request message is judged according to the session information of the session service, or
And when the service corresponding to the charging request message is an event-type service, judging whether the charging processing is carried out aiming at the charging request message or not according to the identification information of the event-type service.
For the specific working process of the judging subunit 8021, reference may be made to the above method embodiment, which is not described herein again.
In this embodiment, the charging network element device after the handover caches all charging request messages sent by the charging requester in the cache during the dual-computer handover, and sends the charging request messages to the charging network element after the handover is successful. Thus, the data replication of the charging request message before the charging network element equipment before switching and the charging network element equipment after switching can adopt an asynchronous replication mode, and when the host fails, even if part of data is not yet copied to the standby machine, the part of data which is not replicated can be cached in the cache of the message access adaptation network element. Therefore, the embodiment can effectively reduce the message loss in the dual-computer switching process on the premise of not influencing the performance of the existing charging system, and furthest ensures the continuity of the service.
Referring to fig. 14, fig. 14 is a structural diagram of a post-handover charging network element device according to an embodiment of the present invention, including a memory 901 and a processor 902, where the memory 901 stores a set of program codes, and the processor 902 is configured to call the program codes stored in the memory 901, so as to perform the following operations:
receiving a charging request message sent by a message access adaptation network element, wherein the charging request message is sent by the message access adaptation network element after receiving a dual-machine switching start message sent by a charging network element before switching, storing the received charging request message in a buffer, and after receiving a dual-machine switching success message sent by the charging network element before switching, the message access adaptation network element;
and performing charging processing according to the charging request message, and returning a response message to the message access adaptation network element to complete the dual-computer switching from the charging network element before switching to the charging network element after switching.
The specific way for the processor 902 to perform charging processing according to the charging request message and return a response message to the message access adaptation network element may be:
it is determined whether charging processing has been performed for the charging request message.
If the charging processing is not performed on the charging request message, the charging processing is performed according to the charging request message, and a response message is returned to the message access adaptation network element, or the charging processing is performed on the charging request message, the response message is directly returned to the message access adaptation network element, so that the dual-machine switching from the charging network element before switching to the charging network element after switching is completed.
The specific way for the processor 902 to execute the operation of determining whether to perform the charging processing for the charging request message may be:
if the service corresponding to the charging request message is a session service, determining whether charging processing has been performed on the charging request message according to session information of the session service, or
If the service corresponding to the charging request message is an event-type service, whether charging processing has been performed on the charging request message is judged according to the identification information of the event-type service.
The detailed working flow of the charging network element after handover refers to the description in the foregoing method embodiment, and is not repeated here.
In this embodiment, the charging network element device after the handover caches all charging request messages sent by the charging requester in the cache during the dual-computer handover, and sends the charging request messages to the charging network element after the handover is successful. Thus, the data replication of the charging request message before the charging network element equipment before switching and the charging network element equipment after switching can adopt an asynchronous replication mode, and when the host fails, even if part of data is not yet copied to the standby machine, the part of data which is not replicated can be cached in the cache of the message access adaptation network element. Therefore, the embodiment can effectively reduce the message loss in the dual-computer switching process on the premise of not influencing the performance of the existing charging system, and furthest ensures the continuity of the service.
Referring to fig. 15, fig. 15 is a schematic diagram of a dual-machine handover system according to an embodiment of the present invention, which includes a message access adaptation network element device 1001 according to any one of fig. 6 to fig. 8, a charging network element device 1002 before handover according to an embodiment of fig. 10, and a charging network element device 1003 after handover according to an embodiment of fig. 12 or fig. 13, where:
the message access adaptive network element device 1001 is configured to receive a dual-machine handover start message and a dual-machine handover success message sent by the pre-handover charging network element 1002, and cache a charging request message sent by a charging requester after receiving the dual-machine handover start message, and send the cached charging request message to the post-handover charging network element device 1003 when receiving the dual-machine handover success message.
The pre-handover charging network element device 1002 is configured to send a dual-machine handover start message to the message access adapter network element 1001 device when dual-machine handover starts, and send a dual-machine handover success message to the message access adapter network element 1001 device when dual-machine handover succeeds.
The post-switching charging network element device 1003 is configured to receive a charging request message sent by the message access adaptation network element device 1001, perform charging processing according to the charging request message, and return a response message to the message access adaptation network element device 1001, so as to complete dual-machine switching from the pre-switching charging network element device to the post-switching charging network element device.
In this embodiment, in the dual-computer switching process, after the switching starts, the message access adaptation network element device caches all received charging request messages in the buffer, and after the switching succeeds, the charging request messages are sent to the switched charging network element device. In this way, the data replication of the charging request message between the charging network element equipment before switching and the charging network element equipment after switching can adopt an asynchronous replication mode, and when the charging network element equipment before switching fails, even if part of the data is not already replicated to the charging network element equipment after switching, the part of the data which is not replicated can be cached in the cache of the message access adaptation network element equipment. Therefore, the invention can effectively reduce the message loss in the double-computer switching process on the premise of not influencing the performance of the prior charging system, and furthest ensures the continuity of the service.
Referring to fig. 16, fig. 16 is a schematic diagram of a dual-machine handover system according to an embodiment of the present invention, which includes a message access adaptation network element device 1101 according to the embodiment of fig. 9, a pre-handover charging network element device 1102 according to the embodiment of fig. 11, and a post-handover charging network element device 1103 according to the embodiment of fig. 14, where:
the message access adaptive network element device 1101 is configured to receive a dual-machine switching start message and a dual-machine switching success message sent by the pre-switching charging network element 1102, cache a received charging request message sent by a charging requester after receiving the dual-machine switching start message, and send the cached charging request message to the post-switching charging network element device 1103 when receiving the dual-machine switching success message.
The pre-handover charging network element device 1102 is configured to send a dual-machine handover start message to the message access adaptation network element 1101 device when dual-machine handover starts, and send a dual-machine handover success message to the message access adaptation network element 1101 device when dual-machine handover succeeds.
The post-switching charging network element device 1103 is configured to receive a charging request message sent by the message access adaptation network element device 1101, perform charging processing according to the charging request message, and return a response message to the message access adaptation network element device 1101, so as to complete dual-computer switching from the pre-switching charging network element device to the post-switching charging network element device.
In this embodiment, in the dual-computer switching process, after the switching starts, the message access adaptation network element device caches all received charging request messages in the buffer, and after the switching succeeds, the charging request messages are sent to the switched charging network element device. In this way, the data replication of the charging request message between the charging network element equipment before switching and the charging network element equipment after switching can adopt an asynchronous replication mode, and when the charging network element equipment before switching fails, even if part of the data is not already replicated to the charging network element equipment after switching, the part of the data which is not replicated can be cached in the cache of the message access adaptation network element equipment. Therefore, the invention can effectively reduce the message loss in the double-computer switching process on the premise of not influencing the performance of the prior charging system, and furthest ensures the continuity of the service.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.