WO2015070769A1 - Data transfer method and apparatus - Google Patents
Data transfer method and apparatus Download PDFInfo
- Publication number
- WO2015070769A1 WO2015070769A1 PCT/CN2014/090963 CN2014090963W WO2015070769A1 WO 2015070769 A1 WO2015070769 A1 WO 2015070769A1 CN 2014090963 W CN2014090963 W CN 2014090963W WO 2015070769 A1 WO2015070769 A1 WO 2015070769A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- source data
- target process
- target
- transfer
- data
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/544—Buffers; Shared memory; Pipes
Definitions
- the present disclosure relates to computer technologies, more particularly to, a data transfer method and system.
- a provider of the data creates a file on a hard disk and writes the data to the file
- a receiver of the data opens the file in a shared mode and reads contents of the file.
- the provider of the data has to create the file and keep writing data to the file
- the receiver of the data has to obtain the data by using a polling mode.
- the efficiency of the data transfer is low.
- the receiver includes multiple processes, the problem is more serious.
- coding software obtains the video.
- the coding software needs to store the video as a file on the hard disk.
- Other applications may read the file only after the storing of the whole video is finished. The efficiency of obtaining the video is low.
- Examples of the present disclosure provide a data transfer method and apparatus, so that multiple target processes may obtain data from one source process, and data transfer efficiency is improved.
- a data transfer method includes:
- a data transfer apparatus includes:
- a data generating unit to generate source data
- a data obtaining unit to obtain the source data generated by the data generating unit
- an information obtaining unit to obtain transfer channel information of each target process
- a determining unit to determine at least one target process corresponding to the source data and a transfer mode of sending the source data to each of the at least one target process according to the transfer channel information obtained by the information obtaining unit;
- a sending unit to send the source data to each of the at least one target process by using a sending mode corresponding to the transfer mode of sending the source data to the target process.
- the source process obtains the source data and the transfer channel information of each target process, so as to determine the target process corresponding to the source data and to determine the transfer mode of sending the source data to the target process. Then, the source process sends the source data.
- multiple target processes may obtain the source data of the same source process. Further, it is unnecessary to wait for the finish of storing the source data and the target process does not need to obtain the data by using the polling mode, so that the data transfer efficiency is improved.
- each of the target processes obtains the source data separately, and thus the processing of obtaining the source data by each of the target processes does not affect each other.
- Figure 1 is a schematic flowchart illustrating a data transfer method according to various embodiments of the present disclosure.
- Figure 2 is a schematic diagram illustrating a data transfer system according to various embodiments of the present disclosure.
- Figure 3 is a schematic diagram illustrating a data transfer apparatus according to various embodiments of the present disclosure.
- Figure 4 is a schematic diagram illustrating a data transfer apparatus according to various embodiments of the present disclosure.
- Figure 5 is a schematic diagram illustrating a data transfer apparatus according to various embodiments of the present disclosure.
- Figure 6 is a schematic diagram illustrating a terminal device according to various embodiments of the present disclosure.
- Figure 1 is a schematic flowchart illustrating a data transfer method according to various embodiments of the present disclosure. As shown in Figure 1, the method includes the following processing.
- a source process generates and obtains source data, and obtains transfer channel information of each target process.
- the source process is a source for providing data, and the source process may generate the source data.
- the types of the source data are various, e.g. sound, images, and stream data etc.
- the transfer channel information indicates a transfer mode and has various representing mode. Beside the transfer mode, other information may be used to indicate information of the source process and the target process that needs to obtain the source data. Based on different transfer modes, the transfer channel information may be represented via different modes. Some examples of the transfer channel information are provided as follows.
- a monitoring thread is used.
- the source process obtains the transfer channel information of each target process by using the monitoring thread, and determines whether each target process or the transfer channel information of each target process is changed.
- an identifier of the transfer channel information may be configured, so that the source process may determine the target process which needs to obtain the source data.
- a channel identifier is obtained, and the channel identifier is an identifier pair including a target process identifier and a source process identifier.
- the transfer mode may be implemented by using a shared storage block.
- the shared storage block may be a shared memory.
- the transfer channel may be other system objects and the transfer channel information may be implemented by using other modes, which are not limited in the examples of the present disclosure.
- the channel identifier indicates a target address for storing the source data.
- the source process stores the source data to the target address, so that the target process may read the source data.
- the transfer channel information may be stored by the target process.
- the transfer channel information stored by the target process hooking the source process is obtained, after the source process is hooked by the target process.
- an audio player process is taken as a source process.
- Other process e.g. video playing may be used as the source process in the examples of the present disclosure.
- the source process is the audio player process.
- the source process determines the target processes corresponding to the source data and a transfer mode of sending the source data to each of the target processes.
- the source process sends the source data to each of the target processes by using a sending mode corresponding to the transfer mode of sending the source data to the target process.
- the source process obtains the source data and the transfer channel information of each target process, so as to determine the target process corresponding to the source data and to determine the transfer mode of sending the source data to the target process. Then, the source process sends the source data.
- multiple target processes may obtain the source data of the same source process. Further, it is unnecessary to wait for the finish of storing the source data and the target process does not need to obtain the data by using the polling mode, so that the data transfer efficiency is improved.
- each of the target processes obtains the source data separately, and thus the processing of obtaining the source data by each of the target processes does not affect each other.
- the examples of the present disclosure also provide technical solutions of storing source data to an address indicated by a channel identifier.
- the source process when the source process stores the source data to the target address, the source process reads the address indicated by the channel identifier by using a transfer thread, and writes the source data to the address indicated by the channel identifier, so that the target process may read the source data.
- the source process is an audio player process which is injected by using a Hook mode.
- a playing function hooked with the audio player process obtains voice data, and sends the voice data to other applications by using a shared memory.
- the Hook is a platform for message processing provided by Windows.
- a certain application may monitor a message of a certain type of a designed window by configuring a sub-program on the platform, and the designed window may be created by another process.
- the message arrives, the message is processed by the sub-program before a processing function of a target window processes the message.
- the application is allowed to intercept and process Windows messages or a certain event.
- an application refers to an application needing voice data, and there are n applications in Figure 2.
- a player process refers to a voice data source, and the player process is a target process of the voice data to be obtained.
- a transfer channel ID may be a global unique ID of 64 bits.
- the transfer channel ID includes an application process ID and a player process ID.
- the high 32 bits indicates the application process ID, and the low 32 bits indicates the player process ID, so that it may be determined that which applicant wants to obtain voice data of which player.
- a transfer channel assignment table may be used to store the transfer channel ID.
- a transfer channel refers to a global unique shared memory block, and an identifier of the transfer channel is the transfer channel ID.
- the transfer channel is used to transfer the voice data.
- the player writes data to the transfer channel, and the application reads data from the transfer channel.
- a transfer channel table may be used to store transfer channel addresses for the player process.
- a sound data buffer may be used to buffer sound data obtained from the player process.
- An assignment monitoring thread may be used to monitor the transfer channel assignment table.
- the assignment monitoring thread scans the whole transfer channel assignment table, checks each transfer channel ID, and determines whether a certain application wants to obtain the sound data of the player process. If there is an application wants to obtain the sound data of the player process, the assignment monitoring thread adds a transfer channel address corresponding to the transfer channel ID to the transfer channel table.
- a sound transfer thread may be used to read the transfer channel address from the transfer channel table and writes the sound data to the transfer channel according to the transfer channel address.
- Figure 2 shows the procedure of obtaining sound data by an application. As shown in Figure 2, the procedure includes the following processing.
- an application first injects a player process, and then hooks a playing function of the player process.
- the application assigns buffer to store obtained sound data, and creates an assignment monitoring thread and a sound transfer thread.
- a voice communication program e.g. Qtalk in which multiple people may communicate with each other via voice, may hook a player process to obtain voice data.
- the application generates a transfer channel ID including an ID of the application and an ID of a player, and establishes a transfer channel whose ID is the transfer channel ID.
- the application adds transfer channel ID into the transfer channel assignment table, and notifies the player process to update. As shown in Figure 2, the application may modify the transfer channel ID of the application in the transfer channel assignment table.
- the assignment monitoring thread of the player process scans the transfer channel assignment table to monitor change of the transfer channel assignment table.
- the player process stores the address of the transfer channel to the transfer channel table. If the transfer channel assignment table changes, the transfer channel table is updated.
- the sound transfer thread of the player process obtains the sound data from the sound data buffer, obtains the transfer channel address from the transfer channel table, and then writes the sound data to the transfer channel according to the transfer channel address.
- the application reads the sound data from the transfer channel.
- steps 2 to 6 may be performed repeatedly. If the application does not want the sound data of the player, the transfer channel ID is canceled from the transfer channel assignment table. After monitoring the cancelling of the transfer channel ID, the assignment monitoring thread of the player cancels the transfer channel address corresponding to the transfer channel ID from the transfer channel table stored locally and closes the transfer channel corresponding to the transfer channel address.
- multiple applications may obtain voice data of the same player process at the same time, so that a user may share music playing locally with multiple chat rooms.
- the playing control of the music in different chat rooms does not affect each other, so that functions of the application are simple and strong, and the user is provided with better experiences.
- the embodiments of the present disclosure also provide a data transfer apparatus.
- the apparatus includes a data generating unit 301, a data obtaining unit 302, an information obtaining unit 303, a determining unit 304 and a sending unit 305.
- the data generating unit 301 is to generate source data.
- the data generating unit 301 may be implemented via a source process.
- the source process is a source for providing data, and the source process may generate the source data.
- the types of the source data are various, e.g. sound, images, and stream data etc.
- the data obtaining unit 302 is to obtain the source data generated by the data generating unit 301.
- the information obtaining unit 303 is to obtain transfer channel information of each target process.
- the determining unit 304 is to determine at least one target process corresponding to the source data and a transfer mode of sending the source data to each of the at least one target process according to the transfer channel information obtained by the information obtaining unit 303.
- the sending unit 305 is to send the source data to each of the at least one target process by using a sending mode corresponding to the transfer mode of sending the source data to the target process determined by the determining unit 304.
- the source process obtains the source data and the transfer channel information of each target process, so as to determine the target process corresponding to the source data and to determine the transfer mode of sending the source data to the target process. Then, the source process sends the source data.
- multiple target processes may obtain the source data of the same source process. Further, it is unnecessary to wait for the finish of storing the source data, and the target process does not need to obtain the data by using the polling mode, so that the data transfer efficiency is improved.
- each of the at least one target process obtains the source data separately, and thus the processing of obtaining the source data by each of the at least one target process does not affect each other.
- the transfer channel information indicates a transfer mode and has various representing mode. Beside the transfer mode, other information may be used to indicate information of the source process and the target process that needs to obtain the source data. Based on different transfer modes, the transfer channel information may be represented via different modes. Some examples of the transfer channel information are provided as follows.
- a monitoring thread is used.
- the information obtaining unit 303 obtains the transfer channel information of each target process by using the monitoring thread and determines whether each target process or the transfer channel information of each target process is changed.
- an identifier of the transfer channel information may be configured, so that the source process may determine the target process which needs to obtain the source data.
- the information obtaining unit 303 obtains a channel identifier including a target process identifier and a source process identifier.
- the transfer mode may be implemented by using a shared storage block.
- the shared storage block may be a shared memory.
- the transfer channel may be other system objects and the transfer channel information may be implemented by using other modes, which are not limited in the examples of the present disclosure.
- the information obtaining unit 303 obtains the channel identifier indicating a target address for storing the source data.
- the sending unit 305 stores the source data according to the target address, so that the target process may read the source data.
- the embodiments of the present disclosure also provide the solutions of storing the source data according to the address indicated by the channel identifier.
- the sending unit 305 includes an address obtaining unit 401 and a data writing unit 402.
- the address obtaining unit 401 is to read the address indicated by the channel identifier by using a transfer thread.
- the data writing unit 402 is to write the source data to the address indicated by the channel identifier, so that the target process may read the source data.
- the transfer channel information may be stored by the target process.
- the information obtaining unit 303 obtains the transfer channel information stored by the target process hooking the source process, after the source process is hooked by the target process.
- the embodiments of the present disclosure also provide a data transfer apparatus.
- the data transfer apparatus includes a receiver 501, a transmitter 502, a processor 503 and storage 504.
- the processor 503 is to generate and obtain source data; obtain transfer channel information of each target process; determine at least one target process corresponding to the source data and a transfer mode of sending the source data to each of the at least one target process according to the transfer channel information; send the source data to each of the at least one target process by using a sending mode corresponding to the transfer mode of sending the source data to the target process.
- the types of the source data are various, e.g. sound, images, and stream data etc.
- the processor obtains the source data and the transfer channel information of each target process, so as to determine the target process corresponding to the source data and to determine the transfer mode of sending the source data to the target process. Then, the processor sends the source data.
- multiple target processes may obtain the source data of the same source process. Further, it is unnecessary to wait for the finish of storing the source data, and the target process does not need to obtain the data by using the polling mode, so that the data transfer efficiency is improved.
- each of the at least one target process obtains the source data separately, and thus the processing of obtaining the source data by each of the at least one target process does not affect each other.
- the transfer channel information indicates a transfer mode and has various representing mode. Beside the transfer mode, other information may be used to indicate information of the source process and the target process that needs to obtain the source data. Based on different transfer modes, the transfer channel information may be represented via different modes. Some examples of the transfer channel information are provided as follows.
- a monitoring thread is used.
- the processor 503 obtains the transfer channel information of each target process by using the monitoring thread and determines whether each target process or the transfer channel information of each target process is changed.
- an identifier of the transfer channel information may be configured, so that the source process may determine the target process which needs to obtain the source data.
- the processor 503 obtains a channel identifier including a target process identifier and a source process identifier.
- the transfer mode may be implemented by using a shared storage block.
- the shared storage block may be a shared memory.
- the transfer channel may be other system objects, and the transfer channel information may be implemented by using other modes, which are not limited in the examples of the present disclosure.
- the processor 503 obtains the channel identifier indicating a target address for storing the source data; and stores the source data according to the target address, so that the target process may read the source data.
- the embodiments of the present disclosure also provide the solutions of storing the source data according to the target address indicated by the channel identifier.
- the processor 503 reads the target address indicated by the channel identifier by using a transfer thread; and writes the source data to the target address indicated by the channel identifier, so that the target process may read the source data.
- the transfer channel information may be stored by the target process.
- the processor 503 obtains the transfer channel information stored by the target process hooking the source process, after the source process is hooked by the target process.
- the embodiments of the present disclosure further provide a data transfer apparatus.
- the apparatus may be a terminal device.
- the apparatus may be a mobile phone, a tablet PC, a Personal Digital Assistant (PDA) , a Point of Sales (POS) , an on-board computer and etc.
- the terminal device is a mobile phone.
- FIG. 6 is a schematic diagram illustrating a terminal device according to various embodiments of the present disclosure.
- the mobile phone may include a Radio Frequency (RF) circuit 610, storage 620 including at least one non-transitory machine-readable storage medium, an inputting unit 630, a displaying unit 640, a sensor 650, an audio circuit 660, a wireless fidelity (WiFi) module 670, a processor 680 including at least one processing core, a power 690 etc.
- RF Radio Frequency
- storage 620 including at least one non-transitory machine-readable storage medium
- an inputting unit 630 a displaying unit 640
- a sensor 650 including at least one non-transitory machine-readable storage medium
- an audio circuit 660 an audio circuit 660
- WiFi wireless fidelity
- a processor 680 including at least one processing core, a power 690 etc.
- the terminal device is not limited by a structure of the mobile phone as shown in Figure 6.
- the terminal device may include more
- the RF circuit 610 is to transmit and receive signals in call processes or in processes of transmitting and receiving information.
- the RF circuit 610 is further to transmit downlink information received from a base station to the processor 680.
- the RF circuit 610 is to transmit uplink data to the base station.
- the RF circuit 610 includes, but is not limited to, an antenna, at least one amplifier, a tuner, at least one oscillator, a subscriber identity module (SIM) card, a transceiver, a coupler, a low noise amplifier (LNA) , a diplexer etc.
- SIM subscriber identity module
- the RF circuit 610 communicates with a network or another communication device through wireless communication.
- GSM Global System of Mobile communication
- GPRS General Packet Radio Service
- CDMA Code Division Multiple Access
- WCDMA Wideband Code Division Multiple Access
- LTE Long Term Evolution
- Email Short Messaging Service
- the storage 620 is to store software program and modules.
- the processor 680 executes the software program and the modules stored in the storage 620 to perform function applications and data processing.
- the storage 620 may include a program storage area and a data storage area.
- the program storage area may store an operating system, application program corresponding to at least one function (e.g., a sound playing function, a video playing function) .
- the data storage area may store data created when the terminal device is used (e.g., audio data, contact data) .
- the storage 620 may include a high-speed random access memory, or the storage 620 may further include a non-transitory memory, such as at least one disk storage device, at least one flash memory device, or other volatile solid-state memory devices.
- the storage 620 may further include a memory controller, so that the processor 680 and the inputting unit 630 may access the storage 620.
- the inputting unit 630 may receive an inputted number or character information, and generate an input signal of a key, a mouse, an operating rod, an optical or a track ball related with function control and user configuration.
- the inputting unit 630 may include a touch panel 631 and another inputting device 632.
- the touch panel 631 which is also called a touch screen, may collect a touch operation performed by a user on or near the touch panel 631 (e.g., the user may perform an operation by using any suitable object or an accessory on or near the touch panel 631) , and may drive a corresponding connection device according to preset program.
- the touch panel 631 may include a touch detection apparatus and a touch controller.
- the touch detection apparatus is to detect a touch position, detect a signal generated by the touch operation, and transmit the signal to the touch controller.
- the touch controller is to receive touch information from the touch detection apparatus, convert the touch information to touch point coordinates, transmit the touch point coordinates to the processor 680, and receive a command from the processor 680 and execute the command.
- the touch panel 631 is implemented by using a resistance-type, a capacitance-type, an infrared-type or a surface-acoustic-wave-type.
- the inputting unit 630 may further include another inputting device 632.
- the another inputting device 632 may include, but be not limited to, at least one of a physical keyboard, a function key (such as a volume control key, a key switch, etc. ) , a trackball, a mouse, and an operating rod.
- the displaying unit 640 may display information inputted by the user, information provided to the user, or a graphical user interface of the terminal device.
- the graphical user interface may include at least one of a graphic, a character, an icon, video etc.
- the displaying unit 640 may include a displaying panel 641.
- the displaying panel 641 is configured in a manner of Liquid Crystal Display (LCD) , Organic Light-Emitting Diode (OLED) .
- the touch panel 631 may cover the displaying panel 641. When detecting the touch operation on or near the touch panel 631, the touch panel 631 transmits the touch operation to the processor 680 to determine a type of a touch event.
- the processor 680 provides a corresponding visual output in the displaying panel 641.
- the touch panel 631 and the displaying panel 641 are as two independent components to implement an inputting function and an outputting function, in some embodiments, the touch panel 631 and the displaying panel 641 may be integrated to implement the inputting function and the outputting function.
- the mobile phone may further include at least one sensor 650, e.g., a light sensor, a motion sensor and another sensor.
- the light sensor may include an ambient light sensor and a proximity sensor.
- the ambient light sensor adjusts brightness of the displaying panel 641 according to the brightness of the ambient light.
- the proximity sensor may close the displaying panel 641 and/or backlit when the mobile phone moves to an ear.
- an accelerometer sensor can detect a value of acceleration in all directions (typically three-axis) , may detect a value and a direction of gravity in stationary, identify an application of a phone posture (such as switch between a horizontal screen and vertical screen, a related game, magnetometer posture calibration) , and identify a vibration recognition related function (such as a pedometer, a percussion) .
- a phone posture such as switch between a horizontal screen and vertical screen, a related game, magnetometer posture calibration
- a vibration recognition related function such as a pedometer, a percussion
- Another sensor such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor may be configured in the mobile phone, which is not described repeatedly herein.
- the audio circuit 660, a speaker 661 and a microphone 662 may provide an audio interface between the user and the mobile phone.
- the audio circuit 660 may transmit an electric signal transformed from received audio data to the speaker 661.
- the speaker 661 transforms the electric signal to a sound signal and outputs the sound signal.
- the microphone 662 transforms collected sound signal to an electric signal.
- the audio circuit 660 receives the electric signal and transforms the electric signal to audio data, and output the audio data to the processor 680 to be processed. After the audio data is processed by the processor 680, the audio data is transmitted to another terminal device via the RF circuit 610, or the audio data is outputted and stored by the memory 620 for further processing.
- the audio circuit 660 may further include an earphone jack, so that an earphone may communicate with the mobile phone.
- the WiFi belongs to short-range wireless transmission technology.
- the WiFi module 670 of the mobile phone By using the WiFi module 670 of the mobile phone, the user may access a wireless broadband internet, transmit and receive an Email, browse a webpage and access streaming media.
- the wireless module 670 is shown in Figure 6. It can be known that the WiFi module 670 is not an essential component of the terminal device, and may be omitted as requirements when not changing the nature of the present disclosure.
- the processor 680 is a control center of the mobile phone.
- the processor 680 is to connect all components of the terminal device via various interfaces and circuits, run the software program and/or module stored in the memory 620, call data stored in the memory 620, so as to execute various functions and perform data processing for the mobile phone.
- the processor 680 may include at least one processing core.
- the processor 680 may include an application processor and a modem processor.
- the application processor processes an operation system, user interfaces and application programs.
- the modem processor processes wireless communication. It can be known that the modem processor may not be integrated in the processor 680.
- the mobile phone may further include a power 690 (e.g., a battery) supplying power for each component.
- the power may connect with the processor 680 through a power management system, so that functions, e.g., a charging management function, a discharging management function, a power management function, can be implemented through the power management system.
- the power 690 may further include at least one direct current power supply or alternating current power supply, a recharging system, a power failure detection circuit, a power converter and a power inverter, and a power status indicator.
- the mobile phone may further include a camera, a blue tooth module, which is not illustrated in Figure 6.
- the displaying unit of the terminal device is touch screen display.
- the terminal device also includes storage and at least one program.
- the at least one program is stored in the storage.
- the at least one processor executes the at least one program, the following operations are performed.
- Source data are generated and obtained, and transfer channel information of each target process is obtained.
- At least one target process corresponding to the source data and a transfer mode of sending the source data to each of the at least one target process are determined according to the transfer channel information.
- the source data are sent to each of the at least one target process by using a sending mode corresponding to the transfer mode of sending the source data to the target process.
- the types of the source data are various, e.g. sound, images, and stream data etc.
- the source data and the transfer channel information of each target process are obtained to determine the target process corresponding to the source data and to determine the transfer mode of sending the source data to the target process. Then, the source process sends the source data.
- multiple target processes may obtain the source data of the same source process. Further, it is unnecessary to wait for the finish of storing the source data and the target process does not need to obtain the data by using the polling mode, so that the data transfer efficiency is improved.
- each of the target processes obtains the source data separately, and thus the processing of obtaining the source data by each of the target processes does not affect each other.
- the transfer channel information indicates a transfer mode and has various representing mode. Beside the transfer mode, other information may be used to indicate information of the source process and the target process that needs to obtain the source data. Based on different transfer modes, the transfer channel information may be represented via different modes. Some examples of the transfer channel information are provided as follows.
- a monitoring thread is used.
- the processor 680 obtains the transfer channel information of each target process by using the monitoring thread, and determines whether each target process or the transfer channel information of each target process is changed.
- an identifier of the transfer channel information may be configured, so that the source process may determine the target process which needs to obtain the source data.
- the processor 680 obtains the transfer channel information of each target process, a channel identifier is obtained, and the channel identifier is an identifier pair including a target process identifier and a source process identifier.
- the transfer mode may be implemented by using a shared storage block.
- the shared storage block may be a shared memory.
- the transfer channel may be other system objects and the transfer channel information may be implemented by using other modes, which are not limited in the examples of the present disclosure.
- the channel identifier indicates a target address for storing the source data.
- the processor 680 sends the source data to the target process, the processor 680 stores the source data to the target address, so that the target process may read the source data.
- the embodiments of the present disclosure also provide the solutions of storing the source data according to the target address indicated by the channel identifier.
- the processor 680 reads the target address indicated by the channel identifier by using a transfer thread; and writes the source data to the target address indicated by the channel identifier, so that the target process may read the source data.
- the transfer channel information may be stored by the target process.
- the processor 680 obtains the transfer channel information stored by the target process hooking the source process, after the source process is hooked by the target process.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
- Communication Control (AREA)
Abstract
In a data transfer method, source data are generated and obtained, and transfer channel information of each target process is obtained. At least one target process corresponding to the source data and a transfer mode of sending the source data to each of the at least one target process are determined according to the transfer channel information. The source data are sent to each of the at least one target process by using a sending mode corresponding to the transfer mode of sending the source data to the target process.
Description
This application claims priority to Chinese Patent Application No. 201310576452.x, filed on November 18, 2013, which is hereby incorporated by reference in its entirety.
Field of the Disclosure
The present disclosure relates to computer technologies, more particularly to, a data transfer method and system.
Background of the Disclosure
Currently, when data are transferred between processes, a provider of the data creates a file on a hard disk and writes the data to the file, a receiver of the data opens the file in a shared mode and reads contents of the file.
In the above data transfer method, the provider of the data has to create the file and keep writing data to the file, the receiver of the data has to obtain the data by using a polling mode. Hence, the efficiency of the data transfer is low. When the receiver includes multiple processes, the problem is more serious.
For example, after a camera obtains a video, coding software obtains the video. The coding software needs to store the video as a file on the hard disk. Other applications may read the file only after the storing of the whole video is finished. The efficiency of obtaining the video is low.
Summary of the Disclosure
Examples of the present disclosure provide a data transfer method and apparatus, so that multiple target processes may obtain data from one source process, and data transfer efficiency is improved.
A data transfer method includes:
generating and obtaining source data;
obtaining transfer channel information of each target process;
determining at least one target process corresponding to the source data and a
transfer mode of sending the source data to each of the at least one target process according to the transfer channel information;
sending the source data to each of the at least one target process by using a sending mode corresponding to the transfer mode of sending the source data to the target process.
A data transfer apparatus includes:
a data generating unit, to generate source data;
a data obtaining unit, to obtain the source data generated by the data generating unit;
an information obtaining unit, to obtain transfer channel information of each target process;
a determining unit, to determine at least one target process corresponding to the source data and a transfer mode of sending the source data to each of the at least one target process according to the transfer channel information obtained by the information obtaining unit; and
a sending unit, to send the source data to each of the at least one target process by using a sending mode corresponding to the transfer mode of sending the source data to the target process.
According to the technical solutions of the present disclosure, the source process obtains the source data and the transfer channel information of each target process, so as to determine the target process corresponding to the source data and to determine the transfer mode of sending the source data to the target process. Then, the source process sends the source data. In this way, multiple target processes may obtain the source data of the same source process. Further, it is unnecessary to wait for the finish of storing the source data and the target process does not need to obtain the data by using the polling mode, so that the data transfer efficiency is improved. Moreover, each of the target processes obtains the source data separately, and thus the processing of obtaining the source data by each of the target processes does not affect each other.
Figure 1 is a schematic flowchart illustrating a data transfer method according to various embodiments of the present disclosure.
Figure 2 is a schematic diagram illustrating a data transfer system according to
various embodiments of the present disclosure.
Figure 3 is a schematic diagram illustrating a data transfer apparatus according to various embodiments of the present disclosure.
Figure 4 is a schematic diagram illustrating a data transfer apparatus according to various embodiments of the present disclosure.
Figure 5 is a schematic diagram illustrating a data transfer apparatus according to various embodiments of the present disclosure.
Figure 6 is a schematic diagram illustrating a terminal device according to various embodiments of the present disclosure.
Detailed Description of the Disclosure
Technical solutions of the present invention will be illustrated in detail hereinafter with reference to the accompanying drawings. The described examples are parts of examples of the present invention. Other examples obtained by those skilled in the art without creative labour based on the examples of the present invention belong to the protection scope of the invention.
Figure 1 is a schematic flowchart illustrating a data transfer method according to various embodiments of the present disclosure. As shown in Figure 1, the method includes the following processing.
At 101: a source process generates and obtains source data, and obtains transfer channel information of each target process.
According to examples of the present disclosure, the source process is a source for providing data, and the source process may generate the source data. The types of the source data are various, e.g. sound, images, and stream data etc.
The transfer channel information indicates a transfer mode and has various representing mode. Beside the transfer mode, other information may be used to indicate information of the source process and the target process that needs to obtain the source data. Based on different transfer modes, the transfer channel information may be
represented via different modes. Some examples of the transfer channel information are provided as follows.
In an example, a monitoring thread is used. The source process obtains the transfer channel information of each target process by using the monitoring thread, and determines whether each target process or the transfer channel information of each target process is changed.
In addition, an identifier of the transfer channel information may be configured, so that the source process may determine the target process which needs to obtain the source data. According to an example, when obtaining the transfer channel information of each target process, a channel identifier is obtained, and the channel identifier is an identifier pair including a target process identifier and a source process identifier.
According to an example, the transfer mode may be implemented by using a shared storage block. The shared storage block may be a shared memory. The transfer channel may be other system objects and the transfer channel information may be implemented by using other modes, which are not limited in the examples of the present disclosure.
When the transfer mode is implemented by using the shared storage block, the channel identifier indicates a target address for storing the source data. When sending the source data to the target process, the source process stores the source data to the target address, so that the target process may read the source data.
According to an example, the transfer channel information may be stored by the target process. In the process of obtaining the transfer channel information of the target process, the transfer channel information stored by the target process hooking the source process is obtained, after the source process is hooked by the target process.
In the following example, an audio player process is taken as a source process. Other process, e.g. video playing may be used as the source process in the examples of the present disclosure.
In the example, there are at least two target processes, and the source process is the audio player process.
At 102, according to transfer channel information, the source process determines the target processes corresponding to the source data and a transfer mode of sending the source data to each of the target processes.
At 103, the source process sends the source data to each of the target processes by using a sending mode corresponding to the transfer mode of sending the source data to the target process.
According to the example, the source process obtains the source data and the transfer channel information of each target process, so as to determine the target process corresponding to the source data and to determine the transfer mode of sending the source data to the target process. Then, the source process sends the source data. In this way, multiple target processes may obtain the source data of the same source process. Further, it is unnecessary to wait for the finish of storing the source data and the target process does not need to obtain the data by using the polling mode, so that the data transfer efficiency is improved. Moreover, each of the target processes obtains the source data separately, and thus the processing of obtaining the source data by each of the target processes does not affect each other.
The examples of the present disclosure also provide technical solutions of storing source data to an address indicated by a channel identifier.
According to an example, when the source process stores the source data to the target address, the source process reads the address indicated by the channel identifier by using a transfer thread, and writes the source data to the address indicated by the channel identifier, so that the target process may read the source data.
In an example, the source process is an audio player process which is injected by using a Hook mode. A playing function hooked with the audio player process obtains voice data, and sends the voice data to other applications by using a shared memory.
The Hook is a platform for message processing provided by Windows. A certain application may monitor a message of a certain type of a designed window by configuring a sub-program on the platform, and the designed window may be created by another process. When the message arrives, the message is processed by the sub-program before a
processing function of a target window processes the message. In the Hook mode, the application is allowed to intercept and process Windows messages or a certain event.
According to an example, the solutions are described in detailed as shown in Figure 2.
In the example, an application refers to an application needing voice data, and there are n applications in Figure 2.
A player process refers to a voice data source, and the player process is a target process of the voice data to be obtained.
A transfer channel ID may be a global unique ID of 64 bits. The transfer channel ID includes an application process ID and a player process ID. The high 32 bits indicates the application process ID, and the low 32 bits indicates the player process ID, so that it may be determined that which applicant wants to obtain voice data of which player.
A transfer channel assignment table may be used to store the transfer channel ID.
A transfer channel refers to a global unique shared memory block, and an identifier of the transfer channel is the transfer channel ID. The transfer channel is used to transfer the voice data. The player writes data to the transfer channel, and the application reads data from the transfer channel.
A transfer channel table may be used to store transfer channel addresses for the player process.
A sound data buffer may be used to buffer sound data obtained from the player process.
An assignment monitoring thread may be used to monitor the transfer channel assignment table. When the transfer channel assignment table changes, the assignment monitoring thread scans the whole transfer channel assignment table, checks each transfer channel ID, and determines whether a certain application wants to obtain the sound data of the player process. If there is an application wants to obtain the sound data of the player process, the assignment monitoring thread adds a transfer channel address
corresponding to the transfer channel ID to the transfer channel table.
A sound transfer thread may be used to read the transfer channel address from the transfer channel table and writes the sound data to the transfer channel according to the transfer channel address.
Figure 2 shows the procedure of obtaining sound data by an application. As shown in Figure 2, the procedure includes the following processing.
At step 1, an application first injects a player process, and then hooks a playing function of the player process. The application assigns buffer to store obtained sound data, and creates an assignment monitoring thread and a sound transfer thread.
In an example, a voice communication program, e.g. Qtalk in which multiple people may communicate with each other via voice, may hook a player process to obtain voice data.
At step 2, the application generates a transfer channel ID including an ID of the application and an ID of a player, and establishes a transfer channel whose ID is the transfer channel ID.
At step 3, the application adds transfer channel ID into the transfer channel assignment table, and notifies the player process to update. As shown in Figure 2, the application may modify the transfer channel ID of the application in the transfer channel assignment table.
At step 4, the assignment monitoring thread of the player process scans the transfer channel assignment table to monitor change of the transfer channel assignment table. When it is determined that the application wants to obtain the sound data of player process, the player process stores the address of the transfer channel to the transfer channel table. If the transfer channel assignment table changes, the transfer channel table is updated.
At step 5, the sound transfer thread of the player process obtains the sound data from the sound data buffer, obtains the transfer channel address from the transfer channel table, and then writes the sound data to the transfer channel according to the transfer channel
address.
At step 6, the application reads the sound data from the transfer channel.
If another application also wants to obtain the sound data of the player, steps 2 to 6 may be performed repeatedly. If the application does not want the sound data of the player, the transfer channel ID is canceled from the transfer channel assignment table. After monitoring the cancelling of the transfer channel ID, the assignment monitoring thread of the player cancels the transfer channel address corresponding to the transfer channel ID from the transfer channel table stored locally and closes the transfer channel corresponding to the transfer channel address.
By using the solutions of the present application, multiple applications may obtain voice data of the same player process at the same time, so that a user may share music playing locally with multiple chat rooms. In addition, the playing control of the music in different chat rooms does not affect each other, so that functions of the application are simple and strong, and the user is provided with better experiences.
The embodiments of the present disclosure also provide a data transfer apparatus. As shown in Figure 3, the apparatus includes a data generating unit 301, a data obtaining unit 302, an information obtaining unit 303, a determining unit 304 and a sending unit 305.
The data generating unit 301 is to generate source data.
According to examples of the present disclosure, the data generating unit 301 may be implemented via a source process. The source process is a source for providing data, and the source process may generate the source data. The types of the source data are various, e.g. sound, images, and stream data etc.
The data obtaining unit 302 is to obtain the source data generated by the data generating unit 301.
The information obtaining unit 303 is to obtain transfer channel information of each target process.
The determining unit 304 is to determine at least one target process corresponding to
the source data and a transfer mode of sending the source data to each of the at least one target process according to the transfer channel information obtained by the information obtaining unit 303.
The sending unit 305 is to send the source data to each of the at least one target process by using a sending mode corresponding to the transfer mode of sending the source data to the target process determined by the determining unit 304.
According to the example, the source process obtains the source data and the transfer channel information of each target process, so as to determine the target process corresponding to the source data and to determine the transfer mode of sending the source data to the target process. Then, the source process sends the source data. In this way, multiple target processes may obtain the source data of the same source process. Further, it is unnecessary to wait for the finish of storing the source data, and the target process does not need to obtain the data by using the polling mode, so that the data transfer efficiency is improved. Moreover, each of the at least one target process obtains the source data separately, and thus the processing of obtaining the source data by each of the at least one target process does not affect each other.
In an example, the transfer channel information indicates a transfer mode and has various representing mode. Beside the transfer mode, other information may be used to indicate information of the source process and the target process that needs to obtain the source data. Based on different transfer modes, the transfer channel information may be represented via different modes. Some examples of the transfer channel information are provided as follows.
In an example, a monitoring thread is used. The information obtaining unit 303 obtains the transfer channel information of each target process by using the monitoring thread and determines whether each target process or the transfer channel information of each target process is changed.
In an example, an identifier of the transfer channel information may be configured, so that the source process may determine the target process which needs to obtain the source data. According to an example, the information obtaining unit 303 obtains a channel identifier including a target process identifier and a source process identifier.
In an example, the transfer mode may be implemented by using a shared storage block. The shared storage block may be a shared memory. The transfer channel may be other system objects and the transfer channel information may be implemented by using other modes, which are not limited in the examples of the present disclosure.
When the transfer mode is implemented by using the shared storage block, the information obtaining unit 303 obtains the channel identifier indicating a target address for storing the source data. The sending unit 305 stores the source data according to the target address, so that the target process may read the source data.
The embodiments of the present disclosure also provide the solutions of storing the source data according to the address indicated by the channel identifier.
In an example, as shown in Figure 4, the sending unit 305 includes an address obtaining unit 401 and a data writing unit 402.
The address obtaining unit 401 is to read the address indicated by the channel identifier by using a transfer thread.
The data writing unit 402 is to write the source data to the address indicated by the channel identifier, so that the target process may read the source data.
In an example, the transfer channel information may be stored by the target process. According to an example, the information obtaining unit 303 obtains the transfer channel information stored by the target process hooking the source process, after the source process is hooked by the target process.
The embodiments of the present disclosure also provide a data transfer apparatus. As shown in Figure 5, the data transfer apparatus includes a receiver 501, a transmitter 502, a processor 503 and storage 504.
The processor 503 is to generate and obtain source data; obtain transfer channel information of each target process; determine at least one target process corresponding to the source data and a transfer mode of sending the source data to each of the at least one target process according to the transfer channel information; send the source data to each of the at least one target process by using a sending mode corresponding to the transfer
mode of sending the source data to the target process.
According to examples of the present disclosure, the types of the source data are various, e.g. sound, images, and stream data etc.
According to the example, the processor obtains the source data and the transfer channel information of each target process, so as to determine the target process corresponding to the source data and to determine the transfer mode of sending the source data to the target process. Then, the processor sends the source data. In this way, multiple target processes may obtain the source data of the same source process. Further, it is unnecessary to wait for the finish of storing the source data, and the target process does not need to obtain the data by using the polling mode, so that the data transfer efficiency is improved. Moreover, each of the at least one target process obtains the source data separately, and thus the processing of obtaining the source data by each of the at least one target process does not affect each other.
In an example, the transfer channel information indicates a transfer mode and has various representing mode. Beside the transfer mode, other information may be used to indicate information of the source process and the target process that needs to obtain the source data. Based on different transfer modes, the transfer channel information may be represented via different modes. Some examples of the transfer channel information are provided as follows.
In an example, a monitoring thread is used. The processor 503 obtains the transfer channel information of each target process by using the monitoring thread and determines whether each target process or the transfer channel information of each target process is changed.
In an example, an identifier of the transfer channel information may be configured, so that the source process may determine the target process which needs to obtain the source data. According to an example, the processor 503 obtains a channel identifier including a target process identifier and a source process identifier.
In an example, the transfer mode may be implemented by using a shared storage block. The shared storage block may be a shared memory. The transfer channel may be
other system objects, and the transfer channel information may be implemented by using other modes, which are not limited in the examples of the present disclosure.
When the transfer mode is implemented by using the shared storage block, the processor 503 obtains the channel identifier indicating a target address for storing the source data; and stores the source data according to the target address, so that the target process may read the source data.
The embodiments of the present disclosure also provide the solutions of storing the source data according to the target address indicated by the channel identifier.
In an example, the processor 503 reads the target address indicated by the channel identifier by using a transfer thread; and writes the source data to the target address indicated by the channel identifier, so that the target process may read the source data.
In an example, the transfer channel information may be stored by the target process. According to an example, the processor 503 obtains the transfer channel information stored by the target process hooking the source process, after the source process is hooked by the target process.
The embodiments of the present disclosure further provide a data transfer apparatus. The apparatus may be a terminal device. In Figure 6, only parts related to the embodiment are shown. The apparatus may be a mobile phone, a tablet PC, a Personal Digital Assistant (PDA) , a Point of Sales (POS) , an on-board computer and etc. In the embodiment, the terminal device is a mobile phone.
Figure 6 is a schematic diagram illustrating a terminal device according to various embodiments of the present disclosure. As shown in Figure 6, the mobile phone may include a Radio Frequency (RF) circuit 610, storage 620 including at least one non-transitory machine-readable storage medium, an inputting unit 630, a displaying unit 640, a sensor 650, an audio circuit 660, a wireless fidelity (WiFi) module 670, a processor 680 including at least one processing core, a power 690 etc. The skilled in the art can know that the terminal device is not limited by a structure of the mobile phone as shown in Figure 6. In an embodiment, the terminal device may include more components or fewer components than that shown in Figure 6, or the mobile phone may combine some
of the components or may have different arrangement of the components.
The RF circuit 610 is to transmit and receive signals in call processes or in processes of transmitting and receiving information. The RF circuit 610 is further to transmit downlink information received from a base station to the processor 680. In addition, the RF circuit 610 is to transmit uplink data to the base station. The RF circuit 610 includes, but is not limited to, an antenna, at least one amplifier, a tuner, at least one oscillator, a subscriber identity module (SIM) card, a transceiver, a coupler, a low noise amplifier (LNA) , a diplexer etc. The RF circuit 610 communicates with a network or another communication device through wireless communication. Any of the following communication standards or protocols may be used in the wireless communication: Global System of Mobile communication (GSM) , General Packet Radio Service (GPRS) , Code Division Multiple Access (CDMA, Wideband Code Division Multiple Access (WCDMA) , Long Term Evolution (LTE) , Email, Short Messaging Service (SMS) etc.
The storage 620 is to store software program and modules. The processor 680 executes the software program and the modules stored in the storage 620 to perform function applications and data processing. The storage 620 may include a program storage area and a data storage area. The program storage area may store an operating system, application program corresponding to at least one function (e.g., a sound playing function, a video playing function) . The data storage area may store data created when the terminal device is used (e.g., audio data, contact data) . In addition, the storage 620 may include a high-speed random access memory, or the storage 620 may further include a non-transitory memory, such as at least one disk storage device, at least one flash memory device, or other volatile solid-state memory devices. The storage 620 may further include a memory controller, so that the processor 680 and the inputting unit 630 may access the storage 620.
The inputting unit 630 may receive an inputted number or character information, and generate an input signal of a key, a mouse, an operating rod, an optical or a track ball related with function control and user configuration. In an embodiment, the inputting unit 630 may include a touch panel 631 and another inputting device 632. The touch panel 631, which is also called a touch screen, may collect a touch operation performed by a user on or near the touch panel 631 (e.g., the user may perform an operation by using any suitable
object or an accessory on or near the touch panel 631) , and may drive a corresponding connection device according to preset program. In an embodiment, the touch panel 631 may include a touch detection apparatus and a touch controller. The touch detection apparatus is to detect a touch position, detect a signal generated by the touch operation, and transmit the signal to the touch controller. The touch controller is to receive touch information from the touch detection apparatus, convert the touch information to touch point coordinates, transmit the touch point coordinates to the processor 680, and receive a command from the processor 680 and execute the command. In an embodiment, the touch panel 631 is implemented by using a resistance-type, a capacitance-type, an infrared-type or a surface-acoustic-wave-type. Except the touch panel 631, the inputting unit 630 may further include another inputting device 632. The another inputting device 632 may include, but be not limited to, at least one of a physical keyboard, a function key (such as a volume control key, a key switch, etc. ) , a trackball, a mouse, and an operating rod.
The displaying unit 640 may display information inputted by the user, information provided to the user, or a graphical user interface of the terminal device. The graphical user interface may include at least one of a graphic, a character, an icon, video etc. The displaying unit 640 may include a displaying panel 641. In an embodiment, the displaying panel 641 is configured in a manner of Liquid Crystal Display (LCD) , Organic Light-Emitting Diode (OLED) . In an embodiment, the touch panel 631 may cover the displaying panel 641. When detecting the touch operation on or near the touch panel 631, the touch panel 631 transmits the touch operation to the processor 680 to determine a type of a touch event. Afterwards, the processor 680 provides a corresponding visual output in the displaying panel 641. Although the touch panel 631 and the displaying panel 641 are as two independent components to implement an inputting function and an outputting function, in some embodiments, the touch panel 631 and the displaying panel 641 may be integrated to implement the inputting function and the outputting function.
The mobile phone may further include at least one sensor 650, e.g., a light sensor, a motion sensor and another sensor. In an embodiment, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor adjusts brightness of the displaying panel 641 according to the brightness of the ambient light. The proximity sensor may close the displaying panel 641 and/or backlit when the mobile phone moves to an ear. As one kind of the motion sensor, an accelerometer sensor can
detect a value of acceleration in all directions (typically three-axis) , may detect a value and a direction of gravity in stationary, identify an application of a phone posture (such as switch between a horizontal screen and vertical screen, a related game, magnetometer posture calibration) , and identify a vibration recognition related function (such as a pedometer, a percussion) . Another sensor such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor may be configured in the mobile phone, which is not described repeatedly herein.
The audio circuit 660, a speaker 661 and a microphone 662 may provide an audio interface between the user and the mobile phone. The audio circuit 660 may transmit an electric signal transformed from received audio data to the speaker 661. The speaker 661 transforms the electric signal to a sound signal and outputs the sound signal. The microphone 662 transforms collected sound signal to an electric signal. The audio circuit 660 receives the electric signal and transforms the electric signal to audio data, and output the audio data to the processor 680 to be processed. After the audio data is processed by the processor 680, the audio data is transmitted to another terminal device via the RF circuit 610, or the audio data is outputted and stored by the memory 620 for further processing. The audio circuit 660 may further include an earphone jack, so that an earphone may communicate with the mobile phone.
The WiFi belongs to short-range wireless transmission technology. By using the WiFi module 670 of the mobile phone, the user may access a wireless broadband internet, transmit and receive an Email, browse a webpage and access streaming media. The wireless module 670 is shown in Figure 6. It can be known that the WiFi module 670 is not an essential component of the terminal device, and may be omitted as requirements when not changing the nature of the present disclosure.
The processor 680 is a control center of the mobile phone. The processor 680 is to connect all components of the terminal device via various interfaces and circuits, run the software program and/or module stored in the memory 620, call data stored in the memory 620, so as to execute various functions and perform data processing for the mobile phone. In an embodiment, the processor 680 may include at least one processing core. In an embodiment, the processor 680 may include an application processor and a modem processor. The application processor processes an operation system, user
interfaces and application programs. The modem processor processes wireless communication. It can be known that the modem processor may not be integrated in the processor 680.
The mobile phone may further include a power 690 (e.g., a battery) supplying power for each component. In an embodiment, the power may connect with the processor 680 through a power management system, so that functions, e.g., a charging management function, a discharging management function, a power management function, can be implemented through the power management system. The power 690 may further include at least one direct current power supply or alternating current power supply, a recharging system, a power failure detection circuit, a power converter and a power inverter, and a power status indicator.
The mobile phone may further include a camera, a blue tooth module, which is not illustrated in Figure 6. In an embodiment, the displaying unit of the terminal device is touch screen display. The terminal device also includes storage and at least one program. The at least one program is stored in the storage. When the at least one processor executes the at least one program, the following operations are performed. Source data are generated and obtained, and transfer channel information of each target process is obtained. At least one target process corresponding to the source data and a transfer mode of sending the source data to each of the at least one target process are determined according to the transfer channel information. The source data are sent to each of the at least one target process by using a sending mode corresponding to the transfer mode of sending the source data to the target process.
According to examples of the present disclosure, the types of the source data are various, e.g. sound, images, and stream data etc.
According to the example, the source data and the transfer channel information of each target process are obtained to determine the target process corresponding to the source data and to determine the transfer mode of sending the source data to the target process. Then, the source process sends the source data. In this way, multiple target processes may obtain the source data of the same source process. Further, it is unnecessary to wait for the finish of storing the source data and the target process does
not need to obtain the data by using the polling mode, so that the data transfer efficiency is improved. Moreover, each of the target processes obtains the source data separately, and thus the processing of obtaining the source data by each of the target processes does not affect each other.
The transfer channel information indicates a transfer mode and has various representing mode. Beside the transfer mode, other information may be used to indicate information of the source process and the target process that needs to obtain the source data. Based on different transfer modes, the transfer channel information may be represented via different modes. Some examples of the transfer channel information are provided as follows.
In an example, a monitoring thread is used. The processor 680 obtains the transfer channel information of each target process by using the monitoring thread, and determines whether each target process or the transfer channel information of each target process is changed.
In addition, an identifier of the transfer channel information may be configured, so that the source process may determine the target process which needs to obtain the source data. According to an example, when the processor 680 obtains the transfer channel information of each target process, a channel identifier is obtained, and the channel identifier is an identifier pair including a target process identifier and a source process identifier.
According to an example, the transfer mode may be implemented by using a shared storage block. The shared storage block may be a shared memory. The transfer channel may be other system objects and the transfer channel information may be implemented by using other modes, which are not limited in the examples of the present disclosure.
When the transfer mode is implemented by using the shared storage block, the channel identifier indicates a target address for storing the source data. When the processor 680 sends the source data to the target process, the processor 680 stores the source data to the target address, so that the target process may read the source data.
The embodiments of the present disclosure also provide the solutions of storing the
source data according to the target address indicated by the channel identifier.
In an example, the processor 680 reads the target address indicated by the channel identifier by using a transfer thread; and writes the source data to the target address indicated by the channel identifier, so that the target process may read the source data.
According to an example, the transfer channel information may be stored by the target process. In the process of obtaining the transfer channel information of the target process, the processor 680 obtains the transfer channel information stored by the target process hooking the source process, after the source process is hooked by the target process.
It should be noted that, persons having ordinary skill in the art may understand that the units in the apparatus are divided according logic functions, and the apparatus may be divided into other units which may implement the functions of the apparatus. In addition, the names of the units are used to identify the units and are used to limit the protection scope of the present disclosure.
In addition, persons having ordinary skill in the art may understand that the parts of or all of the processing in the method embodiments of the present disclosure may be implemented via hardware instructed by programs. The programs may be stored in non-transitory computer readable storage medium, such as Optical Disk (CD) or hard disk.
The foregoing is only preferred embodiments of the present invention, and the protection scope of the present invention is not limited to this. Any improvement and replacement which can be made in the technical scope disclosed by the present invention by those skilled in the art should be covered in the protection scope of the invention. And thus, the protection scope of the present invention should be defined by the claims.
Claims (15)
- A data transfer method, comprising:generating and obtaining source data;obtaining transfer channel information of each target process;determining at least one target process corresponding to the source data and a transfer mode of sending the source data to each of the at least one target process according to the transfer channel information; andsending the source data to each of the at least one target process by using a sending mode corresponding to the transfer mode of sending the source data to the target process.
- The method of claim 1, wherein obtaining the transfer channel information of each target process comprises:obtaining the transfer channel information of each target process via a monitoring thread and determining whether the target process or the transfer channel information of the target process is changed.
- The method of claim 1, wherein obtaining the transfer channel information of each target process comprises:obtaining a channel identifier comprising an identifier of the target process and an identifier of a source process of the source data.
- The method of claim 3, wherein the channel identifier indicates a target address for storing the source data; andsending the source data to each of the at least one target process comprises:storing the source data according to the target address, the source data being obtained by the target process from the target address.
- The method of claim 4, wherein storing the source data according to the target address comprises:reading the target address indicated by the channel identifier by using a transfer thread; and writing the source data to the target address indicated by the channel identifier.
- The method of claim 1, wherein obtaining the transfer channel information of each target process comprises:obtaining the transfer channel information stored by the target process hooking a source process of the source data, after the source process is hooked by the target process.
- The method of any of claims 1 to 6, wherein the number of the target process corresponding to the source data is larger than or equal to two.
- The method of any of claims 1 to 6, wherein a source process of the source data is an audio player process.
- A data transfer apparatus, comprising:a data generating unit, to generate source data;a data obtaining unit, to obtain the source data generated by the data generating unit;an information obtaining unit, to obtain transfer channel information of each target process;a determining unit, to determine at least one target process corresponding to the source data and a transfer mode of sending the source data to each of the at least one target process according to the transfer channel information obtained by the information obtaining unit; anda sending unit, to send the source data to each of the at least one target process by using a sending mode corresponding to the transfer mode of sending the source data to the target process.
- The apparatus of claim 9, whereinthe information obtaining unit is to obtain the transfer channel information of each target process via a monitoring thread and determine whether the target process or the transfer channel information of the target process is changed.
- The apparatus of claim 10, whereinthe information obtaining unit is to obtain a channel identifier comprising an identifier of the target process and an identifier of a source process of the source data.
- The apparatus of claim 11, whereinthe information obtaining unit is to obtain the channel identifier indicating a target address for storing the source data;the sending unit is to store the source data according to the target address, the source data being obtained by the target process from the target address.
- The apparatus of claim 12, wherein the sending unit comprises:an address obtaining unit, to read the target address indicated by the channel identifier by using a transfer thread; anda data writing unit, to write the source data to the target address indicated by the channel identifier.
- The apparatus of claim 9, whereinthe information obtaining unit is to obtain the transfer channel information stored by the target process hooking a source process of the source data, after the source process is hooked by the target process.
- A non-transitory machine-readable storage medium, storing computer programs, which, when executed by a processor, will cause the processor togenerate and obtain source data;obtain transfer channel information of each target process;determine at least one target process corresponding to the source data and a transfer mode of sending the source data to each of the at least one target process according to the transfer channel information;send the source data to each of the at least one target process by using a sending mode corresponding to the transfer mode of sending the source data to the target process.
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201310576452.X | 2013-11-18 | ||
| CN201310576452.XA CN103593247B (en) | 2013-11-18 | 2013-11-18 | Method and device for data transmission |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2015070769A1 true WO2015070769A1 (en) | 2015-05-21 |
Family
ID=50083402
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2014/090963 Ceased WO2015070769A1 (en) | 2013-11-18 | 2014-11-13 | Data transfer method and apparatus |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN103593247B (en) |
| WO (1) | WO2015070769A1 (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105550049A (en) * | 2015-12-16 | 2016-05-04 | 汉柏科技有限公司 | Communication system and use method thereof |
| CN111511045A (en) * | 2020-04-10 | 2020-08-07 | 玳能科技(杭州)有限公司 | Interaction method and device of mobile terminal and computer, electronic equipment and storage medium |
| CN117938848A (en) * | 2023-12-11 | 2024-04-26 | 超聚变数字技术有限公司 | Data transmission method, transmission channel allocation method, computing device and management device |
Families Citing this family (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103593247B (en) * | 2013-11-18 | 2017-02-08 | 腾讯科技(成都)有限公司 | Method and device for data transmission |
| CN104410687B (en) * | 2014-11-26 | 2018-01-19 | 上海爱数信息技术股份有限公司 | A kind of multigroup inter-process data transmission method based on pipeline |
| CN105468360B (en) * | 2015-11-17 | 2018-09-21 | 南京邮电大学 | A kind of data cutout method towards third party's audio player |
| CN111045700B (en) * | 2018-10-15 | 2023-05-05 | 阿里巴巴集团控股有限公司 | Data updating method, device, system, storage medium and electronic equipment |
| CN111290744B (en) * | 2020-01-22 | 2023-07-21 | 北京百度网讯科技有限公司 | Flow computing job processing method, flow computing system and electronic device |
| CN115794443B (en) * | 2023-01-29 | 2023-05-23 | 北京万里红科技有限公司 | Method and device for multi-process communication based on shared memory |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070198676A1 (en) * | 2006-01-20 | 2007-08-23 | Vertes Marc P | Non-intrusive method for simulation or replay of external events related to an application process, and a system implementing said method |
| CN101296130A (en) * | 2008-05-30 | 2008-10-29 | 北京同步科技有限公司 | System and method for multi-process sharing port receiving network message |
| CN102819455A (en) * | 2012-07-31 | 2012-12-12 | 深圳市共进电子股份有限公司 | Method for managing progresses at application layer and managing system |
| CN103593247A (en) * | 2013-11-18 | 2014-02-19 | 腾讯科技(成都)有限公司 | Method and device for data transmission |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070011338A1 (en) * | 2005-06-08 | 2007-01-11 | Logitech Europe S.A. | System and method for transparently processing multimedia data |
| US8606950B2 (en) * | 2005-06-08 | 2013-12-10 | Logitech Europe S.A. | System and method for transparently processing multimedia data |
| CN100421469C (en) * | 2005-12-23 | 2008-09-24 | 华为技术有限公司 | System and method for realizing real-time video information sharing |
| US8171483B2 (en) * | 2007-10-20 | 2012-05-01 | Citrix Systems, Inc. | Method and system for communicating between isolation environments |
| CN103150220B (en) * | 2011-12-07 | 2016-08-31 | 腾讯科技(深圳)有限公司 | Communication means between process and communication system |
-
2013
- 2013-11-18 CN CN201310576452.XA patent/CN103593247B/en active Active
-
2014
- 2014-11-13 WO PCT/CN2014/090963 patent/WO2015070769A1/en not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070198676A1 (en) * | 2006-01-20 | 2007-08-23 | Vertes Marc P | Non-intrusive method for simulation or replay of external events related to an application process, and a system implementing said method |
| CN101296130A (en) * | 2008-05-30 | 2008-10-29 | 北京同步科技有限公司 | System and method for multi-process sharing port receiving network message |
| CN102819455A (en) * | 2012-07-31 | 2012-12-12 | 深圳市共进电子股份有限公司 | Method for managing progresses at application layer and managing system |
| CN103593247A (en) * | 2013-11-18 | 2014-02-19 | 腾讯科技(成都)有限公司 | Method and device for data transmission |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105550049A (en) * | 2015-12-16 | 2016-05-04 | 汉柏科技有限公司 | Communication system and use method thereof |
| CN111511045A (en) * | 2020-04-10 | 2020-08-07 | 玳能科技(杭州)有限公司 | Interaction method and device of mobile terminal and computer, electronic equipment and storage medium |
| CN117938848A (en) * | 2023-12-11 | 2024-04-26 | 超聚变数字技术有限公司 | Data transmission method, transmission channel allocation method, computing device and management device |
Also Published As
| Publication number | Publication date |
|---|---|
| CN103593247A (en) | 2014-02-19 |
| CN103593247B (en) | 2017-02-08 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2015070769A1 (en) | Data transfer method and apparatus | |
| CN104518953B (en) | Method for deleting message, instant communication terminal and system | |
| US10057627B2 (en) | Method, apparatus and system for displaying bullet screen information | |
| CN107368518B (en) | Notification message management method, terminal and computer readable storage medium | |
| CN104852885B (en) | Method, device and system for verifying verification code | |
| CN104967896A (en) | Method for displaying bulletscreen comment information, and apparatus thereof | |
| CN104571979B (en) | A kind of method and apparatus for realizing split view | |
| CN106371964B (en) | Method and device for prompting message | |
| US11216997B2 (en) | Method and apparatus for displaying historical chat record | |
| CN104518945B (en) | A kind of transmission, the methods, devices and systems of reception social network information | |
| US20180336392A1 (en) | Method for capturing fingerprint and associated products | |
| CN104699973A (en) | Method and device for controlling logic of questionnaires | |
| WO2015007163A1 (en) | Method and apparatus for processing message | |
| CN104869465A (en) | Video playing control method and device | |
| CN104967865A (en) | Video previewing method and apparatus | |
| US20210124480A1 (en) | Split view exiting method, split view exiting device, and electronic device | |
| CN103581762A (en) | Method, device and terminal equipment for playing network videos | |
| TW201541337A (en) | Method, device and system for displaying messages in mobile terminal | |
| CN107104930A (en) | It is a kind of that the methods, devices and systems for checking authority are set | |
| CN107977261A (en) | Method, equipment, mobile terminal and the computer-readable storage medium of limiting process | |
| CN109495769B (en) | Video communication method, terminal, smart television, server and storage medium | |
| CN107786423B (en) | A kind of method and system of instant messaging | |
| CN106302101B (en) | Message reminding method, terminal and server | |
| CN106339391B (en) | Webpage display method and terminal equipment | |
| CN107622234B (en) | Method and device for displaying budding face gift |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 14862892 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 26/07/2016) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 14862892 Country of ref document: EP Kind code of ref document: A1 |