CN103970593A - Multi-process interaction method and system - Google Patents

Multi-process interaction method and system Download PDF

Info

Publication number
CN103970593A
CN103970593A CN201310035181.7A CN201310035181A CN103970593A CN 103970593 A CN103970593 A CN 103970593A CN 201310035181 A CN201310035181 A CN 201310035181A CN 103970593 A CN103970593 A CN 103970593A
Authority
CN
China
Prior art keywords
message data
speed
download
memory space
shared memory
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
CN201310035181.7A
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.)
TIANJIN MIYOU TECHNOLOGY CO., LTD.
Original Assignee
Cloud Link (beijing) 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 Cloud Link (beijing) Information Technology Co Ltd filed Critical Cloud Link (beijing) Information Technology Co Ltd
Priority to CN201310035181.7A priority Critical patent/CN103970593A/en
Publication of CN103970593A publication Critical patent/CN103970593A/en
Pending legal-status Critical Current

Links

Abstract

The invention provides a multi-process interaction method and a multi-process interaction system. The method comprises the following steps that at least one shared memory space in a memory is applied for and registered, and a process for read operation and write operation over the shared memory space is defined; first message data is written for requesting for the running of the process into the shared memory space by using another process; a current file downloading process reads the first message data from the shared memory space, compares the first message data with a first mapping file in the memory, and acquires and executes an instruction; the another process writes second message data for ending the running of the process into the shared memory space; the current file downloading process reads the second message data from the shared memory space, compares the second message data with a second mapping file in the memory, and acquires and executes an instruction. According to the method and the system, the downloading process and the another process are automatically switched, and loads of the downloading process and the another process are balanced.

Description

A kind of multi-process exchange method and system
Technical field
The application relates to a kind of multi-process exchange method and system.
Background technology
Download is to carry out transfer files by network, and the information on internet or other robot calculator is saved in to a kind of network activity on local computing.Current downloading mode mainly comprises WEB download, BT download, P2P download etc.
If need to suspend or limit speed of download to move other processes in the time that downloading process is moved; during as displaying video, test network speed; mainly or by the mode of manual setting downloading process suspended or reset speed of download at present, thereby causing the switching between process to expend the long period.
Summary of the invention
Technical problems to be solved in this application are to provide a kind of multi-process exchange method, comprising:
In internal memory, apply at least one shared memory space, register described shared memory space and define the process of described shared memory space being carried out to read operation and write operation;
Another process is moved the first message data of described process to described shared memory space write request;
Current file downloading process is read described the first message data from described shared memory space, the first mapped file in described the first message data and internal memory is compared, obtain and carry out described instruction, wherein, described the first mapped file comprises the corresponding relation of the instruction of described the first message data and described current file downloading process, described instruction comprises file downloading speed is limited in speed of download threshold range, wherein, and 0≤described threshold value≤current file speed of download;
Described another process writes the second message data of described process end of run to described shared memory space;
Described current file downloading process is read described the second message data from described shared memory space, the second mapped file in described the second message data and internal memory is compared, obtain and carry out described instruction, wherein, described the second mapped file comprises the corresponding relation of the instruction of described the second message data and described current file downloading process, and described instruction comprises that speed of download is returned to described current file speed of download to be limited to current file speed of download in described speed of download threshold range with continuing.
Preferably, the described memory headroom of described registration further comprises that registration allows all processes of the described shared memory space of access and carries out mutual message data form for described process.
Preferably, described another process writes described shared memory space by sending WM_COPYDATA message by described the first message data and described the second message data; Described file downloading process is read described the first message data and described the second message data by receiving WM_COPYDATA message from described shared memory space.
Preferably, described another process is the test process for test network situation, and described the second message packets includes network situation meets network threshold condition and network condition exceeds network threshold condition; The corresponding relation of the instruction of described the second message data and described current file downloading process comprises in the time that described network condition meets network threshold condition, continue current file speed of download to be limited within the scope of described network threshold, in the time that described network condition exceeds network threshold condition, speed of download is returned to described initial download speed.
The application also provides a kind of multi-process exchange method, comprising:
In internal memory, apply at least one shared memory space, register described shared memory space and define the process of described shared memory space being carried out to read operation and write operation;
Another process writes the first message data of moving described process to described shared memory space;
Current file downloading process is read described the first message data from described shared memory space, the first mapped file in described the first message data and internal memory is compared, obtain and carry out described instruction, wherein, described the first mapped file comprises the corresponding relation of the instruction of described the first message data and described current file downloading process, and described instruction comprises the described current file speed of download of continuation;
Described another process writes the second message data of described process end of run to described shared memory space;
Described current file downloading process is read described the second message data from described shared memory space, the second mapped file in described the second message data and internal memory is compared, obtain and carry out described instruction, wherein, described the second mapped file comprises the corresponding relation of the instruction of described the second message data and described current file downloading process, described instruction comprises and speed of download is returned to described current file speed of download and file downloading speed is limited in speed of download threshold range, wherein, 0≤described threshold value≤current file speed of download.
Preferably, the described memory headroom of described registration further comprises that registration allows the title of all processes of accessing described memory headroom and carries out mutual message data form for described process.
Preferably, described another process writes described shared memory space by sending WM_COPYDATA message by described the first message data and described the second message data; Described file downloading process is read described the first message data and described the second message data by receiving WM_COPYDATA message from described shared memory space.
Preferably, described another process is the test process for the idle situation of testing server, and described the second message data comprises test to idle server and do not test idle server; The corresponding relation of the instruction of described the second message data and described current file downloading process comprises in the time testing idle server, continue current file speed of download to be limited in described speed of download threshold range, in the time that test is not to idle server, speed of download is returned to described current file speed of download.
Correspondingly, the application provides a kind of multi-process interactive systems, comprising:
Memory headroom application module, for apply at least one shared memory space at internal memory, registers described shared memory space and defines the process of described shared memory space being carried out to read operation and write operation;
The first message data writing module, moves the first message data of described process to described shared memory space write request for another process;
The first message data is read module, read described the first message data for current file downloading process from described shared memory space, the first mapped file in described the first message data and internal memory is compared, obtain and carry out described instruction, wherein, described the first mapped file comprises the corresponding relation of the instruction of described the first message data and described current file downloading process, described instruction comprises current file speed of download is limited in speed of download threshold range, wherein, 0≤described threshold value≤current file speed of download;
The second message data writing module, writes the second message data of described process end of run to described shared memory space for described another process;
The second message data is read module, read described the second message data for described current file downloading process from described shared memory space, the second mapped file in described the second message data and internal memory is compared, obtain and carry out described instruction, wherein, described the second mapped file comprises the corresponding relation of the instruction of described the second message data and described current file downloading process, and described instruction comprises that speed of download is returned to described current file speed of download to be limited to current file speed of download in described speed of download threshold range with continuing.
Correspondingly, the application also provides a kind of multi-process interactive systems, comprising:
Memory headroom application module, for apply at least one shared memory space at internal memory, registers described shared memory space and defines the process of described shared memory space being carried out to read operation and write operation;
The first message data writing module, writes the first message data of moving described process to described shared memory space for another process;
The first message data processing module, read described the first message data for current file downloading process from described shared memory space, the first mapped file in described the first message data and internal memory is compared, obtain and carry out described instruction, wherein, described the first mapped file comprises the corresponding relation of the instruction of described the first message data and described current file downloading process, and described instruction comprises the described current file speed of download of continuation;
The second message data writing module, writes the second message data of described process end of run to described shared memory space for described another process;
The second message data processing module, read described the second message data for described current file downloading process from described shared memory space, the second mapped file in described the second message data and internal memory is compared, obtain and carry out described instruction, wherein, described the second mapped file comprises the corresponding relation of the instruction of described the second message data and described current file downloading process, described instruction comprises and speed of download is returned to described current file speed of download and current file speed of download is limited in speed of download threshold range, wherein, 0≤described threshold value≤current file speed of download.
Compared with prior art, the application sets up dialogue mechanism between file downloading process and another process, the message comprising in agreement request in downloading process in advance and the corresponding relation of threshold range, file downloading process is in the time receiving the operation request that another process sends, according to described corresponding relation, file downloading speed is limited to corresponding threshold range, and in this file downloading process of the follow-up reforwarding row of another process end of run, automatic switchover and load balancing between downloading process and another process are realized, thereby no longer need user, in order to move other processes, speed of download is manually set.
Brief description of the drawings
Fig. 1 is the process flow diagram of the application's the first multi-process management method.
Fig. 2 is the process flow diagram of the application's the first multi-process management method embodiment.
Fig. 3 is the process flow diagram of the application's the second multi-process management method.
Fig. 4 is the process flow diagram of the application's the second multi-process management method embodiment.
Fig. 5 is the schematic diagram of the application's the first multi-process management system.
Fig. 6 is the schematic diagram of the application's the second multi-process management system.
Embodiment
For the above-mentioned purpose, the feature and advantage that make the application can become apparent more, below in conjunction with the drawings and specific embodiments, the application is described in further detail.
With reference to Fig. 1, show the process flow diagram of the application's the first multi-process management method.
Step S11: apply at least one shared memory space in internal memory, register described shared memory space and define the process of described shared memory space being carried out to read operation and write operation.
For each process, before process operation, be first loaded in corresponding memory headroom.In an embodiment of the present invention, respectively current file downloading process and another process are loaded into two memory headrooms.By calling shared memory space of following api function application:
#include<sys/ipc.h>
#include<sys/shm.h>
int shmget(key_t key,size_t size,int shmflg);
The content of shared memory space registration comprises that registration allows all processes of the described shared memory space of access and carries out mutual message data form for described process.In an embodiment of the present invention, allowing the process of the described shared memory space of access is current file downloading process and another process, carries out mutual message data formal definition at header file shm.h for these two processes:
In code, main field implication is as follows:
Shm_perm: operation license, the information such as user ID, group ID that the inside comprises shared drive.
Shm_segsz: the size of common memory section, taking byte as unit.
Shm_cpid: the process ID that creates shared drive.
Shm_lpid: the process ID of last operation shared drive.
Shm_nattch: the number of processes of current this common memory section of use.
In addition, also need definition shared memory space to be carried out to the process of read operation and write operation, in an embodiment of the present invention, definition current file downloading process is carried out read operation to shared memory space, and another process is carried out write operation to shared memory space.After shared memory space has been registered, current file downloading process and another process are mapped to this shared memory space by calling shmat function the privately owned memory headroom of oneself, as follows:
#include<sys/types.h>
#include<sys/shm.h>
Void*shmat(intt shmid,const void*shmaddr,int shmflg);
Wherein, shmid is the identifier of shared drive.
Step S12: another process is moved the first message data of described process to described shared memory space write request.
Another process writes described shared memory space by sending WM_COPYDATA message by described the first message data and described the second message data.
In an embodiment of the present invention; the process that another process writes message data to described shared memory space is the process that sends WM_COPYDATA message; specifically by SendMessage (receiving process handle; WM_COPYDATA; (WPARAM) send process handle, (LPARAM) & CopyData) send;
CopyData is wherein COPYDATASTRUCT structure type, and this organization definition is as follows:
Step S13: current file downloading process is read described the first message data from described shared memory space, the first mapped file in described the first message data and internal memory is compared, obtain and carry out described instruction, wherein, described the first mapped file comprises the corresponding relation of the instruction of described the first message data and described current file downloading process, described instruction comprises file downloading speed is limited in speed of download threshold range, wherein, and 0≤described threshold value≤current file speed of download.
Described file downloading process is read described the first message data and described the second message data by receiving WM_COPYDATA message from described shared memory space.
Reading message from described shared memory space is by using COPYDATASTRUCT*pCopyData=(COPYDATASTRUCT*) lParam to receive WM_COPYDATA message.
Loading when another process, load the first mapped file simultaneously, this mapped file has comprised the mapping relations of the instruction of message that another process sends and current file downloading process.CPU reads after the first message data from internal memory, and the comparator module in CPU compares this message and instruction, finds the instruction corresponding with this message, and moves this instruction.
This instruction comprises file downloading speed is limited in threshold range, wherein, 0≤described threshold value≤current file speed of download, for example file downloading speed can be 0, downloading process is suspended; File downloading speed also can be less than current file speed of download (being original document speed of download), and this speed can represent by dedicated bandwidth.
Step S14: described another process writes the second message data of described process end of run to described shared memory space.
In the time of another process end of run, operation result is sent to current file downloading process by WM_COPYDATA message, write operation result to described shared memory space.
Step S15: described current file downloading process is read described the second message data from described shared memory space, the second mapped file in described the second message data and internal memory is compared, obtain and carry out described instruction, wherein, described the second mapped file comprises the corresponding relation of the instruction of described the second message data and described current file downloading process, and described instruction comprises that speed of download is returned to described current file speed of download to be limited to current file speed of download in described speed of download threshold range with continuing.
Reading message from described shared memory space is by using COPYDATASTRUCT*pCopyData=(COPYDATASTRUCT*) lParam to receive WM_COPYDATA message equally.
Loading when another process, load the second mapped file simultaneously, this mapped file has comprised the mapping relations of the instruction of message that another process sends and current file downloading process.CPU reads after the second message data from internal memory, and the comparator module in CPU compares this message and instruction, finds the instruction corresponding with this message, and moves this instruction.
This instruction comprises that speed of download is returned to described current file speed of download to be limited to current file speed of download in described threshold range with continuing.File downloading speed is limited in threshold range and refers to 0≤described threshold value≤current file speed of download, and for example file downloading speed can be 0, and downloading process is suspended; File downloading speed also can be less than current file speed of download (being original document speed of download), and this speed can represent by dedicated bandwidth.
With reference to Fig. 2, show the process flow diagram of the application's the first multi-process management method embodiment.
Step S21: apply at least one shared memory space in internal memory, register described shared memory space and define the process of described shared memory space being carried out to read operation and write operation.
Step S22: test process moves the first message data of described process to described shared memory space write request.
Described test process is for test network situation, and network condition comprises the network bandwidth, the network connection speed etc. of client to described far-end server.
" network bandwidth " refers to network data transmission rate, is taking " byte per second " as unit, and the network bandwidth also can be thought network speed (flow), and relation is between the two as follows:
Bandwidth/8=flow,
Be 1M/8=1Mps/8=1024Kps/8=128k/s.
" network connection speed " refers to that client is connected to the real-time speed of a certain server, if network node is many, the router from client to Servers installed, switch and data conversion equipment are more, carry out the just length of time that data-switching expends, network connection speed is just slow, if network node is few, carry out the time that data-switching expends short, just network connection speed is fast.
The method that test procedure uses comprises from described multiple available far-end servers downloads preset file; And the speed of download of adding up described preset file.
The method is preset one file that is exclusively used in test in each server, and in the time that test procedure starts, this file is sent to client by server, and the speed of download of preset file is:
Size/the download time of the speed of download=preset file of preset file.
The speed of download of preset file is exactly network speed, and this network speed is descending network speed.
The method that test procedure uses also comprises to described multiple available far-end servers transmission connection requests; And add up the response time that described multiple available far-end server feeds back described connection request.
The method is by using ping(the Internet packets survey meter) program test network-in-dialing situation and network connection speed.Ping is also time delay, it is a part for tcp/ip agreement, ping sends an ICMP (Internet Control Messages Protocol, be the Internet letter report control protocol) request data package, whether echo request message receives desirable ICMP Echo Reply to destination report.Its application form is: ping+IP address.This order can also add many parameters and use, and in an embodiment of the present invention, the form of ping order is ping+ website domain name.
The operation result of Ping program comprises the response time, if operation result comprises the response time, illustrate that client can be communicated with server, and the response time is shorter, illustrates that the connection speed of client and server is faster; If operation result does not have the response time, if operation result is " Request timed out ", illustrate that client can not be connected with server, now, this server can not use.
Step S23: current file downloading process is read described the first message data from described shared memory space, the first mapped file in described the first message data and internal memory is compared, obtain and carry out described instruction, wherein, described the first mapped file comprises the corresponding relation of the instruction of described the first message data and described current file downloading process, described instruction comprises file downloading speed is limited in speed of download threshold range, wherein, and 0≤described threshold value≤current file speed of download.
Step S24: described test process writes the second message data of described process end of run to described shared memory space.
Described the second message packets includes network situation meets threshold condition and network condition exceeds threshold condition.In the time that the network condition of test is the network bandwidth, threshold condition can be a certain bandwidth value, as 4M; In the time that the network condition of test is network connection speed, threshold condition can be a certain ping value, as 60s.
Step S25: described current file downloading process is read described the second message data from described shared memory space, the second mapped file in described the second message data and internal memory is compared, obtain and carry out described instruction, wherein, described the second mapped file comprises the corresponding relation of the instruction of described the second message data and described current file downloading process, and described instruction comprises that speed of download is returned to described current file speed of download to be limited to current file speed of download in described speed of download threshold range with continuing.
The corresponding relation of the instruction of described the second message data and described current file downloading process comprises in the time that described network condition meets network threshold condition, continue current file speed of download to be limited in described speed of download threshold range, in the time that described network condition exceeds network threshold condition, speed of download is returned to described current file speed of download.For example, in the time that the network bandwidth is greater than 4M, continues to suspend current file downloading process, and move A process.In the time that the network bandwidth is less than 4M, speed of download is returned to described current file speed of download.
With reference to Fig. 3, show the process flow diagram of the application's the second multi-process management method embodiment.
Step S31: apply at least one shared memory space in internal memory, register described shared memory space and define the process of described shared memory space being carried out to read operation and write operation.
Step S32: test process writes the first message data of moving described process to described shared memory space.
Step S33: current file downloading process is read described the first message data from described shared memory space, the first mapped file in described the first message data and internal memory is compared, obtain and carry out described instruction, wherein, described the first mapped file comprises the corresponding relation of the instruction of described the first message data and described current file downloading process, described instruction comprises file downloading speed is limited in speed of download threshold range, wherein, and 0≤described threshold value≤current file speed of download.
The corresponding relation of the instruction of described the second message data and described current file downloading process comprises in the time that described network condition meets network threshold condition, continue current file speed of download to be limited in described speed of download threshold range, in the time that described network condition exceeds network threshold condition, speed of download is returned to described current file speed of download.For example, in the time that the network bandwidth is greater than 4M, continues to suspend current file downloading process, and move A process.In the time that the network bandwidth is less than 4M, speed of download is returned to described current file speed of download.
Described file downloading process is read described the first message data and described the second message data by receiving WM_COPYDATA message from described shared memory space.
Reading message from described shared memory space is by using COPYDATASTRUCT * pCopyData=(COPYDATASTRUCT*) lParam to receive WM_COPYDATA message.
Loading when test process, load the first mapped file simultaneously, this mapped file has comprised the mapping relations of the instruction of message that test process sends and current file downloading process.CPU reads after the first message data from internal memory, and the comparator module in CPU compares this message and instruction, finds the instruction corresponding with this message, and moves this instruction.
This instruction comprises the described current file speed of download of continuation, and, in the time that test process moves this test process to the request of current file downloading process, current file downloading process is not subject to the impact of this request, continues with original speed of download download file.
Step S34: described test process writes the second message data of described process end of run to described shared memory space.
Step S35: described current file downloading process is read described the second message data from described shared memory space, the second mapped file in described the second message data and internal memory is compared, obtain and carry out described instruction, wherein, described the second mapped file comprises the corresponding relation of the instruction of described the second message data and described current file downloading process, and described instruction comprises that speed of download is returned to described current file speed of download to be limited to current file speed of download in described speed of download threshold range with continuing.
With reference to Fig. 4, show the process flow diagram of the application's the second multi-process management method embodiment.
Step S41: apply at least one shared memory space in internal memory, register described shared memory space and define the process of described shared memory space being carried out to read operation and write operation.
Step S42: test process moves the first message data of described process to described shared memory space write request.
Described test process is used for the idle situation of testing server, and described the second message data comprises test to idle server and do not test idle server; The corresponding relation of the instruction of described the second message data and described current file downloading process comprises in the time testing idle server, continue current file speed of download to be limited in described speed of download threshold range, in the time that test is not to idle server, speed of download is returned to described current file speed of download.
The idle situation of testing server refers to that a certain server is idle or occupied, if idle, can use, if occupied, can not use.In the time testing idle server, continue current file speed of download to be limited in described speed of download threshold range, and the next process that operation is associated with test process, as running game process.In the time that test is not to idle server, speed of download is returned to described current file speed of download.
Step S43: current file downloading process is read described the first message data from described shared memory space, the first mapped file in described the first message data and internal memory is compared, obtain and carry out described instruction, wherein, described the first mapped file comprises the corresponding relation of the instruction of described the first message data and described current file downloading process, and described instruction comprises the described current file speed of download of continuation.
Step S44: described test process writes the second message data of described process end of run to described shared memory space.
Described the second message packets includes network situation meets threshold condition and network condition exceeds threshold condition.In the time that the network condition of test is the network bandwidth, threshold condition can be a certain bandwidth value, as 4M; In the time that the network condition of test is network connection speed, threshold condition can be a certain ping value, as 60s.
Step S45: described current file downloading process is read described the second message data from described shared memory space, the second mapped file in described the second message data and internal memory is compared, obtain and carry out described instruction, wherein, described the second mapped file comprises the corresponding relation of the instruction of described the second message data and described current file downloading process, described instruction comprises and speed of download is returned to described current file speed of download and file downloading speed is limited in speed of download threshold range, wherein, 0≤described threshold value≤current file speed of download.
The corresponding relation of the instruction of described the second message data and described current file downloading process comprises in the time that described network condition meets network threshold condition, continue current file speed of download to be limited in described speed of download threshold range, in the time that described network condition exceeds network threshold condition, speed of download is returned to described current file speed of download.For example, in the time that the network bandwidth is greater than 4M, continues to suspend current file downloading process, and move A process.In the time that the network bandwidth is less than 4M, speed of download is returned to described current file speed of download.
Fig. 5 is the schematic diagram of the application's the first multi-process management system.
Multi-process management system 500 comprises:
Memory headroom application module 501, for apply at least one shared memory space at internal memory, registers described shared memory space and defines the process of described shared memory space being carried out to read operation and write operation;
The first message data writing module 502, moves the first message data of described process to described shared memory space write request for another process;
The first message data is read module 503, read described the first message data for current file downloading process from described shared memory space, the first mapped file in described the first message data and internal memory is compared, obtain and carry out described instruction, wherein, described the first mapped file comprises the corresponding relation of the instruction of described the first message data and described current file downloading process, described instruction comprises current file speed of download is limited in speed of download threshold range, wherein, 0≤described threshold value≤current file speed of download;
The second message data writing module 504, writes the second message data of described process end of run to described shared memory space for described another process;
The second message data is read module 505, read described the second message data for described current file downloading process from described shared memory space, the second mapped file in described the second message data and internal memory is compared, obtain and carry out described instruction, wherein, described the second mapped file comprises the corresponding relation of the instruction of described the second message data and described current file downloading process, and described instruction comprises that speed of download is returned to described current file speed of download to be limited to current file speed of download in described speed of download threshold range with continuing.
Fig. 6 is the schematic diagram of the application's the second multi-process management system.
Multi-process management system 600 comprises:
Memory headroom application module 601, for apply at least one shared memory space at internal memory, registers described shared memory space and defines the process of described shared memory space being carried out to read operation and write operation;
The first message data writing module 602, writes the first message data of moving described process to described shared memory space for another process;
The first message data processing module 603, read described the first message data for current file downloading process from described shared memory space, the first mapped file in described the first message data and internal memory is compared, obtain and carry out described instruction, wherein, described the first mapped file comprises the corresponding relation of the instruction of described the first message data and described current file downloading process, and described instruction comprises the described current file speed of download of continuation;
The second message data writing module 604, writes the second message data of described process end of run to described shared memory space for described another process;
The second message data processing module 605, read described the second message data for described current file downloading process from described shared memory space, the second mapped file in described the second message data and internal memory is compared, obtain and carry out described instruction, wherein, described the second mapped file comprises the corresponding relation of the instruction of described the second message data and described current file downloading process, described instruction comprises and speed of download is returned to described current file speed of download and current file speed of download is limited in speed of download threshold range, wherein, 0≤described threshold value≤current file speed of download.
For system embodiment, because it is substantially similar to embodiment of the method, so description is fairly simple, relevant part is referring to the part explanation of embodiment of the method.
Each embodiment in this instructions all adopts the mode of going forward one by one to describe, and what each embodiment stressed is and the difference of other embodiment, between each embodiment identical similar part mutually referring to.
Those of ordinary skill in the art should further recognize, unit and the algorithm steps of each example of describing in conjunction with embodiment disclosed herein, can realize with electronic hardware, computer software or the combination of the two, for the interchangeability of hardware and software is clearly described, composition and the step of each example described according to function in the above description in general manner.These functions are carried out with hardware or software mode actually, depend on application-specific and the design constraint of technical scheme.Professional and technical personnel can realize described function with distinct methods to each specifically should being used for, but this realization should not thought and exceeds the application's scope.
A kind of multi-process exchange method and the system that above the application are provided are described in detail, applied principle and the embodiment of specific case to the application herein and set forth, the explanation of above embodiment is just for helping to understand the application's method and core concept thereof; , for one of ordinary skill in the art, according to the application's thought, all will change in specific embodiments and applications, in sum, this description should not be construed as the restriction to the application meanwhile.

Claims (10)

1. a multi-process exchange method, comprising:
In internal memory, apply at least one shared memory space, register described shared memory space and define the process of described shared memory space being carried out to read operation and write operation;
Another process is moved the first message data of described process to described shared memory space write request;
Current file downloading process is read described the first message data from described shared memory space, the first mapped file in described the first message data and internal memory is compared, obtain and carry out described instruction, wherein, described the first mapped file comprises the corresponding relation of the instruction of described the first message data and described current file downloading process, described instruction comprises file downloading speed is limited in speed of download threshold range, wherein, and 0≤described threshold value≤current file speed of download;
Described another process writes the second message data of described process end of run to described shared memory space;
Described current file downloading process is read described the second message data from described shared memory space, the second mapped file in described the second message data and internal memory is compared, obtain and carry out described instruction, wherein, described the second mapped file comprises the corresponding relation of the instruction of described the second message data and described current file downloading process, and described instruction comprises that speed of download is returned to described current file speed of download to be limited to current file speed of download in described speed of download threshold range with continuing.
2. method according to claim 1, is characterized in that, the described memory headroom of described registration further comprises that registration allows all processes of the described shared memory space of access and carries out mutual message data form for described process.
3. method according to claim 1, is characterized in that, described another process writes described shared memory space by sending WM_COPYDATA message by described the first message data and described the second message data; Described file downloading process is read described the first message data and described the second message data by receiving WM_COPYDATA message from described shared memory space.
4. method according to claim 1, is characterized in that, described another process is the test process for test network situation, and described the second message packets includes network situation meets network threshold condition and network condition exceeds network threshold condition; The corresponding relation of the instruction of described the second message data and described current file downloading process comprises in the time that described network condition meets network threshold condition, continue current file speed of download to be limited within the scope of described network threshold, in the time that described network condition exceeds network threshold condition, speed of download is returned to described initial download speed.
5. a multi-process exchange method, comprising:
In internal memory, apply at least one shared memory space, register described shared memory space and define the process of described shared memory space being carried out to read operation and write operation;
Another process writes the first message data of moving described process to described shared memory space;
Current file downloading process is read described the first message data from described shared memory space, the first mapped file in described the first message data and internal memory is compared, obtain and carry out described instruction, wherein, described the first mapped file comprises the corresponding relation of the instruction of described the first message data and described current file downloading process, and described instruction comprises the described current file speed of download of continuation;
Described another process writes the second message data of described process end of run to described shared memory space;
Described current file downloading process is read described the second message data from described shared memory space, the second mapped file in described the second message data and internal memory is compared, obtain and carry out described instruction, wherein, described the second mapped file comprises the corresponding relation of the instruction of described the second message data and described current file downloading process, described instruction comprises and speed of download is returned to described current file speed of download and file downloading speed is limited in speed of download threshold range, wherein, 0≤described threshold value≤current file speed of download.
6. method according to claim 5, is characterized in that, the described memory headroom of described registration further comprises that registration allows the title of all processes of accessing described memory headroom and carries out mutual message data form for described process.
7. method according to claim 5, is characterized in that, described another process writes described shared memory space by sending WM_COPYDATA message by described the first message data and described the second message data; Described file downloading process is read described the first message data and described the second message data by receiving WM_COPYDATA message from described shared memory space.
8. method according to claim 5, is characterized in that, described another process is the test process for the idle situation of testing server, and described the second message data comprises test to idle server and do not test idle server; The corresponding relation of the instruction of described the second message data and described current file downloading process comprises in the time testing idle server, continue current file speed of download to be limited in described speed of download threshold range, in the time that test is not to idle server, speed of download is returned to described current file speed of download.
9. a multi-process interactive systems, comprising:
Memory headroom application module, for apply at least one shared memory space at internal memory, registers described shared memory space and defines the process of described shared memory space being carried out to read operation and write operation;
The first message data writing module, moves the first message data of described process to described shared memory space write request for another process;
The first message data is read module, read described the first message data for current file downloading process from described shared memory space, the first mapped file in described the first message data and internal memory is compared, obtain and carry out described instruction, wherein, described the first mapped file comprises the corresponding relation of the instruction of described the first message data and described current file downloading process, described instruction comprises current file speed of download is limited in speed of download threshold range, wherein, 0≤described threshold value≤current file speed of download;
The second message data writing module, writes the second message data of described process end of run to described shared memory space for described another process;
The second message data is read module, read described the second message data for described current file downloading process from described shared memory space, the second mapped file in described the second message data and internal memory is compared, obtain and carry out described instruction, wherein, described the second mapped file comprises the corresponding relation of the instruction of described the second message data and described current file downloading process, and described instruction comprises that speed of download is returned to described current file speed of download to be limited to current file speed of download in described speed of download threshold range with continuing.
10. a multi-process interactive systems, comprising:
Memory headroom application module, for apply at least one shared memory space at internal memory, registers described shared memory space and defines the process of described shared memory space being carried out to read operation and write operation;
The first message data writing module, writes the first message data of moving described process to described shared memory space for another process;
The first message data processing module, read described the first message data for current file downloading process from described shared memory space, the first mapped file in described the first message data and internal memory is compared, obtain and carry out described instruction, wherein, described the first mapped file comprises the corresponding relation of the instruction of described the first message data and described current file downloading process, and described instruction comprises the described current file speed of download of continuation;
The second message data writing module, writes the second message data of described process end of run to described shared memory space for described another process;
The second message data processing module, read described the second message data for described current file downloading process from described shared memory space, the second mapped file in described the second message data and internal memory is compared, obtain and carry out described instruction, wherein, described the second mapped file comprises the corresponding relation of the instruction of described the second message data and described current file downloading process, described instruction comprises and speed of download is returned to described current file speed of download and current file speed of download is limited in speed of download threshold range, wherein, 0≤described threshold value≤current file speed of download.
CN201310035181.7A 2013-01-30 2013-01-30 Multi-process interaction method and system Pending CN103970593A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310035181.7A CN103970593A (en) 2013-01-30 2013-01-30 Multi-process interaction method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310035181.7A CN103970593A (en) 2013-01-30 2013-01-30 Multi-process interaction method and system

Publications (1)

Publication Number Publication Date
CN103970593A true CN103970593A (en) 2014-08-06

Family

ID=51240129

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310035181.7A Pending CN103970593A (en) 2013-01-30 2013-01-30 Multi-process interaction method and system

Country Status (1)

Country Link
CN (1) CN103970593A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108446182A (en) * 2018-02-07 2018-08-24 链家网(北京)科技有限公司 A kind of striding course communication means and device based on shared drive
CN108491280A (en) * 2018-03-20 2018-09-04 南京丹迪克科技开发有限公司 Data interactive method and device between a kind of process
CN110312995A (en) * 2017-04-19 2019-10-08 Oppo广东移动通信有限公司 Application program accelerates starting method, apparatus and terminal
CN110928700A (en) * 2018-09-20 2020-03-27 北京君正集成电路股份有限公司 Multi-process communication method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101951642A (en) * 2010-09-16 2011-01-19 中兴通讯股份有限公司 Method and device for regulating download speed of mobile terminal
CN102508765A (en) * 2011-11-17 2012-06-20 深圳市中兴移动通信有限公司 Method for monitoring software log in real time by inter-process communication
CN102546920A (en) * 2011-01-04 2012-07-04 中国移动通信有限公司 Method, system and device of running process

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101951642A (en) * 2010-09-16 2011-01-19 中兴通讯股份有限公司 Method and device for regulating download speed of mobile terminal
CN102546920A (en) * 2011-01-04 2012-07-04 中国移动通信有限公司 Method, system and device of running process
CN102508765A (en) * 2011-11-17 2012-06-20 深圳市中兴移动通信有限公司 Method for monitoring software log in real time by inter-process communication

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110312995A (en) * 2017-04-19 2019-10-08 Oppo广东移动通信有限公司 Application program accelerates starting method, apparatus and terminal
CN110312995B (en) * 2017-04-19 2022-12-16 Oppo广东移动通信有限公司 Application program accelerated starting method and device and terminal
CN108446182A (en) * 2018-02-07 2018-08-24 链家网(北京)科技有限公司 A kind of striding course communication means and device based on shared drive
CN108491280A (en) * 2018-03-20 2018-09-04 南京丹迪克科技开发有限公司 Data interactive method and device between a kind of process
CN108491280B (en) * 2018-03-20 2022-03-01 南京丹迪克科技开发有限公司 Inter-process data interaction method and device
CN110928700A (en) * 2018-09-20 2020-03-27 北京君正集成电路股份有限公司 Multi-process communication method and device

Similar Documents

Publication Publication Date Title
JP5485993B2 (en) Service load balancing
US10114771B1 (en) Interconnection of peripheral devices on different electronic devices
CN104144202B (en) Access method, system and the device of Hadoop distributed file system
US9537932B2 (en) Emulating test distributed application on server
US8433768B1 (en) Embedded model interaction within attack projection framework of information system
CN103533080A (en) Dispatching method and device for LVS (Linux virtual server)
CN103970593A (en) Multi-process interaction method and system
CN109962961A (en) A kind of reorientation method and system of content distribution network CDN service node
WO2020026018A1 (en) Method for downloading file, device, apparatus/terminal/ server, and storage medium
CN112702362B (en) Method and device for enhancing TCP/IP protocol stack, electronic equipment and storage medium
CN109981778B (en) Method, device, equipment and storage medium for realizing service of content distribution network
CN115374046B (en) Multiprocessor data interaction method, device, equipment and storage medium
CN110928693B (en) Computing equipment and resource allocation method
US11106359B1 (en) Interconnection of peripheral devices on different electronic devices
Lee et al. Performance evaluation technique of the RTSP based streaming server
US9137276B2 (en) Managing message distribution in a networked environment
JP2013516900A (en) Use of resources in a peer-to-peer computing environment
Fu et al. Application research of distributed simulation system based on data distribution
CN107948232B (en) Hook API-based proxy implementation method, data transmission method, device and system
CN104469539A (en) A cooperation buffering method, streaming media managing subsystem and server
CN113271229B (en) Equipment control method and device, storage equipment, safety equipment, switch, router and server
Murata et al. Development of high-performance and flexible protocol handler for international web accesses
CN115243080B (en) Data processing method, device, equipment and storage medium
CN117271335A (en) Test method and device
KR101262802B1 (en) System for real-time multi-device synchronized cloud and method of the same

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
ASS Succession or assignment of patent right

Owner name: TIANJIN MIYOU TECHNOLOGY CO., LTD.

Free format text: FORMER OWNER: YUNLIAN (BEIJING) INFORMATION TECHNOLOGY CO., LTD.

Effective date: 20150421

C41 Transfer of patent application or patent right or utility model
COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; FROM: 100015 CHAOYANG, BEIJING TO: 301708 WUQING, TIANJIN

TA01 Transfer of patent application right

Effective date of registration: 20150421

Address after: 301708 Tianjin city Wuqing District Flower Town Government Road No. 22

Applicant after: TIANJIN MIYOU TECHNOLOGY CO., LTD.

Address before: 100015, 706 North four street, 798 Art District, 4 Jiuxianqiao Road, Beijing, Chaoyang District

Applicant before: Cloud link (Beijing) Information Technology Co., Ltd.

C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20140806