CN108268564A - The asynchronous computing method and device of network function in electrical form - Google Patents
The asynchronous computing method and device of network function in electrical form Download PDFInfo
- Publication number
- CN108268564A CN108268564A CN201710003977.2A CN201710003977A CN108268564A CN 108268564 A CN108268564 A CN 108268564A CN 201710003977 A CN201710003977 A CN 201710003977A CN 108268564 A CN108268564 A CN 108268564A
- Authority
- CN
- China
- Prior art keywords
- function
- thread
- calculated
- buffer area
- calculation
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
- G06F16/24552—Database cache management
Abstract
An embodiment of the present invention provides a kind of asynchronous computing method and devices of network function in electrical form.Including:First thread obtains the function information of network function to be calculated;The first thread searches the corresponding result of calculation of the function information in the first buffer area;If not finding the corresponding result of calculation of the function information in first buffer area, the first thread stores the function information to the second buffer area;Second thread obtains the function information from second buffer area, and the calculating of network function is carried out according to the function information, result of calculation is stored to first buffer area, and starts the first thread and search the corresponding result of calculation of the function information.The asynchronous computing of network function is realized, the time that user waits for network function to return to result of calculation can be reduced, promote user experience.
Description
Technical field
The present invention relates to spreadsheet information processing technology field, more particularly to network function in a kind of electrical form
Asynchronous computing method and device.
Background technology
In electrical form, common calculation process is made of the calculating process of function in cell, general function
Calculating process be to be calculated in order into line function by a thread, function calculates complete after, then calculate next function.
With the extension of electrical form function, network function can be often applied to, and network function needs to obtain by network when calculating
Result of calculation, this results in tens times or even the hundreds of times that the calculating time of network function is the calculating time of generic function.
As it can be seen that in the case where there is a large amount of network function to be cited, using the calculation of above-mentioned generic function, once
Calculation process can expend long time, and user needs to fall into a long wait in operation, and user experience is bad.Therefore, urgently
It need to propose a kind of asynchronous computing method for the network function that can shorten period of reservation of number.
Invention content
The asynchronous computing method and device for being designed to provide network function in a kind of electrical form of the embodiment of the present invention,
To realize the asynchronous computing of network function, the time that user waits for network function to return to result of calculation is reduced, promotes user experience.
Specific technical solution is as follows:
A kind of asynchronous computing method of network function in electrical form, including:
First thread obtains the function information of network function to be calculated;
The first thread searches the corresponding result of calculation of the function information in the first buffer area;
If the corresponding result of calculation of the function information, the first thread are not found in first buffer area
The function information is stored to the second buffer area;
Second thread obtains the function information from second buffer area, and network function is carried out according to the function information
Calculating, result of calculation is stored to first buffer area, and start the first thread and search the function information and correspond to
Result of calculation.
Method as described above, wherein, the function information includes:Function ID and parameter;
The first thread obtains the step of function information of network function to be calculated, including:
First thread upon actuation, judges to whether there is function to be calculated in the first dirty unit set;The first dirty list
Pending cell is included in member set;
If in the presence of the first thread obtains the function ID and parameter of the function to be calculated;
The first thread judges whether the function to be calculated is network function according to the function ID;
If judging result is network function for the function to be calculated, the function ID and parameter of the function to be calculated are
The function information of network function to be calculated.
Method as described above, wherein, the method further includes:
If the corresponding result of calculation of the function information is found in first buffer area, by the result of calculation
Return to memory;
The step of first thread judges to whether there is function to be calculated in the first dirty unit set is returned to, until described
First thread judges to terminate when function to be calculated being not present in the described first dirty unit set.
Method as described above, wherein, the method further includes:
If the first thread judges that the function to be calculated is not network function, the first thread is according to the letter
Number ID and parameter are calculated into line function, obtain the result of calculation of the function to be calculated, and the result of calculation is returned memory;
The step of first thread judges to whether there is function to be calculated in the first dirty unit set is returned to, until described
First thread judges to terminate when function to be calculated being not present in the described first dirty unit set.
Method as described above, wherein, whether the first thread judges the function to be calculated according to the function ID
For network function, including:
The first thread determines the function ID with the function to be calculated according to preset function ID and marker bit mapping table
Corresponding marker bit;
The first thread judges whether the function to be calculated is network function according to the marker bit.
Method as described above, wherein, second thread obtains the function information from second buffer area, according to
The function information carries out the calculating of network function, result of calculation is stored to first buffer area, and start described first
Thread searches the step of function information corresponding result of calculation, including:
Second thread judges to whether there is the function ID and parameter of the function to be calculated in the second buffer area;
If in the presence of second thread obtains the function ID and parameter from second buffer area, and by described in
Cell where function to be calculated is recorded in the second dirty unit set;
Second thread carries out the calculating of network function according to the function ID and parameter, obtains result of calculation;
Second thread stores the result of calculation to first buffer area;
The step of whether there is the function ID and parameter of function to be calculated in the second buffer area of the judgement is returned to, until institute
It states the second thread to judge the function ID and parameter of function to be calculated are not present in second buffer area, second thread judges
Whether the first thread terminates;
If the first thread terminates, the unit that second thread will record in the described second dirty unit set
Lattice are put into the first dirty unit set;
Second thread starts the first thread and searches the corresponding result of calculation of the function information, and enter suspend mode
State.
Method as described above, wherein, the first thread stores the function information to the second buffer area, also
Including:
Whether in a dormant state the first thread judges second thread by status indication position;
If second thread is in a dormant state, the first thread wakes up second thread.
Method as described above, wherein, second thread judges whether the first thread terminates, including:
Second thread judges whether cogradient variable is labeled;
If the cogradient variable is labeled, second thread judges that the first thread does not terminate;
If the cogradient variable is unmarked, second thread judges that the first thread terminates.
Method as described above, wherein, second thread starts the first thread, including:
Second thread sends initiation message to the first thread, starts the first thread.
The asynchronous computing device of network function in a kind of electrical form, including:
Acquisition module, for obtaining the function information of network function to be calculated using first thread;
Searching module, for searching the corresponding calculating of the function information in the first buffer area using the first thread
As a result;
Memory module corresponds to if not finding the function information in first buffer area for the searching module
Result of calculation, then the function information is stored to the second buffer area using the first thread;
Processing module, for the second thread to be used to obtain the function information from second buffer area, according to the letter
Number information carries out the calculating of network function, result of calculation is stored to first buffer area, and start the first thread and look into
Look for the corresponding result of calculation of the function information.
Device as described above, wherein, the function information includes:Function ID and parameter;
The acquisition module is specifically used for:First thread upon actuation, judges to whether there is in the first dirty unit set and treat
Calculate function;Pending cell is included in the first dirty unit set;If in the presence of institute is obtained using the first thread
State the function ID and parameter of function to be calculated;Judge whether the function to be calculated is network function according to the function ID;If
Judging result is network function for the function to be calculated, then the function ID of the function to be calculated and parameter are network to be calculated
The function information of function.
Device as described above, wherein, the searching module is additionally operable to:
If the corresponding result of calculation of the function information is found in first buffer area, by the result of calculation
Return to memory;
First trigger module, for triggering the acquisition module;Until the acquisition module is sentenced using the first thread
Terminate when function to be calculated is not present in the disconnected first dirty unit set.
Device as described above, wherein, it further includes:Computing module;
If judging that the function to be calculated is not network function using the first thread for the acquisition module, make
It is calculated with the first thread according to the function ID and parameter into line function, obtains the result of calculation of the function to be calculated,
And the result of calculation is returned into memory;
First trigger module, for triggering the acquisition module;Until the acquisition module is sentenced using the first thread
Terminate when function to be calculated is not present in the disconnected first dirty unit set.
Device as described above, wherein, the acquisition module is specifically used for:
Using the first thread according to preset function ID and marker bit mapping table, the letter with the function to be calculated is determined
The corresponding marker bits of number ID;Judge whether the function to be calculated is network function according to the marker bit.
Device as described above, wherein, the processing module is used for:
Judged in the second buffer area with the presence or absence of the function ID and parameter of the function to be calculated using second thread;
If in the presence of the function ID and parameter is obtained from second buffer area, and by the unit where the function to be calculated
Lattice are recorded in the second dirty unit set;The calculating of network function is carried out according to the function ID and parameter, obtains result of calculation;
The result of calculation is stored to first buffer area;
Second trigger module, for triggering the processing module;Until the processing module is sentenced using second thread
The function ID and parameter of function to be calculated are not present in disconnected second buffer area;
The processing module judges whether the first thread terminates using second thread;If the first thread knot
The cell recorded in described second dirty unit set is then put into the first dirty unit set by beam;Start described first
Thread searches the corresponding result of calculation of the function information, and enters dormant state.
Device as described above, wherein, it further includes:
First judgment module, for judging whether second thread is located by status indication position using the first thread
In dormant state;
Wake-up module if judging second thread in a dormant state for first judgment module, uses institute
It states first thread and wakes up second thread.
Device as described above, wherein, it further includes:Second judgment module:
For second thread to be used to judge whether cogradient variable is labeled;If the cogradient variable is labeled, sentence
The first thread of breaking does not terminate;If the cogradient variable is unmarked, judge that the first thread terminates.
Device as described above, wherein, the processing module is specifically used for:
Initiation message is sent to the first thread using second thread, starts the first thread.
The asynchronous computing method and device of network function, passes through first thread in electrical form provided in an embodiment of the present invention
Obtain the function information of network function to be calculated;It is corresponding that the first thread searches the function information in the first buffer area
Result of calculation;If the corresponding result of calculation of the function information, the First Line are not found in first buffer area
Journey stores the function information to the second buffer area;Second thread obtains the function information, root from second buffer area
The calculating of network function is carried out according to the function information, result of calculation is stored to first buffer area, and starts described the
One thread searches the corresponding result of calculation of the function information.
In this way, first thread in calculating process, if encountering network function to be calculated, wakes up the second thread to be calculated
Network function is calculated, and after the second thread completes the calculating of network function, is started first thread and is searched in the first buffer area
The corresponding result of calculation of and function information, it is achieved thereby that the asynchronous computing of network function, reduces user and network function is waited for return
The time of result of calculation is returned, promotes user experience.Certainly, it implements any of the products of the present invention or method must be not necessarily required to simultaneously
Reach all the above advantage.
Description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, to embodiment or will show below
There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention, for those of ordinary skill in the art, without creative efforts, can be with
Other attached drawings are obtained according to these attached drawings.
Fig. 1 is the flow chart of the asynchronous computing method of network function in electrical form provided in an embodiment of the present invention;
Fig. 2 is the structural representation of the asynchronous computing device of network function in the electrical form that the embodiment of the present invention one provides
Figure;
Fig. 3 is the structural representation of the asynchronous computing device of network function in electrical form provided by Embodiment 2 of the present invention
Figure.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is carried out clear, complete
Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art are obtained every other without making creative work
Embodiment shall fall within the protection scope of the present invention.
Firstly the need of explanation, in various embodiments of the present invention, one or more resident thread is set, in order to simple
For the sake of, it is illustrated by taking a thread as an example in various embodiments of the present invention, is specifically used to calculate network function.Each reality of the present invention
It applies in example and is referred to as first thread for calculating the thread of generic function, represented with S, the thread for calculating network function is referred to as
For the second thread, represented with T.In addition, in various embodiments of the present invention, the first buffer area is also provided with for storing network function
Result of calculation, the second buffer area are used for storing the function information of calculative network function.
Below in conjunction with the accompanying drawings to various embodiments of the present invention provide electrical form in network function asynchronous computing method into
Row explanation.
Fig. 1 is the flow chart of the asynchronous computing method of network function in electrical form provided in an embodiment of the present invention.Such as Fig. 1
Shown, method provided in this embodiment can include:
Step 101, first thread obtain the function information of network function to be calculated.
Specifically, the function information includes:Function ID and parameter;In this step, the network letter to be calculated is being obtained
During several function information, the first thread upon actuation, judges to whether there is function to be calculated in the first dirty unit set;Institute
It states and pending cell is included in the first dirty unit set;If in the presence of the first thread obtains the function to be calculated
Function ID and parameter;The first thread judges whether the function to be calculated is network function according to the function ID;If sentence
Disconnected result is network function for the function to be calculated, then the function ID of the function to be calculated and parameter are network letter to be calculated
Several function informations.
Specifically, first thread S can be started by the second thread T, startup can also be user-operably, such as by user more
Change the operations such as cell, the configuration for changing electrical form to start.
The first thread when whether judge the function to be calculated is network function, first according to preset function ID with
Marker bit mapping table determines marker bit corresponding with the function ID of the function to be calculated, then according to identified label
Position judges whether the function to be calculated is network function, and the marker bit is used to mark the type of the function to be calculated.
It should be noted that if the first thread judges that the function to be calculated is not network function, then described first
Thread is calculated according to the function ID and parameter into line function, obtains the result of calculation of the function to be calculated, and by the meter
It calculates result and returns to memory;The step of first thread judges to whether there is function to be calculated in the first dirty unit set is returned,
Until the first thread judges to terminate when function to be calculated being not present in the described first dirty unit set.
Step 102, the first thread search the corresponding result of calculation of the function information in the first buffer area.
In practical applications, if to find the function information in first buffer area corresponding for the first thread
The result of calculation is then returned to memory by result of calculation, and return the first thread judge in the first dirty unit set whether
There are the step of function to be calculated, until the first thread judges that there is no functions to be calculated in the described first dirty unit set
When terminate.
If step 103 does not find the corresponding result of calculation of the function information in first buffer area, described
First thread stores the function information to the second buffer area.
The first thread stores the function information to the second buffer area, by described in the judgement of status indication position
In a dormant state whether the second thread;If second thread is in a dormant state, the first thread wakes up described the
Two threads.
It should be noted that the status indication position and the handle of second thread are placed in a data structure.
In the present embodiment, second thread is waken up by calling the system function ResumeThread of Windows systems.
Step 104, the second thread obtain the function information from second buffer area, are carried out according to the function information
The calculating of network function stores result of calculation to first buffer area, and starts the first thread and search the function
The corresponding result of calculation of information.
In this step, second thread is firstly the need of judging in the second buffer area with the presence or absence of the function to be calculated
Function ID and parameter;If in the presence of second thread obtains the function ID and parameter from second buffer area, and will
Cell where the function to be calculated is recorded in the second dirty unit set;Second thread according to the function ID and
Parameter carries out the calculating of network function, obtains result of calculation;And the result of calculation is stored to first buffer area;Return to institute
The step of judging to whether there is the function ID and parameter of function to be calculated in the second buffer area is stated, until second thread judges
The function ID and parameter of function to be calculated are not present in second buffer area, second thread judges that the first thread is
No end.
Additionally, it is also possible to will appear the first thread and second thread accesses the described second dirty cell collection simultaneously
The situation of conjunction, therefore synchrolock is set, such synchronization only allows one of thread to change the second dirty unit at random
Lattice set.Therefore, in this step, second thread judges whether the first thread terminates to include:Second thread is sentenced
Whether disconnected cogradient variable is labeled;If the cogradient variable is labeled, second thread judges that the first thread is not tied
Beam;If the cogradient variable is unmarked, second thread judges that the first thread terminates.
In the present embodiment, it is described using a thread synchronization variable using a kind of method for relatively expending CPU
First thread marks when starting and calculating, and removes label when end is calculated;Second thread is complete
After being calculated into network function, went to check the cogradient variable every one second, be continued to if the cogradient variable is marked with
It was checked every one second once, if the cogradient variable is not labeled, may determine that the first thread finishes.
If the first thread terminates, the unit that second thread will record in the described second dirty unit set
Lattice are put into the first dirty unit set;Start the first thread and search the corresponding result of calculation of the function information, and enter
Dormant state.
It needs, the first thread is typically main thread, and main thread can be according to the different message of message queue
Different flows, such as calculation process are called, in the present embodiment, second thread is by the message of the first thread
Queue sends initiation message, starts the first thread.
In actual application, the first thread has the process of One Diffusion Process, such as cell A1 before calculating
The formula of reference is=A2, and the formula of A2 references is=1, is that A2 only is added to the when A2 is changed to=2 by user
In one dirty unit set, the diffusion before the first thread calculates can also add in A1 in the first dirty unit set, this is
The existing mechanism of WPS electrical forms, details are not described herein again.
It is also possible to will appear the first thread wake-up second thread in practical applications, second thread starts
The first thread, the first thread wake up the situation of this loop start of the second thread (wake-up) again, therefore, at this
In embodiment, for this loop start (wake-up) addition number limitation, such as 7 times, if it exceeds this number limits, then enable
The first thread does not restart second thread during network function is calculated, but directly waits for second line
Journey is for the result of calculation of network function.
In conclusion in practical application, above-mentioned flow can be divided into two parts:
First part:Second thread T, which starts, enters dormant state.After second thread T is waken up by first thread S, look into
See in the second buffer area C2 whether there is function information, if there is the letter of function information, i.e. function to be calculated in the second buffer area C2
Number ID and parameter, then take out function ID and parameter carries out the calculating of network function, and by result of calculation and function ID and parameter
It is put into the first buffer area C1.And so on, until there is no the function ID of function to be calculated and parameter in the second buffer area C2.Deng
After treating first thread S, the cell of the second dirty unit set TD records is put into the first dirty unit set SD, starts one
Secondary first thread S, and enter dormant state.
Second part:In the calculating process of first thread S, if encountering network function, pass through network function first
Function ID and parameter searched whether corresponding result of calculation in the first buffer area C1, if can find, directly will meter
It calculates result and returns to memory;If can not find, function ID and parameter are put into the second buffer area C2, judge that the second thread T is
It is no in a dormant state, if the second thread T in the state of suspend mode, wakes up the second thread T, remembered by the second dirty unit set TD
Just in the cell of operation, result of calculation returns to an error value for record, wherein, error value refers to #VALUE in electrical form!#
NUM!Etc value, which is returned into first thread S as the result of calculation of function and allows it as normal result of calculation, after
The continuous calculating for carrying out next function.It, can be from when electrical form is shown it should be noted that the error value is back to memory
These data is taken to be plotted on display screen in memory.
In electrical form provided in this embodiment in the asynchronous computing method of network function, first thread obtains to be calculated
The function information of network function;The first thread searches the corresponding result of calculation of the function information in the first buffer area;
If not finding the corresponding result of calculation of the function information in first buffer area, the first thread is by the letter
Number information is stored to the second buffer area;Second thread obtains the function information from second buffer area, according to the function
Information carries out the calculating of network function, and result of calculation is stored to first buffer area, and starts the first thread and search
The corresponding result of calculation of the function information.In this way, first thread is in calculating process, if encountering network function to be calculated,
It wakes up the second thread to calculate network function to be calculated, after the second thread completes the calculating of network function, starts First Line
Journey searches the corresponding result of calculation of and function information in the first buffer area, it is achieved thereby that the asynchronous computing of network function, subtracts
Few user waits for network function to return to the time of result of calculation, promotes user experience.
Fig. 2 is the structural representation of the asynchronous computing device of network function in the electrical form that the embodiment of the present invention one provides
Figure.As shown in Fig. 2, device provided in this embodiment can include:Acquisition module 21, searching module 22, memory module 23 and place
Manage module 24.
Wherein, acquisition module 21, for obtaining the function information of network function to be calculated using first thread;
Searching module 22, by searched in the first buffer area using the first thread function information it is corresponding based on
Calculate result;
Memory module 23, if not finding the function information in first buffer area for the searching module 22
Corresponding result of calculation is then stored the function information to the second buffer area using the first thread;
Processing module 24, for the second thread to be used to obtain the function information from second buffer area, according to described
Function information carries out the calculating of network function, result of calculation is stored to first buffer area, and start the first thread
Search the corresponding result of calculation of the function information.
Specifically, the function information includes:Function ID and parameter;The acquisition module 21 is specifically used for:First thread
Upon actuation, judge to whether there is function to be calculated in the first dirty unit set;It is included in the first dirty unit set and waits to locate
The cell of reason;If in the presence of the function ID and parameter of the first thread acquisition function to be calculated is used;According to the letter
Number ID judges whether the function to be calculated is network function;If judging result is network function for the function to be calculated,
The function ID and parameter of the function to be calculated are the function information of network function to be calculated.
Further, the searching module 22 is additionally operable to:If find the function information in first buffer area
The result of calculation is then returned to memory by corresponding result of calculation;As shown in figure 3, device provided in this embodiment further includes
One trigger module 31, for triggering the acquisition module 21;Until the acquisition module 21 judges institute using the first thread
It states and terminates when function to be calculated being not present in the first dirty unit set.
Further, device provided in this embodiment further includes:Computing module 32;If it is used for the acquisition module 21
The first thread judges that the function to be calculated is not network function, then using the first thread according to the function ID and
Parameter is calculated into line function, obtains the result of calculation of the function to be calculated, and the result of calculation is returned memory;First touches
Module 31 is sent out, for triggering the acquisition module 21;Until the acquisition module 21 judges described the using the first thread
Terminate when function to be calculated being not present in one dirty unit set.
The acquisition module 21 is specifically used for:Using the first thread according to preset function ID and marker bit mapping table,
Determine marker bit corresponding with the function ID of the function to be calculated;Whether the function to be calculated is judged according to the marker bit
For network function.
The processing module 24 is used for:Judged in the second buffer area with the presence or absence of described to be calculated using second thread
The function ID and parameter of function;If in the presence of the function ID and parameter is obtained from second buffer area, and treat described
Cell where calculating function is recorded in the second dirty unit set;Network function is carried out according to the function ID and parameter
It calculates, obtains result of calculation;The result of calculation is stored to first buffer area;Second trigger module 32, is used for
Trigger the processing module 24;Until the processing module 24 judges not deposit in second buffer area using second thread
In the function ID and parameter of function to be calculated;Whether the processing module 24 judges the first thread using second thread
Terminate;If the first thread terminates, the cell recorded in the described second dirty unit set is put into the first dirty list
In member set;Start the first thread and search the corresponding result of calculation of the function information, and enter dormant state.
Described device further includes:First judgment module 34, for being judged using the first thread by status indication position
In a dormant state whether second thread;Wake-up module 35, if judging described second for first judgment module 34
Thread in a dormant state, then wakes up second thread using the first thread.
Described device further includes second judgment module 36, for using whether second thread judges cogradient variable
It is labeled;If the cogradient variable is labeled, judge that the first thread does not terminate;If the cogradient variable is unmarked,
Judge that the first thread terminates.
The processing module 24 is specifically used for:Initiation message is sent to the first thread using second thread, is opened
Move the first thread.
The present embodiment provides the asynchronous computing device of network function in electrical form, available for performing above method embodiment
Technical solution, implementing principle and technical effect are similar, and details are not described herein again.
It should be noted that herein, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any this practical relationship or sequence.Moreover, term " comprising ", "comprising" or its any other variant are intended to
Non-exclusive inclusion, so that process, method, article or equipment including a series of elements not only will including those
Element, but also including other elements that are not explicitly listed or further include as this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
Also there are other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is described using relevant mode, identical similar portion between each embodiment
Point just to refer each other, and the highlights of each of the examples are difference from other examples.Especially for system reality
For applying example, since it is substantially similar to embodiment of the method, so description is fairly simple, related part is referring to embodiment of the method
Part explanation.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all
Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention
It is interior.
Claims (18)
1. a kind of asynchronous computing method of network function in electrical form, which is characterized in that including:
First thread obtains the function information of network function to be calculated;
The first thread searches the corresponding result of calculation of the function information in the first buffer area;
If not finding the corresponding result of calculation of the function information in first buffer area, the first thread is by institute
Function information is stated to store to the second buffer area;
Second thread obtains the function information from second buffer area, and the meter of network function is carried out according to the function information
It calculates, result of calculation is stored to first buffer area, and start the first thread and search the corresponding meter of the function information
Calculate result.
2. according to the method described in claim 1, it is characterized in that, the function information includes:Function ID and parameter;
The first thread obtains the step of function information of network function to be calculated, including:
First thread upon actuation, judges to whether there is function to be calculated in the first dirty unit set;The first dirty unit collection
Pending cell is included in conjunction;
If in the presence of the first thread obtains the function ID and parameter of the function to be calculated;
The first thread judges whether the function to be calculated is network function according to the function ID;
If judging result is network function for the function to be calculated, the function ID and parameter of the function to be calculated is wait to count
Calculate the function information of network function.
3. according to the method described in claim 2, it is characterized in that, the method further includes:
If finding the corresponding result of calculation of the function information in first buffer area, the result of calculation is returned
Memory;
The step of first thread judges to whether there is function to be calculated in the first dirty unit set is returned to, until described first
Thread judges to terminate when function to be calculated being not present in the described first dirty unit set.
4. according to the method described in claim 2, it is characterized in that, the method further includes:
If the first thread judges that the function to be calculated is not network function, the first thread is according to the function ID
It is calculated with parameter into line function, obtains the result of calculation of the function to be calculated, and the result of calculation is returned into memory;
The step of first thread judges to whether there is function to be calculated in the first dirty unit set is returned to, until described first
Thread judges to terminate when function to be calculated being not present in the described first dirty unit set.
5. according to the method described in claim 2, it is characterized in that, the first thread is treated according to judging the function ID
Calculate whether function is network function, including:
The first thread determines corresponding with the function ID of the function to be calculated according to preset function ID and marker bit mapping table
Marker bit;
The first thread judges whether the function to be calculated is network function according to the marker bit.
6. according to the method described in claim 2, it is characterized in that, described in second thread from second buffer area acquisition
Function information carries out the calculating of network function according to the function information, result of calculation is stored to first buffer area, and
Start the step of first thread searches the function information corresponding result of calculation, including:
Second thread judges to whether there is the function ID and parameter of the function to be calculated in the second buffer area;
If in the presence of second thread obtains the function ID and parameter from second buffer area, and waits to count by described
Cell where calculating function is recorded in the second dirty unit set;
Second thread carries out the calculating of network function according to the function ID and parameter, obtains result of calculation;
Second thread stores the result of calculation to first buffer area;
The step of whether there is the function ID and parameter of function to be calculated in the second buffer area of the judgement is returned to, until described the
Two threads judge the function ID and parameter of function to be calculated are not present in second buffer area, described in the second thread judgement
Whether first thread terminates;
If the first thread terminates, second thread puts the cell recorded in the described second dirty unit set
Enter in the first dirty unit set;
Second thread starts the first thread and searches the corresponding result of calculation of the function information, and enter suspend mode shape
State.
7. according to the method described in claim 6, it is characterized in that, the first thread stores the function information to second
After buffer area, further include:
Whether in a dormant state the first thread judges second thread by status indication position;
If second thread is in a dormant state, the first thread wakes up second thread.
8. according to the method described in claim 6, it is characterized in that, second thread judges whether the first thread is tied
Beam, including:
Second thread judges whether cogradient variable is labeled;
If the cogradient variable is labeled, second thread judges that the first thread does not terminate;
If the cogradient variable is unmarked, second thread judges that the first thread terminates.
9. according to the method described in claim 6, it is characterized in that, second thread starts the first thread, including:
Second thread sends initiation message to the first thread, starts the first thread.
10. a kind of asynchronous computing device of network function in electrical form, which is characterized in that including:
Acquisition module, for obtaining the function information of network function to be calculated using first thread;
Searching module, for being searched in the first buffer area using the first thread, the function information is corresponding to calculate knot
Fruit;
Memory module, if do not found in first buffer area by the searching module function information it is corresponding based on
It calculates as a result, then being stored the function information to the second buffer area using the first thread;
Processing module for the second thread to be used to obtain the function information from second buffer area, is believed according to the function
Breath carries out the calculating of network function, and result of calculation is stored to first buffer area, and starts the first thread and search institute
State the corresponding result of calculation of function information.
11. device according to claim 10, which is characterized in that the function information includes:Function ID and parameter;
The acquisition module is specifically used for:First thread upon actuation, is judged in the first dirty unit set with the presence or absence of to be calculated
Function;Pending cell is included in the first dirty unit set;If in the presence of being treated using described in first thread acquisition
Calculate the function ID and parameter of function;Judge whether the function to be calculated is network function according to the function ID;If judge
As a result it is network function for the function to be calculated, then the function ID of the function to be calculated and parameter are network function to be calculated
Function information.
12. according to the devices described in claim 11, which is characterized in that the searching module is additionally operable to:
If finding the corresponding result of calculation of the function information in first buffer area, the result of calculation is returned
Memory;
First trigger module, for triggering the acquisition module;Until the acquisition module judges institute using the first thread
It states and terminates when function to be calculated being not present in the first dirty unit set.
13. according to the devices described in claim 11, which is characterized in that further include:Computing module;
If judging that the function to be calculated is not network function using the first thread for the acquisition module, institute is used
It states first thread to be calculated into line function according to the function ID and parameter, obtains the result of calculation of the function to be calculated, and will
The result of calculation returns to memory;
First trigger module, for triggering the acquisition module;Until the acquisition module judges institute using the first thread
It states and terminates when function to be calculated being not present in the first dirty unit set.
14. according to the devices described in claim 11, which is characterized in that the acquisition module is specifically used for:
Using the first thread according to preset function ID and marker bit mapping table, the function ID with the function to be calculated is determined
Corresponding marker bit;Judge whether the function to be calculated is network function according to the marker bit.
15. according to the devices described in claim 11, which is characterized in that the processing module is used for:
Judged in the second buffer area with the presence or absence of the function ID and parameter of the function to be calculated using second thread;If it deposits
The function ID and parameter are then being obtained from second buffer area, and the cell where the function to be calculated is remembered
Record is in the second dirty unit set;The calculating of network function is carried out according to the function ID and parameter, obtains result of calculation;By institute
Result of calculation is stated to store to first buffer area;
Second trigger module, for triggering the processing module;Until the processing module judges institute using second thread
State the function ID and parameter that function to be calculated is not present in the second buffer area;
The processing module judges whether the first thread terminates using second thread;If the first thread terminates,
Then the cell recorded in the described second dirty unit set is put into the first dirty unit set;Start the first thread
The corresponding result of calculation of the function information is searched, and enters dormant state.
16. device according to claim 15, which is characterized in that further include:
First judgment module, for the first thread to be used to judge second thread whether in not by status indication position
Dormancy state;
Wake-up module if judging second thread in a dormant state for first judgment module, uses described
Second thread described in one thread wakening.
17. device according to claim 15, which is characterized in that further include:Second judgment module:
For second thread to be used to judge whether cogradient variable is labeled;If the cogradient variable is labeled, institute is judged
First thread is stated not terminate;If the cogradient variable is unmarked, judge that the first thread terminates.
18. device according to claim 15, which is characterized in that the processing module is specifically used for:
Initiation message is sent to the first thread using second thread, starts the first thread.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710003977.2A CN108268564B (en) | 2017-01-04 | 2017-01-04 | Asynchronous calculation method and device for network function in spreadsheet |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710003977.2A CN108268564B (en) | 2017-01-04 | 2017-01-04 | Asynchronous calculation method and device for network function in spreadsheet |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108268564A true CN108268564A (en) | 2018-07-10 |
CN108268564B CN108268564B (en) | 2020-08-14 |
Family
ID=62771601
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710003977.2A Active CN108268564B (en) | 2017-01-04 | 2017-01-04 | Asynchronous calculation method and device for network function in spreadsheet |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108268564B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115658144A (en) * | 2022-12-09 | 2023-01-31 | 西安葡萄城软件有限公司 | Spreadsheet formula on-demand calculation method and device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102222023A (en) * | 2010-04-15 | 2011-10-19 | 微软公司 | Asynchronous workflows |
CN102662614A (en) * | 2012-03-23 | 2012-09-12 | 安科智慧城市技术(中国)有限公司 | Embedded device and time display method and time display system thereof |
CN102724056A (en) * | 2011-07-28 | 2012-10-10 | 北京天地互连信息技术有限公司 | Mobile IPv6 network management system and method |
CN104104614A (en) * | 2014-06-13 | 2014-10-15 | 中国科学院计算技术研究所 | Software defined network controller system in named data networking and method thereof |
CN105446755A (en) * | 2014-08-06 | 2016-03-30 | 阿里巴巴集团控股有限公司 | Method and device for rapidly loading Activity data for Android system |
CN106209606A (en) * | 2016-08-31 | 2016-12-07 | 北京深思数盾科技股份有限公司 | A kind of use the method for WEB mail, terminal and system safely |
-
2017
- 2017-01-04 CN CN201710003977.2A patent/CN108268564B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102222023A (en) * | 2010-04-15 | 2011-10-19 | 微软公司 | Asynchronous workflows |
CN102724056A (en) * | 2011-07-28 | 2012-10-10 | 北京天地互连信息技术有限公司 | Mobile IPv6 network management system and method |
CN102662614A (en) * | 2012-03-23 | 2012-09-12 | 安科智慧城市技术(中国)有限公司 | Embedded device and time display method and time display system thereof |
CN104104614A (en) * | 2014-06-13 | 2014-10-15 | 中国科学院计算技术研究所 | Software defined network controller system in named data networking and method thereof |
CN105446755A (en) * | 2014-08-06 | 2016-03-30 | 阿里巴巴集团控股有限公司 | Method and device for rapidly loading Activity data for Android system |
CN106209606A (en) * | 2016-08-31 | 2016-12-07 | 北京深思数盾科技股份有限公司 | A kind of use the method for WEB mail, terminal and system safely |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115658144A (en) * | 2022-12-09 | 2023-01-31 | 西安葡萄城软件有限公司 | Spreadsheet formula on-demand calculation method and device |
Also Published As
Publication number | Publication date |
---|---|
CN108268564B (en) | 2020-08-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105677240B (en) | Data-erasure method and system | |
CN108632097B (en) | Abnormal behavior object identification method, terminal device and medium | |
CN105159777B (en) | The method for recovering internal storage and device of process | |
CN104063381B (en) | The display methods and terminal of multistage tree menu | |
US9218199B2 (en) | Identifying thread progress information by monitoring transitions between interesting states | |
CN107146064A (en) | backlog reminding method and server | |
CN102902573A (en) | Task processing method and device based on shared resources | |
CN103259688A (en) | Failure diagnosis method and device of distributed storage system | |
CN106403949A (en) | Library navigation method and system based on large database | |
CN108154252A (en) | Method and apparatus for estimating the flow deadline | |
CN107992504A (en) | A kind of document handling method and device | |
CN108572883A (en) | A kind of data correctness method of calibration and device | |
CN108255984A (en) | A kind of data analysis method and device | |
CN109522467A (en) | A kind of analysis method and device of the label time based on big data platform | |
CN111176850B (en) | Data pool construction method, device, server and medium | |
CN110445864A (en) | The realization method and system of distributed lock under a kind of cloud computing environment | |
CN108268564A (en) | The asynchronous computing method and device of network function in electrical form | |
CN104516817B (en) | A kind of memory leakage detecting method and device | |
CN107248085A (en) | A kind of decoration cost computational methods and device | |
CN103942238B (en) | Information providing apparatus and information providing method | |
JP5347742B2 (en) | Visitor management system and control program for visitor management system | |
JP2006025434A5 (en) | ||
CN110232057B (en) | Data rollback method, electronic device and storage medium | |
CN110413921A (en) | Webpage loading method, device, computer equipment and storage medium | |
US8683018B2 (en) | System and method of tracking and communicating computer states |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |