CN115658341A - Method, device, equipment and medium for reading and writing data by Freeswitch - Google Patents

Method, device, equipment and medium for reading and writing data by Freeswitch Download PDF

Info

Publication number
CN115658341A
CN115658341A CN202211301782.3A CN202211301782A CN115658341A CN 115658341 A CN115658341 A CN 115658341A CN 202211301782 A CN202211301782 A CN 202211301782A CN 115658341 A CN115658341 A CN 115658341A
Authority
CN
China
Prior art keywords
freeswitch
data
write
read
redis
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211301782.3A
Other languages
Chinese (zh)
Inventor
史强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Si Tech Information Technology Co Ltd
Original Assignee
Beijing Si Tech Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Si Tech Information Technology Co Ltd filed Critical Beijing Si Tech Information Technology Co Ltd
Priority to CN202211301782.3A priority Critical patent/CN115658341A/en
Publication of CN115658341A publication Critical patent/CN115658341A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method, a device, equipment and a medium for reading and writing data by Freeswitch, which comprises the following steps: acquiring a driving tool corresponding to the Redis sentinel cluster and a data read-write command matched with the Freeswitch; packaging the driving tool and the data read-write command to obtain a read-write plug-in matched with the Freeswitch; and registering the read-write plug-in the Freeswitch so that the Freeswitch is connected with the Redis sentinel cluster through the read-write plug-in, and completing data read-write operation in the Redis sentinel cluster. The technical scheme of the embodiment of the invention can provide an effective mode for directly connecting the Freeswitch and the Redis sentinel cluster, and improves the data reading and writing efficiency of the Freeswitch.

Description

Method, device, equipment and medium for reading and writing data by Freeswitch
Technical Field
The invention relates to the technical field of computers, in particular to a method, a device, equipment and a medium for reading and writing data by a Freeswitch.
Background
Freeswitch is a soft switching solution for phones, including a soft phone and a soft switch to provide product drivers for voice and chat, and is widely used in the fields of switch engines, PBXs, multimedia gateways, and multimedia servers.
Currently, when reading and writing data, the freswitch can only connect a single point Redis. With the increasing requirements of the Freeswitch on the connection of the Redis, an effective means is lacked in the prior art, and the Freeswitch and the Redis sentinel cluster can be directly connected.
Disclosure of Invention
The invention provides a method, a device, equipment and a medium for reading and writing data by a Freeswitch, which can provide an effective mode for directly connecting the Freeswitch and a Redis sentinel cluster and improve the data reading and writing efficiency of the Freeswitch.
According to an aspect of the present invention, there is provided a method for reading and writing data by a Freeswitch, including:
acquiring a driving tool corresponding to the Redis sentinel cluster and a data read-write command matched with the Freeswitch;
packaging the driving tool and the data read-write command to obtain a read-write plug-in matched with the Freeswitch;
and registering the read-write plug-in the Freeswitch so that the Freeswitch is connected with the Redis sentinel cluster through the read-write plug-in, and completing data read-write operation in the Redis sentinel cluster.
Optionally, the data read/write command includes a write queue command, a read queue command, a write object command, and a read object command.
Optionally, after registering the read-write plug-in the Freeswitch, the method further includes:
after the Freeswitch is detected to be started, loading a configuration file corresponding to the Redis sentinel cluster, and starting a client corresponding to the Redis sentinel cluster;
and after the client is detected to operate normally, controlling the Freeswitch to be connected with the Redis sentinel cluster through the read-write plug-in, and sending a data read-write command to the Redis sentinel cluster to finish data read-write operation.
Optionally, after the client corresponding to the Redis sentinel cluster is started, the method further includes:
and if the client is detected to be abnormal in operation, monitoring the operation state of the client until the client is detected to be normal in operation.
Optionally, a data read-write command is sent to the Redis sentinel cluster to complete data read-write operation, including:
sending a data writing command to the Redis sentinel cluster to complete data writing operation; alternatively, the first and second liquid crystal display panels may be,
and sending a data reading command to the Redis sentinel cluster to complete the data reading operation.
Optionally, sending a data reading command to the Redis sentinel cluster to complete a data reading operation, including:
monitoring data in the Redis sentinel cluster;
and sending a data reading command to the Redis sentinel cluster to finish the data reading operation after detecting that the Redis sentinel cluster finishes receiving the new data according to the monitoring result.
According to another aspect of the present invention, there is provided an apparatus for reading and writing data by a Freeswitch, the apparatus comprising:
the driving acquisition module is used for acquiring a driving tool corresponding to the Redis sentinel cluster and a data read-write command matched with the Freeswitch;
the read-write plug-in generating module is used for packaging the driving tool and the data read-write command to obtain a read-write plug-in matched with the Freeswitch;
and the data reading and writing module is used for registering the reading and writing plug-in the Freeswitch so as to enable the Freeswitch to be connected with the Redis sentinel cluster through the reading and writing plug-in and complete data reading and writing operation in the Redis sentinel cluster.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform a method of reading and writing data by a Freeswitch according to any of the embodiments of the present invention.
According to another aspect of the present invention, a computer-readable storage medium is provided, which stores computer instructions for causing a processor to implement a method for reading and writing data by Freeswitch according to any of the embodiments of the present invention when executed.
According to another aspect of the present invention, a computer program product is provided, the computer program product comprising a computer program, which when executed by a processor implements the method for Freeswitch to read and write data according to any of the embodiments of the present invention.
According to the technical scheme provided by the embodiment of the invention, the driving tool corresponding to the Redis sentinel cluster and the data read-write command matched with the Freeswitch are obtained; packaging the driving tool and the data read-write command to obtain a read-write plug-in matched with the Freeswitch; the technical means that the read-write plug-in is registered in the Freeswitch so that the Freeswitch is connected with the Redis sentinel cluster through the read-write plug-in and data read-write operation is completed in the Redis sentinel cluster is provided, an effective mode for directly connecting the Freeswitch and the Redis sentinel cluster is provided, and data read-write efficiency of the Freeswitch is improved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of a method for reading and writing data by a Freeswitch according to an embodiment of the present invention;
FIG. 2 is a flow chart of another method for reading and writing data by a Freeswitch according to an embodiment of the present invention;
FIG. 3 is a flow chart of another method for reading and writing data by a Freeswitch according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of an apparatus for reading and writing data by a Freeswitch according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device implementing the method for reading and writing data by Freeswitch according to the embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, 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.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the technical scheme of the embodiment of the invention, the related data acquisition, monitoring process and the like accord with the provisions of related laws and regulations without violating the customs of public order.
Fig. 1 is a flowchart of a method for reading and writing data by a Freeswitch according to an embodiment of the present invention, where the present embodiment is applicable to a case where the Freeswitch reads and writes data in a Redis sentinel cluster, the method may be performed by a device for reading and writing data by the Freeswitch, the device for reading and writing data by the Freeswitch may be implemented in a form of hardware and/or software, and the device for reading and writing data by the Freeswitch may be configured in an electronic device (e.g., a terminal or a server) having a data processing function. As shown in fig. 1, the method includes:
and step 110, obtaining a driving tool corresponding to the Redis sentinel cluster and a data read-write command matched with the Freeswitch.
In this embodiment, the Redis sentinel cluster is a cluster deployment mode about the Redis node. Multiple Redis nodes can be started in a Redis sentinel cluster to ensure the uniqueness of data. The difference between the Redis sentinel cluster and the single Redis is that the single Redis is at risk of being down, and due to the existence of a plurality of Redis nodes in the Redis sentinel cluster, when one or more Redis nodes are down, other nodes can take over the service of the down node.
In this step, optionally, the driving tool corresponding to the Redis sentinel cluster may be obtained according to the configuration file of the Redis sentinel cluster. The data read-write command can be understood as a preset command for indicating data read-write operation after the Freeswitch is connected with the Redis sentinel cluster.
In an implementation manner of the embodiment of the present invention, the data read/write command includes a write queue command, a read queue command, a write object command, and a read object command.
In one specific embodiment, the write queue command may be:
SWITCH_ADD_API(commands_api_interface,"push_resis_sentinel_rpush","lpush redis message",push_resis_sentinel_rpush,"<key><message>");
wherein the write queue command is for a Freeswitch to add queue information to a Redis sentinel cluster.
In one specific embodiment, the read queue command may be:
SWITCH_ADD_API(commands_api_interface,"pop_resis_sentinel_lpop","lpop redis message",pop_resis_sentinel_lpop,"<key>");
wherein the read queue command is used for a Freeswitch to read queue information from a Redis sentinel cluster.
In a specific embodiment, the write object command may be:
SWITCH_ADD_API(commands_api_interface,"get_resis_sentinel_value","get redis message",get_resis_sentinel_value,"<key>");
and the write object command is used for Freeswitch to write a data object into the Redis sentinel cluster.
In a specific embodiment, the read object command may be:
SWITCH_ADD_API(commands_api_interface,"set_resis_sentinel_value","setredis message",set_resis_sentinel_value,"<key><value>");
wherein the read object command is for a Freeswitch to read a data object from a Redis sentinel cluster.
And step 120, packaging the driving tool and the data read-write command to obtain a read-write plug-in matched with the Freeswitch.
In this step, the driving tool and the data read-write command may be encapsulated to obtain a plug-in (i.e., read-write plug-in) for the freswitch to read and write data in the Redis sentinel cluster.
And step 130, registering the read-write plug-in the Freeswitch so that the Freeswitch is connected with the Redis sentinel cluster through the read-write plug-in, and completing data read-write operation in the Redis sentinel cluster.
In this step, optionally, the read-write plug-in may be associated in a work module of the Freeswitch, so that the Freeswitch connects the Redis sentinel cluster by way of a command line, and reads and writes data. In a specific using process, the Freeswitch can synchronize own messages to other services by utilizing a sentinel model of Redis and receive messages sent by other services.
In practical applications, the development language of Freeswitch is not limited to C and C + +, but is generally implemented by Lua or java scripts on some functional modules (e.g., routing control, call-up, hang-up, and conference events), and these events are communicated and notified to the respective servers through the scripts.
In the prior art, when a Freeswitch is connected with a Redis sentinel cluster, the function in the script can be directly used for automatically processing the Redis sentinel cluster. However, this approach can result in very complex scripts and no removal of maintenance. Therefore, the embodiment provides the reading and writing plug-in matched with the Freeswitch, the script is not required to be changed, the development difficulty of the Freeswitch in the aspect of reading and writing data can be reduced, and the data reading and writing efficiency of the Freeswitch is improved; secondly, the read-write plug-in can be independently deployed in the Freeswitch, is simple to install and does not influence the kernel of the Freeswitch.
According to the technical scheme provided by the embodiment of the invention, the driving tool corresponding to the Redis sentinel cluster and the data read-write command matched with the Freeswitch are obtained; packaging the driving tool and the data read-write command to obtain a read-write plug-in matched with the Freeswitch; the technical means that the read-write plug-in is registered in the Freeswitch so that the Freeswitch is connected with the Redis sentinel cluster through the read-write plug-in and data read-write operation is completed in the Redis sentinel cluster is provided, an effective mode for directly connecting the Freeswitch and the Redis sentinel cluster is provided, and data read-write efficiency of the Freeswitch is improved.
Fig. 2 is a flowchart of a method for reading and writing data by a freswitch according to a second embodiment of the present invention, which is a further refinement of the foregoing embodiment. As shown in fig. 2, the method includes:
and step 210, obtaining a driving tool corresponding to the Redis sentinel cluster and a data read-write command matched with the Freeswitch.
And step 220, packaging the driving tool and the data read-write command to obtain a read-write plug-in matched with the Freeswitch.
Step 230, register the read-write plug-in the Freeswitch.
And step 240, after the Freeswitch is detected to be started, loading a configuration file corresponding to the Redis sentinel cluster, and starting a client corresponding to the Redis sentinel cluster.
In this step, optionally, a configuration file corresponding to the Redis sentinel cluster may be obtained and loaded from a preset storage location.
And step 250, after detecting that the client operates normally, controlling a Freeswitch to be connected with the Redis sentinel cluster through the read-write plug-in, and sending a data read-write command to the Redis sentinel cluster to complete data read-write operation.
In this step, optionally, the running state of the client may be monitored, and after it is detected that the client runs normally, the Freeswitch is controlled to connect with the Redis sentinel cluster through the read-write plug-in, and a data read-write command is sent to the Redis sentinel cluster through the Freeswitch.
After the Freeswitch sends a data read-write command to the Redis sentinel cluster, a message returned by the Redis sentinel cluster can be received through the Freeswitch, and the message is fed back to a callback interface (such as a Lua callback interface) corresponding to the Freeswitch.
According to the technical scheme provided by the embodiment of the invention, the driving tool corresponding to the Redis sentinel cluster and the data read-write command matched with the Freeswitch are obtained, the driving tool and the data read-write command are packaged to obtain the read-write plugin matched with the Freeswitch, the read-write plugin is registered in the Freeswitch, the configuration file corresponding to the Redis sentinel cluster is loaded after the Freeswitch is detected to be started, the client corresponding to the Redis sentinel cluster is started, the Freeswitch is controlled to be connected with the Redis sentinel cluster through the read-write plugin after the client is detected to be normally operated, and the data read-write command is sent to the Redis sentinel cluster to complete the data read-write operation.
Fig. 3 is a flowchart of a method for reading and writing data by a Freeswitch according to a third embodiment of the present invention, which is a further refinement of the foregoing embodiments. As shown in fig. 3, the method includes:
and step 310, acquiring a driving tool corresponding to the Redis sentinel cluster and a data read-write command matched with the Freeswitch.
And step 320, packaging the driving tool and the data read-write command to obtain a read-write plug-in matched with the Freeswitch.
And step 330, registering the read-write plug-in the Freeswitch.
And 340, after detecting that the Freeswitch is started, loading a configuration file corresponding to the Redis sentinel cluster, and starting a client corresponding to the Redis sentinel cluster.
Step 350, judging whether the client side operates normally, if so, executing step 360, otherwise, executing step 370.
And step 360, after the client is detected to run normally, controlling the Freeswitch to be connected with the Redis sentinel cluster through the read-write plug-in, and sending a data read-write command to the Redis sentinel cluster to finish data read-write operation.
In one implementation manner of the embodiment of the present invention, sending a data read-write command to a Redis sentinel cluster to complete data read-write operation includes: sending a data writing command to the Redis sentinel cluster to complete data writing operation; alternatively, a data read command is sent to the Redis sentinel cluster to complete the data read operation.
In a specific embodiment, the data write command may include a write queue command and a write object command; the data read command may include a read queue command and a read object command.
In a particular embodiment, sending a data read command to a Redis sentinel cluster to complete a data read operation includes: monitoring data in the Redis sentinel cluster; and sending a data reading command to the Redis sentinel cluster to finish the data reading operation after detecting that the Redis sentinel cluster finishes receiving the new data according to the monitoring result.
In an implementation manner of this embodiment, a data monitoring thread may be created in advance, and the data monitoring thread is used to monitor data in the Redis sentinel cluster, and after it is monitored that new data is stored in the Redis sentinel cluster according to a monitoring result, a data reading command is sent to the Redis sentinel cluster.
The advantage of this arrangement is that the omission of the read data result can be avoided, and the validity of the data read result can be improved.
Step 370, monitoring the running state of the client, and returning to execute the operation of judging whether the client runs normally in step 350 until detecting that the client runs normally.
In this embodiment, if it is detected that the client operates abnormally, the operating state of the client is monitored continuously until it is detected that the client operates normally. After detecting that the client operates normally, the operation in step 360 is repeatedly performed.
According to the technical scheme provided by the embodiment of the invention, the driving tool corresponding to the Redis sentinel cluster and the data read-write command matched with the Freeswitch are obtained, the driving tool and the data read-write command are packaged to obtain the read-write plugin matched with the Freeswitch, the read-write plugin is registered in the Freeswitch, after the starting of the Freeswitch is detected, the configuration file corresponding to the Redis sentinel cluster is loaded, the client corresponding to the Redis sentinel cluster is started, whether the client operates normally or not is judged, if yes, the Freeswitch is controlled to be connected with the Redis sentinel cluster through the read-write plugin, the data read-write command is sent to the Redis sentinel cluster to finish the data read-write operation, and if not, the operating state of the client is monitored until the client operates normally, and an effective mode for directly connecting the Freeswitch and the Redis sentinel cluster is provided, and the data read-write efficiency of the Freeswitch is improved.
Fig. 4 is a schematic structural diagram of a device for reading and writing data by a Freeswitch according to a fourth embodiment of the present invention, as shown in fig. 4, the device includes: a drive obtaining module 410, a read-write plug-in generating module 420 and a data read-write module 430.
The drive acquisition module 410 is used for acquiring a drive tool corresponding to the Redis sentinel cluster and a data read-write command matched with the Freeswitch;
the read-write plug-in generating module 420 is configured to encapsulate the driving tool and the data read-write command, so as to obtain a read-write plug-in matched with the freswitch;
and the data reading and writing module 430 is used for registering the reading and writing plug-in the Freeswitch so that the Freeswitch is connected with the Redis sentinel cluster through the reading and writing plug-in, and data reading and writing operations are completed in the Redis sentinel cluster.
According to the technical scheme provided by the embodiment of the invention, the driving tool corresponding to the Redis sentinel cluster and the data read-write command matched with the Freeswitch are obtained; packaging the driving tool and the data read-write command to obtain a read-write plug-in matched with the Freeswitch; the technical means that the read-write plug-in is registered in the Freeswitch so that the Freeswitch is connected with the Redis sentinel cluster through the read-write plug-in and data read-write operation is completed in the Redis sentinel cluster is provided, an effective mode for directly connecting the Freeswitch and the Redis sentinel cluster is provided, and data read-write efficiency of the Freeswitch is improved.
On the basis of the above embodiments, the data read/write commands include a write queue command, a read queue command, a write object command, and a read object command.
The data reading and writing module 430 includes:
the client starting unit is used for loading a configuration file corresponding to the Redis sentinel cluster after detecting that the Freeswitch is started, and starting a client corresponding to the Redis sentinel cluster;
the command sending unit is used for controlling the Freeswitch to be connected with the Redis sentinel cluster through the read-write plug-in unit after detecting that the client runs normally, and sending a data read-write command to the Redis sentinel cluster to finish data read-write operation;
the state monitoring unit is used for monitoring the operation state of the client terminal if the client terminal is detected to be abnormal in operation until the client terminal is detected to be normal in operation;
the write-in command sending unit is used for sending a data write-in command to the Redis sentinel cluster to finish data write-in operation;
the reading command sending unit is used for sending a data reading command to the Redis sentinel cluster to finish data reading operation;
the data monitoring unit is used for monitoring data in the Redis sentinel cluster;
and the data reading unit is used for sending a data reading command to the Redis sentinel cluster after detecting that the Redis sentinel cluster finishes receiving the new data according to the monitoring result so as to finish the data reading operation.
The device can execute the methods provided by all the embodiments of the invention, and has corresponding functional modules and beneficial effects for executing the methods. For technical details which are not described in detail in the embodiments of the present invention, reference may be made to the methods provided in all the aforementioned embodiments of the present invention.
FIG. 5 illustrates a block diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 performs the various methods and processes described above, such as the method of reading and writing data by freswitch.
In some embodiments, the method of Freeswitch reading and writing data can be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the method of Freeswitch reading and writing data described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured by any other suitable means (e.g., by means of firmware) to perform a method of Freeswitch reading and writing data.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method of reading and writing data by a freswitch, comprising:
acquiring a driving tool corresponding to the Redis sentinel cluster and a data read-write command matched with the Freeswitch;
packaging the driving tool and the data read-write command to obtain a read-write plug-in matched with the Freeswitch;
and registering the read-write plug-in the Freeswitch so that the Freeswitch is connected with the Redis sentinel cluster through the read-write plug-in, and completing data read-write operation in the Redis sentinel cluster.
2. The method of claim 1, wherein the data read and write commands comprise a write queue command, a read queue command, a write object command, and a read object command.
3. The method of claim 1, wherein after registering the read-write plug-in the Freeswitch, further comprising:
after the Freeswitch is detected to be started, loading a configuration file corresponding to the Redis sentinel cluster, and starting a client corresponding to the Redis sentinel cluster;
and after detecting that the client operates normally, controlling the Freeswitch to be connected with the Redis sentinel cluster through the read-write plug-in, and sending a data read-write command to the Redis sentinel cluster to finish data read-write operation.
4. The method of claim 3, further comprising, after starting a client corresponding to a Redis sentinel cluster:
and if the client is detected to be abnormal in operation, monitoring the operation state of the client until the client is detected to be normal in operation.
5. The method of claim 3, wherein sending data read and write commands to a Redis sentinel cluster to perform data read and write operations comprises:
sending a data writing command to the Redis sentinel cluster to complete data writing operation; alternatively, the first and second electrodes may be,
and sending a data reading command to the Redis sentinel cluster to finish the data reading operation.
6. The method of claim 5, wherein sending a data read command to a Redis sentinel cluster to complete a data read operation comprises:
monitoring data in the Redis sentinel cluster;
and sending a data reading command to the Redis sentinel cluster to finish the data reading operation after detecting that the Redis sentinel cluster finishes receiving the new data according to the monitoring result.
7. An apparatus for reading and writing data in a Freeswitch, comprising:
the driving acquisition module is used for acquiring a driving tool corresponding to the Redis sentinel cluster and a data read-write command matched with the Freeswitch;
the read-write plug-in generating module is used for packaging the driving tool and the data read-write command to obtain a read-write plug-in matched with the Freeswitch;
and the data reading and writing module is used for registering the reading and writing plug-in the Freeswitch so as to enable the Freeswitch to be connected with the Redis sentinel cluster through the reading and writing plug-in and complete data reading and writing operation in the Redis sentinel cluster.
8. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of Freeswitch reading and writing data of any of claims 1-6.
9. A computer-readable storage medium, having stored thereon computer instructions for causing a processor to execute a method of reading and writing data by a freswitch as claimed in any of claims 1-6.
10. A computer program product, characterized in that the computer program product comprises a computer program which, when being executed by a processor, implements the method for Freeswitch reading and writing data according to any one of claims 1-6.
CN202211301782.3A 2022-10-24 2022-10-24 Method, device, equipment and medium for reading and writing data by Freeswitch Pending CN115658341A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211301782.3A CN115658341A (en) 2022-10-24 2022-10-24 Method, device, equipment and medium for reading and writing data by Freeswitch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211301782.3A CN115658341A (en) 2022-10-24 2022-10-24 Method, device, equipment and medium for reading and writing data by Freeswitch

Publications (1)

Publication Number Publication Date
CN115658341A true CN115658341A (en) 2023-01-31

Family

ID=84991782

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211301782.3A Pending CN115658341A (en) 2022-10-24 2022-10-24 Method, device, equipment and medium for reading and writing data by Freeswitch

Country Status (1)

Country Link
CN (1) CN115658341A (en)

Similar Documents

Publication Publication Date Title
CN112540806B (en) Method and device for rendering small program page, electronic equipment and storage medium
CN114417780A (en) State synchronization method and device, electronic equipment and storage medium
CN115514718B (en) Data interaction method, control layer and equipment based on data transmission system
CN116126719A (en) Interface testing method and device, electronic equipment and storage medium
CN115599438A (en) Method, device, equipment and medium for constructing application program publishing package
CN115309730A (en) Data auditing method and device, electronic equipment and storage medium
CN114389969A (en) Client test method and device, electronic equipment and storage medium
CN115658341A (en) Method, device, equipment and medium for reading and writing data by Freeswitch
CN112925623A (en) Task processing method and device, electronic equipment and medium
CN112835759A (en) Test data processing method and device, electronic equipment and storage medium
CN112631843A (en) Equipment testing method and device, electronic equipment, readable medium and product
CN117009000A (en) Component, method, device, apparatus and medium for operating open source buddha system
CN117474537A (en) Personalized processing method, device, equipment and medium for financial IC card
CN115344212A (en) Data desensitization method, device and system, electronic equipment and storage medium
CN117785264A (en) Interface configuration method, device and storage medium for server operation and maintenance
CN115857828A (en) Customized system implementation method and device, electronic equipment and storage medium
CN114416040A (en) Page construction method, device, equipment and storage medium
CN117081939A (en) Traffic data processing method, device, equipment and storage medium
CN115967638A (en) Equipment simulation system, method, equipment and storage medium
CN115951921A (en) Service processing method, device and storage medium
CN114201564A (en) Map production task processing method and device, electronic equipment and storage medium
CN115277652A (en) Inference service-based streaming media processing method and device, and electronic equipment
CN117193825A (en) Method and device for calling update function, electronic equipment and storage medium
CN118034749A (en) Updating method and electronic equipment
CN117632343A (en) OCX module calling method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination