Disclosure of Invention
Embodiments of the present invention provide a method and an apparatus for processing a voice mailbox service, which can still provide a voice mailbox service for a user when a database fails, thereby improving serviceability of a system.
In order to achieve the above purpose, the embodiment of the invention adopts the following technical scheme:
a method of processing voice mailbox traffic, comprising:
receiving a voice message request of a calling user, and inquiring the current service state of a database server;
if the database server is in a fault state, prompting the calling user to leave a message and generate a message file through a call access device, and sending a naming rule of the message file to the call access device, so that the call access device can store the message file in a directory set for a called user in a file server, and naming the message file according to the naming rule, wherein the naming rule comprises: naming the message file by adopting at least one of message related information;
receiving a voice message extraction request of the called user, and inquiring the current service state of a database server;
if the database server is in a fault state, extracting the message leaving file from a directory set for the called user in the file server;
analyzing the file name of the message leaving file to obtain message leaving related information of the message leaving file;
and playing the message file according to the message related information.
An apparatus for processing voicemail service, comprising:
a receiving unit, configured to receive a message request of a calling subscriber or a message extraction request of a called subscriber;
the query unit is used for querying the current service state of the database server when the message request or the message extraction request is received;
a first processing unit, configured to, when a message request is received and the database server is in a failure state, prompt the calling user to leave a message and generate a message file through a call access device, and send a naming rule of the message file to the call access device, so that the call access device stores the message file in a directory set for a called user in a file server and names the message file according to the naming rule, where the naming rule includes: naming the message file by adopting at least one of message related information;
the second processing unit is used for extracting the message file from a directory set for the called user in a file server when the message extraction request is received and the database server is in a fault state;
the analysis unit is used for analyzing the file name of the message file extracted by the second processing unit to obtain message related information of the message file;
and the playing unit is used for playing the message file extracted by the second processing unit according to the message related information analyzed by the analyzing unit.
The method and the device for processing the voice mailbox service provided by the embodiment of the invention firstly inquire the current state of the database server, when the database server fails, the message related information of a calling user is stored through the message filename, and the message related information is acquired by a called user through the message filename without storing and inquiring through the database server, so that the operations of leaving messages and extracting messages are independent of the database server. The method and the device for processing the voice mailbox service provided by the embodiment of the invention can still provide the voice mailbox service for the user under the condition that the database fails, thereby improving the serviceability of the system.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, 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 some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without inventive effort based on the embodiments of the present invention, are within the scope of the present invention.
In order to solve the problem of reduced system serviceability caused by the dependence on a database server in the prior art, embodiments of the present invention provide a method and an apparatus for processing a voice mailbox service.
As shown in fig. 1, a method for processing a voice mailbox service provided in an embodiment of the present invention includes:
step 101, receiving a voice message request of a calling user;
in the embodiment of the invention, a user terminal A calls a user terminal B, wherein the user terminal A is a calling user and the user terminal B is a called user. When the user terminal B is unable to connect (such as no answer for a long time, power off, out of service area), the communication network will transfer the call of the user a to the voice mailbox system. The voice mailbox system can comprise call access equipment, a voice mailbox server, a file server and a database service area, wherein the call access equipment is equipment for interaction between the voice mailbox system and a communication network; the voice mailbox server is a logic server for processing voice mailbox service; the file server is used for storing the voice message files of the user; the database server is used for storing relevant information (such as message leaving time, calling number, message serial number, message reading state and the like) of the voice messages of the users, and performing work such as report statistics and the like. After the communication network transfers the call of the user A to the voice mailbox system, the call access device requests the voice mailbox server to perform service processing, and specifically, the call access device sends a voice message request of a calling user to the voice mailbox server, so that the voice mailbox server provides a voice message service for the user B.
Step 102, inquiring the current service state of a database server;
in the embodiment of the invention, the service state of the database server is set in the voice mailbox server: a normal state or a fault state. The voice mailbox server may periodically initiate a heartbeat connection to the database server to determine the current service state of the database server. If the heartbeat connection between the voice mailbox server and the database server is normal, the state of the database server is set to be a normal state; when the database server is abnormal, the voice mailbox server finds that the heartbeat connection between the voice mailbox server and the database server is disconnected, the state of the database server is set to be a fault state, and the subsequent voice mailbox service is processed according to the processing mode that the database server is in the fault state before the database server recovers to the normal state. Therefore, after receiving the voice message request of the calling user, the voice mailbox server firstly queries the state of the database server, and adopts different processing modes when the voice mailbox server is in different states.
Step 103, if the database server is in a fault state, the calling user is prompted to leave a message and generate a message file through the call access equipment, and the naming rule of the message file is sent to the call access equipment so that the call access equipment can store the message file in a directory set for the called user in a file server, and the message file is named according to the naming rule. It can be understood that, in the embodiment of the present invention, the directory set by the called user is used for storing the message file saved for the called user in the fault state. In addition, the path of the directory may also include the called subscriber number.
In the embodiment of the invention, when the database server is abnormal, the voice mailbox server sends the naming rule of the message file to the call access equipment, and the naming rule of the message file can be used for naming the message file by adopting at least one of the message related information; the message related information may include: the serial number of the message, the number of the calling user, the message leaving time and the reading state of the message document. For example, the message file may be named in a manner of "serial number of message + calling number + message time + read status", where the read status is used to identify whether the message is read or unread. And the call access equipment prompts the terminal user A to leave a message and generates a message file according to the message of the user A.
Further, the embodiment of the present invention may further include the following steps:
and step 104, the call access equipment receives the file naming rule, stores the message leaving file into a directory set for the called user in a file server, and names the message leaving file according to the file naming rule. It can be understood that, in the embodiment of the present invention, the directory set by the called user is used for storing the message file saved for the called user in the fault state. Specifically, in the embodiment of the present invention, the path of the directory may include a called party number, and the directory structure may be designed as "\ DB _ Error _ MSG \ called party number" as a query path when the called party calls to extract a message. After the message file is successfully stored, the voice mailbox server prompts the user A that the message is successfully left through the call access equipment.
The method for processing the voice mailbox service provided by the embodiment of the invention firstly queries the current state of the database server, and when the database server fails, the message related information is stored by the message filename without being stored in the database server, so that the message operation is independent of the database server. The method for processing the voice mailbox service provided by the embodiment of the invention can still provide the message leaving service for the user under the condition that the database fails, thereby improving the serviceability of the system.
As shown in fig. 2, a method for processing a voicemail service according to another embodiment of the present invention includes:
step 201, receiving a voice message extraction request of a called user;
in the embodiment of the invention, when the called user picks up the voice message by calling through the user terminal B, the communication network switches the call of the user B to the voice mailbox system, and the call access equipment in the voice mailbox system initiates a voice mailbox service request to the voice mailbox server.
Step 202, inquiring the current service state of a database server;
in the embodiment of the present invention, the service state of the database server is set in the voice mailbox server, and the specific implementation is the same as that in the previous embodiment, and is not described again. After receiving the voice mail service request of the called user, the voice mail server firstly inquires the state of the database server, and different processing modes are adopted when the voice mail server is in different states.
Step 203, if the database server is in a fault state, extracting a message leaving file from a directory set for the called user in a file server; the directory set by the called user is used for storing the message files saved for the called user in the fault state. Specifically, in the embodiment of the present invention, when the database server fails, the voice mailbox server extracts the message file when the database server is in a failed state from the "\ DB _ Error _ MSG \ called subscriber number" directory of the file server.
Step 204, analyzing the file name of the message file, and acquiring message related information of the message file;
in the embodiment of the invention, the voice mailbox server can acquire the message related information such as the serial number of the message, the number of the calling party (namely the number of the message person), the message leaving time, the reading state of the message file (namely whether the message file is read) and the like through the file name of the message file.
And step 205, playing the message file according to the message related information.
Alternatively, in step 203, if the current state of the database server is a normal state, the message-leaving-related information may be obtained from the database server or the file server, and the message file may be extracted from the file server.
Specifically, a database server may be queried first, and when the message-leaving related information related to the called user is not stored on the database server, a message-leaving file is extracted from a directory set by the called user of a file server; and performs the above steps 204 and 205. The directory set for the called user is used for storing the message files saved for the called user in the fault state. It can be understood that the message-leaving related information related to the called party is not queried when the database server is queried, which indicates that the database server may have a fault when the calling party leaves a message, and therefore, the message-leaving file is extracted from the directory set for the called party in the file server instead. If the relevant message information related to the called party is inquired in the database server, the database server is normal when the calling party leaves a message, so that the message leaving service can be realized by the prior technical scheme.
In the embodiment of the invention, the voice mailbox server can play the message leaving files in sequence according to the serial number, the message leaving time and the like of the message leaving, or inform the called user B of the message leaving related information, and the user B selects the message leaving files to play. For example, the user B may select an unread message file to play. Further, after the user B finishes playing the message file, the voice mailbox server may detect that the designated playing key of the user terminal is enabled, so as to know that the message file has been read by the user. At this time, the status of the message file may be modified to "read".
In a specific scenario, an embodiment of the present invention may further provide a method for processing a mailbox service, including the specific processing procedures of the two embodiments. Specifically, in the process of calling the called party by the calling party, if the called party cannot be connected (for example, the called party does not answer for a long time, is powered off, and is not in the service area), the message leaving operation can be completed through the embodiment related to fig. 1. The voice mailbox system notifies the called user of the voice message, and the specific notification process can refer to the prior art, which is not described herein again. When the called user requests to extract the voice message, the called user can complete the message extraction operation through the embodiment related to fig. 2.
The method for processing the voice mailbox service provided by the embodiment of the invention firstly queries the current state of the database server, and when the database server fails, the called user acquires the message related information by the message filename without querying through the database server, so that the operation of extracting the message is independent of the database server. The method for processing the voice mailbox service provided by the embodiment of the invention can still provide the service of extracting the message for the user under the condition that the database fails, thereby improving the serviceability of the system.
As shown in fig. 3, the apparatus for processing a voice mailbox service according to an embodiment of the present invention includes:
the receiving unit 301 is configured to receive a message request of a calling party or a message extraction request of a called party;
the query unit 302 is configured to query a current service state of the database server when the message request or the message extraction request is received;
the first processing unit 303 is configured to, when a message request is received and the database server is in a failure state, prompt the calling user to leave a message and generate a message file through a call access device, and send a naming rule of the message file to the call access device, so that the call access device stores the message file in a directory set for a called user in a file server and names the message file according to the naming rule, where the naming rule includes: naming the message file by adopting at least one of message related information;
a second processing unit 304, configured to, when a message extraction request is received and the database server is in a failure state, extract a message file from a directory set for the called subscriber in a file server;
the parsing unit 305 is configured to parse the filename of the message file extracted by the second processing unit, so as to obtain message related information of the message file;
the playing unit 306 is configured to play the message file extracted by the second processing unit according to the message related information analyzed by the analyzing unit.
Further, (not shown) the apparatus further comprises: and a third processing unit.
The third processing unit is used for firstly inquiring the database server when a message extraction request is received and the database server is in a normal state, and extracting a message file from a directory set for the called user in the file server when the message related information related to the called user is not stored in the database server.
Further, as shown in fig. 4, the apparatus further includes: a connection unit 308 and a setting unit 309.
A connection unit 308, configured to periodically initiate a heartbeat connection to the database server;
a setting unit 309, configured to set the current service state of the database server to a failure state when the heartbeat connection is disconnected.
The device for processing the voice mailbox service provided by the embodiment of the invention firstly queries the current state of the database server, and when the database server fails, the message related information of the calling subscriber is stored by the message filename without being stored in the database server, so that the message leaving operation is independent of the database server. The device for processing the voice mailbox service provided by the embodiment of the invention can still provide message leaving service for the user under the condition that the database fails, thereby improving the serviceability of the system.
Further, as shown in fig. 5, the playing unit 306 includes:
a first playing subunit 3061, configured to play the message files in order according to the message related information analyzed by the analyzing unit 305; or,
a second playing subunit 3062, configured to select the message file needed by the called user according to the message related information analyzed by the analyzing unit 305, and play the message file.
Specifically, the message related information includes: reading state of serial number of message, calling user number, message leaving time or message leaving file, the reading state includes: unread or read. The playing unit 306 may play the message file according to the serial number of the message file. Or the message file can be played according to the reading state of the message file. The specific playing form is not limited.
The device for processing the voice mailbox service provided by the embodiment of the invention firstly queries the current state of the database server, and when the database server fails, the called user acquires the message related information by the message filename without querying through the database server, so that the operation of extracting the message is independent of the database server. The device for processing the voice mailbox service provided by the embodiment of the invention can still provide the service of extracting the message for the user under the condition that the database fails, thereby improving the serviceability of the system.
The technical scheme provided by the invention can be applied to the voice mailbox service of the mobile terminal user.
It will be understood by those skilled in the art that all or part of the steps in the method for implementing the above embodiments may be implemented by relevant hardware instructed by a program, and the program may be stored in a computer-readable storage medium, such as ROM/RAM, a magnetic or optical disk, etc.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.