CN108132848A - The method, apparatus and computer readable storage medium of data communication - Google Patents
The method, apparatus and computer readable storage medium of data communication Download PDFInfo
- Publication number
- CN108132848A CN108132848A CN201711419053.7A CN201711419053A CN108132848A CN 108132848 A CN108132848 A CN 108132848A CN 201711419053 A CN201711419053 A CN 201711419053A CN 108132848 A CN108132848 A CN 108132848A
- Authority
- CN
- China
- Prior art keywords
- memory block
- shared data
- mutex amount
- data memory
- electron
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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
Abstract
The invention discloses the method, apparatus and computer readable storage medium of data communication, applied in desktop development and application Electron, belong to Internet technical field.Wherein, desktop development and application Electron includes at least two processes, and each process includes with a shared data zone-setting mapping relations, this method:Current process is run, the current process obtains mutex amount resource, the lock-out state of the preset shared data memory blocks of desktop development and application Electron described in the mutex amount resource representation;When the mutex amount resource is the first setting value, the current process locks the shared data memory block, and to the shared data memory block, carries out corresponding Data communication operation.In this way, when a process changes the data in shared data memory block, other processes also can be directly aware of, and realize the communication of data between process, improve data communication efficiency between process.
Description
Technical field
The present invention relates to Internet technical fields, the more particularly to method, apparatus of data communication and computer-readable storage
Medium.
Background technology
Electron is a frame that web technologies can be utilized to develop cross-platform desktop application, and Electron is provided
One can create the platform of desktop application by JavaScript and HTML, while integrate Node to authorize web page access bottom system
The permission of system can develop desktop application at present.
Electron includes multiple processes, and the mode that data communicate between process and process is all to use message mechanism,
According to the mechanism of synchronization message, before synchronization message does not return also, process needs to wait for always so that the page meeting of exploitation
Compare interim card;According to the mechanism of asynchronous message, then the return of asynchronous message has relatively slow so that page operation has lag.
Invention content
An embodiment of the present invention provides the method, apparatus and computer readable storage medium of a kind of communication of data.In order to right
There are one basic understandings for some aspects of the embodiment of disclosure, and simple summary is shown below.The summarized section is not general
General commentary, nor to determine key/critical component or describe the protection domain of these embodiments.Its sole purpose is to use
Some concepts are presented in simple form, in this, as the preamble of following detailed description.
It is according to embodiments of the present invention in a first aspect, provide a kind of method of data communication, should applied to desktop exploitation
With in Electron, the desktop development and application Electron includes at least two processes, each process and a shared number
According to zone-setting mapping relations, the method includes:
Current process is run, the current process obtains mutex amount resource, wherein, the mutex amount resource table
Show the lock-out state of the preset shared data memory blocks of desktop development and application Electron;
When the mutex amount resource is the first setting value, the current process locks the shared data storage
Area, and to the shared data memory block, carry out corresponding Data communication operation.
In one embodiment of the invention, the current process obtains mutex amount resource and includes:
The current process obtains mutex amount title;
According to the mutex amount title, obtained from the semaphore memory block of the desktop development and application Electron
The mutex amount resource.
In one embodiment of the invention, it is described carry out corresponding Data communication operation after, further include:
The current process discharges the shared data memory block.
In one embodiment of the invention, the method further includes:
When determining that the current process locks the shared data memory block, by the mutual exclusion in semaphore memory block
Semaphore resource distribution, will for the second setting value and when determining that the current process discharges the shared data memory block
The mutex amount resource distribution in semaphore memory block is the first setting value.
Second aspect according to embodiments of the present invention provides a kind of device of data communication, applied to desktop development and application
In Electron, the desktop development and application Electron includes at least two processes, each process and a shared data
Zone-setting mapping relations, described device include:First process unit, and first process unit includes:
Acquisition module, for obtaining mutex amount resource, wherein, desktop described in the mutex amount resource representation is opened
Hair applies the lock-out state of the preset shared data memory blocks of Electron;
Communication module is locked, for when the mutex amount resource is the first setting value, locking the shared data
Memory block, and to the shared data memory block, carry out corresponding Data communication operation.
In one embodiment of the invention, the acquisition module, specifically for obtaining mutex amount title, and according to described mutual
Denounce semaphore title, the mutex amount money is obtained from the semaphore memory block of the desktop development and application Electron
Source.
In one embodiment of the invention, first process unit further includes:
Release module after carrying out corresponding Data communication operation, discharges the shared data memory block.
In one embodiment of the invention, described device further includes:
Dispensing unit, for when determining that first process unit locks the shared data memory block, the desktop
The mutex amount resource distribution in semaphore memory block is the second setting value by development and application Electron;And when
When determining that first process unit discharges the shared data memory block, by the mutex amount in semaphore memory block
Resource distribution is the first setting value.
The third aspect according to embodiments of the present invention provides a kind of device of data communication, for terminal or server, institute
Device is stated applied in desktop development and application Electron, the desktop development and application Electron include at least two into
Journey, each process include with a shared data zone-setting mapping relations, described device:
Processor;
For storing the memory of processor-executable instruction;
Wherein, the processor is configured as:
Current process is run, the current process obtains mutex amount resource, wherein, the mutex amount resource table
Show the lock-out state of the preset shared data memory blocks of desktop development and application Electron;
When the mutex amount resource is the first setting value, the current process locks the shared data storage
Area, and to the shared data memory block, carry out corresponding Data communication operation.
Fourth aspect according to embodiments of the present invention provides a kind of computer readable storage medium, is stored thereon with calculating
Machine instructs, when which is executed by processor the step of the realization above method.
Technical solution provided in an embodiment of the present invention can include the following benefits:
In the embodiment of the present invention, in desktop development and application Electron, each process is built with a shared data memory block
Mapping relations have been found, and can carry out corresponding data by mutex amount, each process lockable shared data memory block and lead to
Letter operation, in this way, when a process changes the data in shared data memory block, other processes also can be directly aware of, and
It does not need to through system calling or message mechanism, you can realize the communication of data between process, improve number between process
According to the efficiency of communication.
It should be understood that above general description and following detailed description are only exemplary and explanatory, not
It can the limitation present invention.
Description of the drawings
Attached drawing herein is incorporated into specification and forms the part of this specification, shows the implementation for meeting the present invention
Example, and be used to explain the principle of the present invention together with specification.
Fig. 1 is the flow chart according to a kind of data communications method shown in an exemplary embodiment;
Fig. 2 is the flow chart according to a kind of data communications method shown in an exemplary embodiment;
Fig. 3 is the block diagram according to a kind of data communication equipment shown in an exemplary embodiment;
Fig. 4 is the block diagram according to a kind of data communication equipment shown in an exemplary embodiment.
Specific embodiment
The following description and drawings fully show specific embodiments of the present invention, to enable those skilled in the art to
Put into practice them.Embodiment only represents possible variation.Unless explicitly requested, otherwise individual components and functionality is optional, and
And the sequence of operation can change.The part of some embodiments and feature can be included in or replace other embodiments
Part and feature.The range of embodiment of the present invention includes the entire scope of claims and the institute of claims
There is obtainable equivalent.Herein, each embodiment can individually or generally be represented that this is only with term " invention "
It is merely for convenience, and if in fact disclosing the invention more than one, it is not meant to automatically limit the range of the application
For any single invention or inventive concept.Herein, relational terms such as first and second and the like are used only for one
Entity, which either operates to distinguish with another entity or operation, to be existed without requiring or implying between these entities or operation
Any practical relationship or sequence.Moreover, term " comprising ", "comprising" or its any other variant be intended to it is non-exclusive
Property include so that process, method or equipment including a series of elements not only include those elements, but also including
Other elements that are not explicitly listed.Each embodiment herein is described by the way of progressive, and each embodiment stresses
Be all difference from other examples, just to refer each other for identical similar portion between each embodiment.For implementing
For structure, product etc. disclosed in example, due to its with embodiment disclosed in part it is corresponding, so fairly simple, the phase of description
Part is closed referring to method part illustration.
In desktop development and application Electron, each process and shared data zone-setting mapping relations, and
Can corresponding Data communication operation be carried out, in this way, one by mutex amount, each process lockable shared data memory block
When a process changes the data in shared data memory block, other processes also can be directly aware of, and need not move through system
Calling or message mechanism, you can realize the communication of data between process, improve the efficiency of data communication between process.
Fig. 1 is the flow chart according to a kind of data communications method shown in an exemplary embodiment.As shown in Figure 1, data
The process of communication is applied in desktop development and application Electron, it may include:
Step 101:Current process is run, current process obtains mutex amount resource.
In the embodiment of the present invention, desktop development and application can be a kind of application that cross-platform desktop is developed using web technologies.
Such as:NW, heX, Electron etc. can be desktop development and application.May include in desktop development and application it is two or more into
Journey, each process can independent operatings.Such as:It may include host process and at least one rendering process in Electron, each
Process all can independent operating.
There is no shared data memory block in current existing desktop development and application Electron, and in the embodiment of the present invention,
Shared data memory block can be based in Electron between each process into row data communication, therefore, desktop can be pre-configured with and opened
Hair is using a shared data memory block in Electron, also, each process is mapped with the shared data zone-setting
Relationship.Such as:One section of region of memory can be obtained from the memory of terminal or server and be configured to shared data memory block, then,
When each process is configured, the corresponding address area in the shared data memory block is written, that is, establishes each process and the shared number
According to the mapping relations between memory block.
Since two or more processes can share a data storage area, it can configure a mutex amount and carry out table
Show the lock-out state of the preset shared data memory blocks of desktop development and application Electron.Mutex amount resource is the first setting
Value can correspond to and represent that shared data memory block is in unlocked state, and mutex amount resource is the second setting value, can be corresponded to
Represent that shared data memory block is in the lock state.Such as:First setting value is " 0 ", and the second setting value is " 1 ".Certainly, also may be used
The two is exchanged.
In this way, be pre-configured with shared data memory block, mapping relations between process and shared data storage area and
After mutex amount, which approves independent each process in advance during desktop is developed.Its
In, any one process all can realize that data communicate when into row data communication based on the shared data memory block of configuration.
In this way, during operation current process, current process need to obtain mutex amount resource.Generally, current process
When need to be into row data communication, mutex amount title can be got, it then, need to be corresponding with mutex amount title mutual to judge
Reprimand semaphore whether there isIf in the presence of that can obtain from the semaphore memory block of desktop development and application Electron and believe with mutual exclusion
Number corresponding mutex amount resource of amount title.If being not present, configuration mutex amount and corresponding mutex amount are needed
Resource initializes mutex amount, also can be from the semaphore memory block of desktop development and application Electron after initializing successfully
It is middle to obtain mutex amount resource corresponding with mutex amount title.Therefore, current process obtains mutex amount resource packet
It includes:Current process obtains mutex amount title;According to mutex amount title, from the signal of desktop development and application Electron
It measures and mutex amount resource is obtained in memory block.
Step 102:When mutex amount resource is the first setting value, current process locking shared data memory block, and
To shared data memory block, corresponding Data communication operation is carried out.
In the embodiment of the present invention, the lock-out state of shared data memory block is corresponding with mutex amount resource.Mutex
Amount resource can correspond to the two kinds of values that can be torn open, such as:First setting value " 1 ", the second setting value " 0 " etc..In this way, when the mutual exclusion obtained
When semaphore resource is the first setting value, it may be determined that shared data memory block is in unlocked state, at this point, current process can be with
Based on shared data memory block, corresponding Data communication operation is carried out, therefore, current process needs locking shared data first to store
Then area, to shared data memory block, carries out corresponding Data communication operation.
If the mutex amount resource obtained not for the first setting value, during if the second setting value, then shows shared data
Memory block is in the lock state, at this point, corresponding Data communication operation cannot be carried out.
As it can be seen that in the embodiment of the present invention, in desktop development and application Electron, each process is stored with a shared data
Area establishes mapping relations, and can carry out corresponding data by mutex amount, process lockable shared data memory block and lead to
Letter operation.In this way, due to the mapping relations between process and shared data storage area, a process changes shared data storage
During data in area, other processes also can be directly aware of, and directly achieve that data communicate, without memory space it
Between repeat the duplications of data, reduce the number of data duplication, improve the efficiency that data between process communicate.
Certainly, if the mutex amount resource that current process obtains is not the first setting value, during as the second setting value,
Then show that shared data memory block is locked out, at this point, other processes are carrying out data manipulation to shared data memory block, currently
Process needs to wait for, and continues to obtain mutex amount resource, until when mutex amount resource is the first setting value, it just can be to shared
Data storage area carries out corresponding Data communication operation.Therefore, in one embodiment of the invention, current process carries out corresponding number
After traffic operation, further include:Current process release shared data memory block.
As it can be seen that mutex amount resource is variation, and when shared data memory block is locked, corresponding second setting value, and
When shared data memory block is released, the first setting value can be corresponded to.Therefore, lock or discharge shared data storage in current process
During area, desktop development and application Electron also need update mutex amount resource, i.e., when determine current process locking altogether
When enjoying data storage area, the mutex amount resource distribution in semaphore memory block is worked as the second setting value and when determining
It is the first setting value by the mutex amount resource distribution in semaphore memory block during preceding process release shared data memory block.
It can specifically be performed by a setting process in desktop development and application Electron, such as:Host process, in this way, current process exists
It when locking or release shared data memory block, can send a notification message to host process, so as to which host process determines that current process locks
Or during release shared data memory block, corresponding update mutex amount resource.
The method that the embodiment of the present disclosure provides in operating process set to specific embodiment, will be illustrated below.
In the present embodiment, desktop development and application Electron corresponds to Electon, and multiple processes are included in Electon.
From memory obtain one section of region of memory, be configured to shared data memory block, and establish shared data memory block with each into
Mapping relations between journey.That is shared data memory block is configured in Electon.
Fig. 2 is the flow chart according to a kind of data communications method shown in an exemplary embodiment.As shown in Fig. 2, data
Communication process is applied in Electron, it may include:
Step 201:Current process obtains mutex amount title.
The each processes of Electon can independent operating, process need to be into row data communication, which can be when advancing
Journey obtains mutex amount title.
Step 202:Current process judges that mutex amount corresponding with mutex amount title whether there isIf it is holding
Otherwise row step 204, performs step 203.
The correspondence that can be pre-configured between the lock-out state of mutex amount and shared data storage area, also can be by working as
Preceding process initializes mutex amount.
Step 203:Current process initializes mutex amount, and is transferred to step 204.
Can mutex amount resource be configured and by mutex amount according to the lock-out state of shared data memory block
In resource deposit semaphore memory block.
Step 204:Current process obtains mutex amount resource from the semaphore memory block of Electon.
Step 205:Whether the mutex amount resource that current process judges to obtain is the first setting value " 0 "If so, it performs
Step 206.Otherwise, it can return to step 204
Mutex amount resource is the first setting value " 0 ", then shows that shared data memory block is in unlocked state, can hold
Row step 206.Mutex amount resource is the second setting value " 1 ", then shows that shared data memory block is in the lock state, need
It treats, can return to step 204.Certainly, in another embodiment, also can flow terminate.
Step 206:Current process locking shared data memory block, and can notify to set process in Electon by semaphore
Mutex amount resource distribution in memory block is the second setting value " 1 ".
Since current process need to operate shared data memory block, locking shared data memory block is needed, and
Need to be the second setting value " 1 " by mutex amount resource updates.In this way, other processes cannot operate shared data memory block.
The renewal process can be completed by current process, can also be completed by other processes in Electon.That is setting process includes current process
Or other processes.
Step 207:Current process carries out corresponding Data communication operation to shared data memory block.
In this way, when current process carries out data change to shared data memory block, due to shared data memory block and process
Between mapping relations, other processes have also learned that data in shared data memory block change, you can realize between process
Data communication.
Step 208:Current process release shared data memory block, and notify that process is set in Electon deposits semaphore
Mutex amount resource distribution in storage area is the first setting value " 0 ".
Current process completes corresponding data traffic operation, release shared data memory block is needed at this time, in this way, mutual exclusion is believed
Number amount resource distribution is after the first setting value " 0 ", when other processes need to be into row data communication, you can grasped by mutex amount
Make the data in shared data memory block.Certainly, here, in Electon set process may also comprise current process or other
Process.
As it can be seen that in the present embodiment, each process and shared data zone-setting mapping relations in Electon,
And can corresponding Data communication operation be carried out by mutex amount, each process lockable shared data memory block, in this way,
When one process changes the data in shared data memory block, other processes also can be directly aware of, and needed not move through and be
System calls or message mechanism, you can realizes the communication of data between process, improves the efficiency of data communication between process.
Certainly, in above-described embodiment, possible mutex amount initialization procedure is unsuccessful in step 203, at this point, flow knot
Beam.And step 204 obtains mutex amount resource process and may also once obtain unsuccessful, can carry out acquisition process several times more,
Repeatedly obtain it is unsuccessful after, flow also terminates.Alternatively, in step 206, the process of locking shared data memory block may not also be into
Work(, then flow also finish.
Following is embodiment of the present disclosure, can be used for performing embodiments of the present disclosure.
According to the process that above-mentioned data communicate, a kind of device of data communication can be built, is similarly applied to desktop exploitation
Using in Electron.
Fig. 3 is the block diagram according to a kind of data communication equipment shown in an exemplary embodiment.It should applied to desktop exploitation
With in Electron, wherein, desktop development and application Electron includes at least two processes, each process and a shared number
According to zone-setting mapping relations, as shown in figure 3, the device includes:First process unit 100, and the first process unit packet
It includes:Acquisition module 110 and locking communication module 120, wherein,
Acquisition module 110, for obtaining mutex amount resource, wherein, the exploitation of mutex amount resource representation desktop should
With the lock-out state of the preset shared data memory blocks of Electron.
Communication module 120 is locked, for when mutex amount resource is the first setting value, locking shared data to store
Area, and to shared data memory block, carry out corresponding Data communication operation.
In one embodiment of the invention, acquisition module 110 specifically for obtaining mutex amount title, and is believed according to mutual exclusion
Number amount title, from the semaphore memory block of desktop development and application Electron obtain mutex amount resource.
In one embodiment of the invention, the first process unit further includes:
Release module after carrying out corresponding Data communication operation, discharges shared data memory block.
In one embodiment of the invention, device further includes:
Dispensing unit, for when determining 100 locking shared data memory block of the first process unit, desktop development and application
Mutex amount resource distribution in semaphore memory block is the second setting value by Electron;And when determining the first process
It is the first setting value by the mutex amount resource distribution in semaphore memory block when unit 100 discharges shared data memory block.
The device of embodiment of the present disclosure offer is provided.
Fig. 4 is the block diagram according to a kind of data communication equipment shown in an exemplary embodiment.It should applied to desktop exploitation
With in Electron, desktop development and application Electron includes at least two processes, and each process is deposited with a shared data
Storage area establishes mapping relations, as shown in figure 4, the device includes:First process unit 100 and dispensing unit 200, wherein, the
One process unit 100 includes:Acquisition module 110, locking communication module 120 and release module 130.
In the present embodiment, desktop development and application Electron is Electon, and multiple processes are included in Electon.From
One section of region of memory is obtained in memory, is configured to shared data memory block, and establish shared data memory block and each process
Between mapping relations.In this way, the acquisition module 110 in the first process unit 100 can obtain mutex amount title, and according to
Mutex amount title obtains mutex amount resource from the semaphore memory block of Electon.
When the mutex amount resource of acquisition is the first setting value " 0 ", the locking communication mould in the first process unit 100
120 lockable shared data memory block of block, and dispensing unit 200 can be notified the mutex amount resource in semaphore memory block
It is configured to the second setting value " 1 ".Also, communication module 120 is locked to shared data memory block, carries out corresponding data communication behaviour
Make.
After the Data communication operation to shared data memory block is completed, the release module in the first process unit 100
130 releasable shared data memory blocks, and notify dispensing unit 200 by the mutex amount resource distribution in semaphore memory block
For the first setting value " 0 ".
As it can be seen that in the present embodiment, each process and shared data zone-setting mapping relations in Electon,
It and can be by mutex amount, so as to the process unit lockable in desktop development and application Electron in data communication equipment
Shared data memory block carries out corresponding Data communication operation, in this way, a process unit is changed in shared data memory block
Data when, other also can directly be aware of into unit journey, need not move through system call or message mechanism, you can realize
The communication of data between process improves the efficiency that data between process unit communicate.
In one embodiment of the invention, a kind of device of data communication is provided, for terminal or server, which can apply
In desktop development and application Electron, including:
Processor;
For storing the memory of processor-executable instruction;
Wherein, processor is configured as:
Current process is run, current process obtains mutex amount resource, wherein, mutex amount resource representation desktop is opened
Hair applies the lock-out state of the preset shared data memory blocks of Electron;
When mutex amount resource is the first setting value, current process locking shared data memory block, and to shared number
According to memory block, corresponding Data communication operation is carried out.
In one embodiment of the invention, a kind of computer readable storage medium is provided, is stored thereon with computer instruction, this refers to
The step of above method is realized when order is executed by processor.
It should be understood by those skilled in the art that, the embodiment of the present invention can be provided as method, system or computer program
Product.Therefore, the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware can be used in the present invention
Apply the form of example.Moreover, the computer for wherein including computer usable program code in one or more can be used in the present invention
The shape of computer program product that usable storage medium is implemented on (including but not limited to magnetic disk storage and optical memory etc.)
Formula.
The present invention be with reference to according to the method for the embodiment of the present invention, the flow of equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that it can be realized by computer program instructions every first-class in flowchart and/or the block diagram
The combination of flow and/or box in journey and/or box and flowchart and/or the block diagram.These computer programs can be provided
The processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that the instruction performed by computer or the processor of other programmable data processing devices is generated for real
The device of function specified in present one flow of flow chart or one box of multiple flows and/or block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction generation being stored in the computer-readable memory includes referring to
Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or
The function of being specified in multiple boxes.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted
Series of operation steps are performed on calculation machine or other programmable devices to generate computer implemented processing, so as in computer or
The instruction offer performed on other programmable devices is used to implement in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in a box or multiple boxes.
It should be understood that the invention is not limited in the flow and structure that are described above and are shown in the drawings,
And various modifications and changes may be made without departing from the scope thereof.The scope of the present invention is only limited by appended claim
System.
Claims (10)
- A kind of 1. method of data communication, which is characterized in that applied in desktop development and application Electron, the desktop is developed Include at least two processes, each process and shared data zone-setting mapping relations, institute using Electron The method of stating includes:Current process is run, the current process obtains mutex amount resource, wherein, the mutex amount resource representation institute State the lock-out state of the preset shared data memory blocks of desktop development and application Electron;When the mutex amount resource is the first setting value, the current process locks the shared data memory block, and To the shared data memory block, corresponding Data communication operation is carried out.
- 2. the method as described in claim 1, which is characterized in that the current process obtains mutex amount resource and includes:The current process obtains mutex amount title;According to the mutex amount title, obtained from the semaphore memory block of the desktop development and application Electron described in Mutex amount resource.
- 3. method as claimed in claim 1 or 2, which is characterized in that it is described carry out corresponding Data communication operation after, also wrap It includes:The current process discharges the shared data memory block.
- 4. method as claimed in claim 3, which is characterized in that the method further includes:When determining that the current process locks the shared data memory block, by the mutex in semaphore memory block Amount resource distribution is for the second setting value and when determining that the current process discharges the shared data memory block, by signal It is the first setting value to measure the mutex amount resource distribution in memory block.
- 5. a kind of device of data communication, which is characterized in that applied in desktop development and application Electron, the desktop is developed Include at least two processes, each process and shared data zone-setting mapping relations, institute using Electron Device is stated to include:First process unit, and first process unit includes:Acquisition module, for obtaining mutex amount resource, wherein, desktop exploitation should described in the mutex amount resource representation With the lock-out state of the preset shared data memory blocks of Electron;Communication module is locked, for when the mutex amount resource is the first setting value, locking the shared data storage Area, and to the shared data memory block, carry out corresponding Data communication operation.
- 6. device as claimed in claim 5, which is characterized in thatThe acquisition module, specifically for obtaining mutex amount title, and according to the mutex amount title, from the table The mutex amount resource is obtained in the semaphore memory block of face development and application Electron.
- 7. such as device described in claim 5 or 6, which is characterized in that first process unit further includes:Release module after carrying out corresponding Data communication operation, discharges the shared data memory block.
- 8. device as claimed in claim 7, which is characterized in that described device further includes:Dispensing unit, for when determining that first process unit locks the shared data memory block, the desktop to be developed Using Electron by the mutex amount resource distribution in semaphore memory block be the second setting value;And when determining When first process unit discharges the shared data memory block, by the mutex amount resource in semaphore memory block It is configured to the first setting value.
- 9. a kind of device of data communication, applied to terminal or server, which is characterized in that described device is developed applied to desktop Using in Electron, the desktop development and application Electron includes at least two processes, and each process is shared with one Data storage area establishes mapping relations, and described device includes:Processor;For storing the memory of processor-executable instruction;Wherein, the processor is configured as:Current process is run, the current process obtains mutex amount resource, wherein, the mutex amount resource representation institute State the lock-out state of the preset shared data memory blocks of desktop development and application Electron;When the mutex amount resource is the first setting value, the current process locks the shared data memory block, and To the shared data memory block, corresponding Data communication operation is carried out.
- 10. a kind of computer readable storage medium, is stored thereon with computer instruction, which is characterized in that the instruction is by processor The step of claim 1-4 the methods are realized during execution.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711419053.7A CN108132848A (en) | 2017-12-25 | 2017-12-25 | The method, apparatus and computer readable storage medium of data communication |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711419053.7A CN108132848A (en) | 2017-12-25 | 2017-12-25 | The method, apparatus and computer readable storage medium of data communication |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108132848A true CN108132848A (en) | 2018-06-08 |
Family
ID=62392791
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711419053.7A Pending CN108132848A (en) | 2017-12-25 | 2017-12-25 | The method, apparatus and computer readable storage medium of data communication |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108132848A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111858074A (en) * | 2020-06-24 | 2020-10-30 | 深圳英飞拓智能技术有限公司 | Resource access method, device and equipment |
CN111949415A (en) * | 2019-05-17 | 2020-11-17 | 阿里巴巴集团控股有限公司 | Method and device for synchronizing data states between applications and computer storage medium |
CN114461157A (en) * | 2021-12-23 | 2022-05-10 | 天翼云科技有限公司 | IDV client multi-screen division and treatment method and system |
CN115934210A (en) * | 2023-03-14 | 2023-04-07 | 中航金网(北京)电子商务有限公司 | Method and device for storing instances of multi-window shared object and electronic equipment |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150205646A1 (en) * | 2014-01-20 | 2015-07-23 | Netapp, Inc. | Context aware synchronization |
CN105511969A (en) * | 2015-11-25 | 2016-04-20 | 中国船舶工业系统工程研究院 | Inter-process thread mutex method |
-
2017
- 2017-12-25 CN CN201711419053.7A patent/CN108132848A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150205646A1 (en) * | 2014-01-20 | 2015-07-23 | Netapp, Inc. | Context aware synchronization |
CN105511969A (en) * | 2015-11-25 | 2016-04-20 | 中国船舶工业系统工程研究院 | Inter-process thread mutex method |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111949415A (en) * | 2019-05-17 | 2020-11-17 | 阿里巴巴集团控股有限公司 | Method and device for synchronizing data states between applications and computer storage medium |
CN111858074A (en) * | 2020-06-24 | 2020-10-30 | 深圳英飞拓智能技术有限公司 | Resource access method, device and equipment |
CN114461157A (en) * | 2021-12-23 | 2022-05-10 | 天翼云科技有限公司 | IDV client multi-screen division and treatment method and system |
CN114461157B (en) * | 2021-12-23 | 2023-11-03 | 天翼云科技有限公司 | IDV client multi-screen divide-and-conquer method and system |
CN115934210A (en) * | 2023-03-14 | 2023-04-07 | 中航金网(北京)电子商务有限公司 | Method and device for storing instances of multi-window shared object and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108132848A (en) | The method, apparatus and computer readable storage medium of data communication | |
CN109639550A (en) | A kind of multi-tiling chain network network-building method, apparatus and system | |
CN110149316B (en) | Block chain publishing method and device | |
CN104639650B (en) | A kind of fine granularity distributed interface access control method and device | |
CN103677878B (en) | A kind of method and apparatus of patch installing | |
CN105429811B (en) | network management system and method | |
EP3419216A1 (en) | Method and device for managing nfv mano policy descriptor | |
CN110839071B (en) | Information storage method, device and storage medium based on block chain | |
CN107301091A (en) | Resource allocation methods and device | |
CN110264348A (en) | A kind of processing method, device and the storage medium of cochain of trading | |
CN110149335A (en) | Establish the method and apparatus of the home zone for the protection of block chain data-privacy | |
CN107463411A (en) | A kind of cloud main frame initial method and device | |
CN105490813B (en) | A kind of method and device of user security access web | |
CN106534084A (en) | Admission control method and equipment | |
CN103905201B (en) | Interaction method and device for master application and multiple slave applications | |
CN108156095A (en) | Resource determining method and device, NFVO | |
CN104298485A (en) | Method for generating random numbers satisfying security strength requirements | |
CN110008665B (en) | Authority control method and device for blockchain | |
CN105224541B (en) | Uniqueness control method, information storage means and the device of data | |
EP3379408B1 (en) | Updatable random functions | |
CN107741994A (en) | A kind of data-updating method and device | |
CN107465725A (en) | Isomery remote business disposal system and method based on CICS | |
CN109146477B (en) | Method for specifying address when Ethernet workshop issues intelligent contract | |
CN108241626A (en) | The generation method and device of query script | |
CN106874341A (en) | A kind of database synchronization method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180608 |