CN107329812B - A kind of method and apparatus for running association's journey - Google Patents
A kind of method and apparatus for running association's journey Download PDFInfo
- Publication number
- CN107329812B CN107329812B CN201710432602.8A CN201710432602A CN107329812B CN 107329812 B CN107329812 B CN 107329812B CN 201710432602 A CN201710432602 A CN 201710432602A CN 107329812 B CN107329812 B CN 107329812B
- Authority
- CN
- China
- Prior art keywords
- journey
- target
- association
- target association
- function
- 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.)
- Active
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/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/485—Task life-cycle, e.g. stopping, restarting, resuming execution
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Navigation (AREA)
Abstract
The invention discloses a kind of operation association journeys, belong to field of computer technology.The method includes:During target assists Cheng Yunhang, when target association journey is hung up, store the function execution position and operation data of the target association Cheng Dangqian, record the relative position of target storage position and initial storage location, wherein, the target storage position is the function execution position and the storage location of operation data, and the initial storage location assists the initial position of the storage region of the affiliated process of journey for the target;When the activation trigger event for detecting target association journey, according to the relative position, the function execution position and operation data are obtained;The function of target association journey is re-called, based on the function execution position and operation data, continues to run with target association journey.Using the present invention, it is ensured that after process rusume, assist journey normal operation.
Description
Technical field
The present invention relates to field of computer technology, more particularly to a kind of method and apparatus for running association's journey.
Background technology
With the continuous development of computer technology, the business that server-side is provided becomes increasingly complex, is diversified, these business
Often relate to a large amount of asynchronous process, and under normal circumstances can using association's journey (function for being used for realizing certain standalone features) come into
These asynchronous process of row.For example, the user that game services end provides logs in this business, it is related to presence detection, account peace
A variety of asynchronous process such as full inspection is surveyed, and account data is obtained in the process that user logs in is realized, can use different association's journey point
Above-mentioned asynchronous process is not carried out.
The a certain thread of business obtains some parameter A, then can create related association if necessary when carrying out to a certain step
Journey is handled by the acquisition of the association above-mentioned A of Cheng Jinhang.Assisting journey, discovery needs the B that gets parms, then can be temporary during A is obtained
Stop handling (can be described as hanging up), the context (context includes the Function return addresses and operation data of association's journey) of storage association journey,
And corresponding storage address is recorded, while the acquisition for sending B to external (can be other association's journeys or thread) is asked.And then when
After the B for receiving external return, association's journey can run and (can be described as activating) again, i.e., according to the storage address of record, read association
Journey context is then based on B and carries out subsequent processing.
In the implementation of the present invention, inventor has found that the prior art has at least the following problems:
Existing server-side generally improves process redundancy ability using resume (restarting) mechanism, mainly will be entire
The operation data of the process (can include multiple threads in process) of business is stored in shared storage area, in this way, in process
After it is unexpected that collapse restart again, the operation data being stored in shared storage area will not be damaged or be lost.Meanwhile
Under resume mechanism, after process restarting, the operation data in shared storage area is maliciously stolen in order to prevent, generally
Random offset will be carried out to the storage address of data in shared storage area, in this way, the context that association's journey stores when hanging up
Actual storage address will change, and assist the storage address recorded in journey that will fail, and association's journey will be unable to normal operation.
Invention content
In order to solve problem of the prior art, an embodiment of the present invention provides a kind of method and apparatus for running association's journey.Institute
It is as follows to state technical solution:
In a first aspect, a kind of method for running association's journey is provided, the method includes:
During target assists Cheng Yunhang, when target association journey is hung up, the letter of the target association Cheng Dangqian is stored
Number execution position and operation data record the relative position of target storage position and initial storage location, wherein, the target is deposited
Storage space is set to the storage location of the function execution position and operation data, and the initial storage location assists journey institute for the target
The initial position of the storage region of category process;
When the activation trigger event for detecting target association journey, according to the relative position, obtain the function and hold
Line position is put and operation data;
The function of target association journey is re-called, based on the function execution position and operation data, continues to run with institute
State target association journey.
Second aspect, provides a kind of device for running association's journey, and described device includes:
Memory module during assisting Cheng Yunhang in target, when target association journey is hung up, stores the target
The function execution position and operation data of Cheng Dangqian is assisted, records the relative position of target storage position and initial storage location,
In, the target storage position is the function execution position and the storage location of operation data, and the initial storage location is
The initial position of the storage region of the target association affiliated process of journey;
Acquisition module, for when detecting that the target assists the activation trigger event of journey, according to the relative position, obtaining
Take the function execution position and operation data;
Module is run, for re-calling the function of target association journey, based on the function execution position and operation number
According to continuing to run with target association journey.
The third aspect, provides a kind of network equipment, and the network equipment includes processor and memory, the memory
In be stored at least one instruction, at least one section of program, code set or instruction set, at least one instruction, described at least one
Duan Chengxu, the code set or instruction set are loaded by the processor and are performed to realize that journey is assisted in operation as described in relation to the first aspect
Method.
Fourth aspect provides a kind of computer readable storage medium, at least one finger is stored in the storage medium
Enable, at least one section of program, code set or instruction set, at least one instruction, at least one section of program, the code set or
Instruction set is loaded by processor and is performed the method to realize operation association journey as described in relation to the first aspect.
The advantageous effect that technical solution provided in an embodiment of the present invention is brought is:
In the embodiment of the present invention, as process resume, it is stored in the storage of the process data in shared storage area
Address integrally shifts, and process data includes the function execution position and operation data that are stored when target association journey is hung up.It adopts
With this programme, because having recorded relative position of the related data of above-mentioned target association journey in the storage region of process data, therefore
And even if the storage address of process data is deviated, since relative position does not change, hung up in target association journey
When, if process resume, the related data of the target association journey of record can also be found based on relative position, so as to
Continue to run with target association journey.
Description of the drawings
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment
Attached drawing is briefly described, it should be apparent that, the accompanying drawings in the following description is only some embodiments of the present invention, for
For those of ordinary skill in the art, without creative efforts, other are can also be obtained according to these attached drawings
Attached drawing.
Fig. 1 is a kind of method flow diagram for running association's journey provided in an embodiment of the present invention;
Fig. 2 is a kind of schematic diagram of a scenario for running association's journey provided in an embodiment of the present invention;
Fig. 3 is a kind of principle schematic for running association's journey provided in an embodiment of the present invention;
Fig. 4 is a kind of schematic diagram for running fault detect when assisting journey provided in an embodiment of the present invention;
Fig. 5 is a kind of overall framework schematic diagram for running association's journey provided in an embodiment of the present invention;
Fig. 6 is a kind of apparatus structure schematic diagram for running association's journey provided in an embodiment of the present invention;
Fig. 7 is a kind of apparatus structure schematic diagram for running association's journey provided in an embodiment of the present invention;
Fig. 8 is a kind of apparatus structure schematic diagram for running association's journey provided in an embodiment of the present invention;
Fig. 9 is a kind of apparatus structure schematic diagram for running association's journey provided in an embodiment of the present invention;
Figure 10 is a kind of structure diagram of network equipment provided in an embodiment of the present invention;
Figure 11 is a kind of schematic diagram of code provided in an embodiment of the present invention;
Figure 12 is a kind of schematic diagram of the content composition of program-controlled clamp dog of association provided in an embodiment of the present invention.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention
Formula is described in further detail.
An embodiment of the present invention provides a kind of method for running association's journey, this method is mainly used on network devices, network
Equipment can be the server or terminal of network service provider, in the present embodiment, be said based on server
Bright, the realization process of terminal is similar.Server can be have the function of realize network service arbitrary server, Ke Yishi
The background server of online game or the background server of social software etc..Network service can have been run on server
Corresponding business process, each business process can include multiple processing threads, be asked for the different function of processing business.
It can include processor, memory, transceiver in server, processor can be used for carrying out the operation association journey in following flows
Processing, memory can be used for storing the data needed in following processing procedures and the data of generation, transceiver can be used for
The related data in following processing procedures is sended and received, the acquisition for being such as used to send some parameter to external equipment is asked, and is connect
Receive parameter that external equipment returns etc..In the present embodiment, illustrated so that server is the background server of online game as an example,
Other situations are similar therewith, this implementation is no longer illustrated one by one.
Below in conjunction with specific embodiment, process flow shown in FIG. 1 is described in detail, content can be as
Under, concrete scene can log in game server with reference chart 2, herein with user, create and said for the process of game role
Bright, server can receive role's request to create of terminal transmission, then create corresponding thread, need to complete angle in the thread
Color name duplicate checking, actor model data record, the transmission of new hand's mail etc. processing, and these are handled, and can pass through multiple associations respectively
Journey performs completion:
Below in conjunction with specific embodiment, process flow shown in FIG. 1 is described in detail, content can be as
Under:
Step 101, during target assists Cheng Yunhang, when target association journey is hung up, the letter of storage target association Cheng Dangqian
Number execution position and operation data record the relative position of target storage position and initial storage location.
Wherein, target storage position is function execution position and the storage location of operation data, and initial storage location is mesh
The initial position of the storage region of the mark association affiliated process of journey.
In force, user is by terminal login service device, and after carrying out role's establishment, and server can receive accordingly
Role's request to create, then obtain the character data carried in role's request to create, character data can include role name,
Actor model data, role's affiliated area etc., then server relevant role can be called to create processing function (i.e. thread
Code), it creates role and handles thread, for carrying out above-mentioned Client-initiated role establishment processing.Create role handle thread it
Afterwards, server can create the execution logic of processing function according to role and handle thread to run the role, which handles line
Journey needs to complete involved in a large amount of role's establishment processes such as role name duplicate checking, actor model data record, the transmission of new hand's mail
Processing, in this way, can correlation function be realized by multiple association's journeys respectively.Specifically, in role creates processing function, it can be with
The code for calling related association's eikonal number (function as being used for role name duplicate checking) is finished writing in advance, is performed when role creates processing thread
During to step corresponding to the code, the processing for calling related association's eikonal number can be triggered, that is, creates target association journey, and then server
Target association journey can be run, journey is assisted to realize the processing of role name duplicate checking by target.
And during target assists Cheng Yunhang, it can be related to the calling processing of other association's eikonal numbers or to other lines
Journey/equipment sends the acquisition request of some parameter, it will be understood that and it is identical with principle above, at the given step of association's eikonal number
It can be with the code for calling other association's eikonal numbers or transmission parameter acquiring request.In this way, in the process of target association Cheng Yunhang
In, when operation is to above-mentioned code, if triggering the processing of the other association's eikonal numbers of calling, target association journey is hung up (i.e. in extension
The state of rising), target can then be assisted association's eikonal number that the process resource of journey is supplied to this called by server, so that called
Eikonal number is assisted to realize correlation function using above-mentioned process resource, if sending some ginseng alternatively, triggering to other thread/equipment
Several acquisition requests, server can then assist target the process resource of journey to be used for other processing.
When target association journey is hung up, server can record the function execution position of target association Cheng Dangqian and target is held
Temporary variable during row.Label is added at the function execution position of Cheng Dangqian specifically, can be assisted in target, is then passed through
The corresponding numerical value of the label is recorded to achieve the purpose that record current function execution position.With reference to the execution logic of tradition association journey
From the point of view of, when tradition association journey goes to " yield " sentence, tradition association journey concedes process resource and enters suspended state, in this programme
Association Cheng Ze " case " branch statement (mark) can be inserted at " yield " using macrodefinition, then preserve case
Label values.Later, the storage location (i.e. target storage position) of above-mentioned function execution position and operation data can be re-recorded
The relative position of the initial position of the storage region of the affiliated process of journey is assisted with target.Herein, storage unit can specifically be passed through
Byte location is recorded, such as:Relative position can be the 200th byte to the 300th byte after initial position etc..
It is noted that during above description, target association journey can be main thread called association's journey (it is appreciated that
For level-one call association journey), in other embodiments, target association journey can also be by it is other association journeys call association's journeys (it is appreciated that
Association's journey is called for multistage), principle is similar, therefore all situations is not illustrated one by one respectively in the present embodiment.
Optionally, server can be that each association's journey distribution is independent, for storing function execution position when association's journey is hung up
The storage unit with operation data is put, so, when creating target association journey, journey is assisted to distribute Destination Storage Unit for target, accordingly
, the processing of step 101 can be as follows:The function execution position of target association Cheng Dangqian and operation data are stored to target and stored
Unit records the storage location of Destination Storage Unit and the relative position of initial storage location.
In force, association's thread management thread can be included in the process belonging to target association journey, for managing entire process
In it is all association journeys related datas (including association journey hang up when function execution position and operation data).The data of all association's journeys can
To be uniformly stored in a certain storage region (can be referred to as association Cheng Chi), association Cheng Chi includes several storage units (can be with
Referred to as assist program-controlled clamp dog), and the corresponding program-controlled clamp dog of association of association's journey that can be currently running there are one vernier direction.Tool
In body to the present embodiment, when creating target association journey, server can be by assisting thread management thread journey to be assisted to distribute one for target
Program-controlled clamp dog is assisted, while the mark of target association journey is stored in the program-controlled clamp dog of the association.In this way, when target assists Cheng Yunhang, journey is assisted
The vernier in pond is directed toward the corresponding program-controlled clamp dog of association of target association journey always, and when triggering the journey hang-up of target association, server can be by mesh
The function execution position and operation data of mark association Cheng Dangqian is stored to assisting in program-controlled clamp dog, then re-records Destination Storage Unit
The relative position of storage location and initial storage location.
Step 102, when the activation trigger event for detecting target association journey, according to relative position, function execution position is obtained
It puts and operation data.
In force, after target association Cheng Yunhang, if at operation to preset association's journey hang-up, " yield " language is such as gone to
During sentence, triggering target association journey enters suspended state, and target can then be assisted the process resource of journey to redistribute by server at this time.
After target association journey is hung up, if detecting the activation trigger event of target association journey, the activation processing of target association journey can be carried out,
Specifically can when target association journey is hung up in first obtaining step 101, the target storage position of record and initial storage location it is opposite
Position, then determines the relative position corresponding memory space in the storage region of the target association affiliated process of journey, and then can be with
The function execution position and operation data stored when target association journey is hung up is obtained in the memory space.For example, relative position can
To be the 200th byte to the 300th byte after initial position, then after the activation trigger time for detecting target association journey, first obtain
The relative position of " -300 byte of 200 byte " is got, then determines the initial storage of the memory space of the target association affiliated process of journey
Position, such as at the 10000th byte of entire shared storage area, so, it may be determined that go out the target storage position in step 101
The 10200th byte in shared storage area is set to the 10300th byte, in this way, can then be got in the storage region
The function execution position and operation data that target association journey is stored when hanging up.
It is noted that the activation trigger event of target association journey can be varied, different association's journeys can be set with
Different activation trigger events, activation trigger event can receive the message of extraneous return or can reach some
Time point can also be after hanging up through going through preset duration etc..Herein, " external world " can refer to equally run in the server
Association's journey, thread, process except target association journey, also can also be and operate on miscellaneous equipment, carry out data transmission with server
Association's journey, thread, process etc..In the present embodiment, subsequently at necessity, it will be returned using activation trigger event as other association's journeys are received
It is illustrated for the message returned.
Optionally, the concept based on above-mentioned Destination Storage Unit (assisting program-controlled clamp dog), the processing of step 102 can be:When
When detecting the activation trigger event of target association journey, the function execution position stored in Destination Storage Unit and operation number are obtained
According to.
In force, after target association journey is hung up, when the activation trigger event for detecting target association journey, triggering activation mesh
Mark association journey, server then can find Destination Storage Unit according to the mark of above-mentioned relative position and target association journey, then obtain
Take the function execution position and operation data stored in Destination Storage Unit.
Step 103, the function of target association journey is re-called, based on function execution position and operation data, continues to run with mesh
Mark association journey.
In force, target assists journey when in suspended state, if server detects the activation trigger of target association journey
After event, it will the activation processing of target association journey is carried out, so as to continue to run with target association journey at the hang-up of target association journey.It is specific
Process can be as follows:, can be such as step 102 in activation target association Cheng Qian, first the relative position based on record, gets target association
The function execution position and operation data that journey stores when hanging up.Then the function of target association journey can be re-called, according to storage
Function execution position determine the position that runs to when target association journey is hung up, the operation data of storage is then transferred again, from hang-up
Position at continue to run with target association journey.It " is inserted at " yield " one " case " point using macrodefinition with reference in step 101
Branch sentence (mark) then preserves the label values of case " example, processing herein can be re-called in activation
Target assists the function of journey, then jumps directly to corresponding case by " switch " sentence and the label values of above-mentioned preservation
At sentence, target association journey is continued to run with, i.e., is assisted with switch sentences instead of tradition in journey " reenter ", in this way, can then lead to
It is semantic to simulate the hang-up of tradition association journey and activation to cross " switch-case " branch statement.It specifically can be such as figure 11 below generation
Shown in code, wherein, " switch (pos) " is utilized to utilize " pos=n instead of the function of " reenter ";return;case n”
Instead of the function of " yield ".
Optionally, before the function for re-calling association's journey, whether need to judge to assist journey in suspended state, correspondingly, step
Rapid 103 part processing can be as follows:If the execution state of target association journey is suspended state, target association journey is re-called
Function.
In force, tradition association's journey " reenter-yield " is realized using " switch-case " sentence in the present embodiment
The function of (activation-hang-up) sentence, wherein, as shown in figure 3, employing the combination of " pos-return-case " at " yield "
Sentence replaces " yield " sentence, in this way, it will be understood that when being activated after target association journey is hung up, " return " sentence will touch
Hair returns to the processing of higher level's function of target association journey, and higher level's function continues to execute, and triggering re-calls the letter of target association journey
Several processing.And have to be mentioned that, it is last in the function of target association journey, " return " sentence is equally existed, in target
After assisting Cheng Yunhang, triggering returns to the processing of higher level's function of target association journey.In this way, in the function for re-calling target association journey
Before, the execution state of target association journey can be detected, if the execution state of target association journey is suspended state, can be adjusted again
The function of journey is assisted with target, and if the execution state of target association journey is the state that is finished, no longer invocation target assists journey
Function.With reference to the processing of the program-controlled clamp dog of above-mentioned association, status indication item can be added, will be assisted in activation target association journey every time program-controlled
It makes status indication item in the block and is set as A, status indication item is set as B when target association journey goes to yield.And then in weight
During the function of new invocation target association journey, the corresponding association's process control status indication in the block of target association journey can be first checked, if shape
State is labeled as A, then it represents that target association Cheng Yunhang is finished, so as to directly delete the program-controlled clamp dog of the association, and if status indication
For B, then target association journey is suspended state, so as to which target is activated to assist journey, that is, re-calls the function of target association journey.It assists program-controlled
The content composition of clamp dog can with shown in reference chart 12, wherein, " pos " field is used to store the function execution position of target association journey,
" userdata " field is used to store the operation data of target association journey, and " id " field is used to record the mark of target association journey,
" exitflag " field is used to store the status indication of target association journey.
Herein, the step of combining Fig. 3, journey is assisted to above-mentioned operation, is specifically described, and when creating target association journey, is assisting
Cheng Chizhong assists journey distribution to assist program-controlled clamp dog for target, and the mark of write-in target association journey, will assist program-controlled clamp dog in program-controlled clamp dog is assisted
Target association Cheng Jinhang data storage (processing that association's journey is passed to i.e. in figure) is supplied to, Cheng Yunhang is assisted to " yield " sentence in target
When, record function execution position, ephemeral data and status indication etc. in program-controlled clamp dog is assisted, when the journey activation of target association, again
Invocation target assists the function of journey, and process control data in the block will be assisted to be passed to target association journey, continues to run with target association journey.
Optionally, association's journey causes process to repeat machine of delaying in order to prevent, can set association's journey Fault Isolation mechanism, corresponding to locate
Reason can be as follows:During target assists Cheng Yunhang, if the process belonging to target association journey breaks down, target is assisted into journey
The corresponding number of stoppages adds one;If the corresponding number of stoppages of target association journey is more than the first predetermined threshold value, in journey institute of target association
During the process restarting of category, the father for terminating operational objective association's journey and target association journey assists journey, and target is assisted association's journey belonging to journey
The corresponding number of stoppages of type adds one.
Wherein, the father of target association journey assists association's journey that journey is the function for triggering invocation target association journey.
In force, target association journey in the process of running, if the process belonging to target association journey breaks down, is delayed
Machine, server then need to carry out resume to the process, i.e., the process is transferred from shared storage area and is delayed the institute stored before machine
There are data, and process is restarted according to these data.After process resume, it will continue to run with target association journey.If mesh
Process belonging to mark association journey is frequently delayed machine, it may be considered that target association journey results in above-mentioned failure, so can occur it is certain
After the failure of number, in the process of restarting, operational objective association journey is terminated.It specifically can first set a number of stoppages threshold value
(i.e. the first predetermined threshold value), then during target assists Cheng Yunhang, there is failure in the process belonging to each target association journey,
The corresponding number of stoppages of target association's journey is then added one, in this way, after each process resume again operational objective association journey when, can be with
The first corresponding number of stoppages of detection target association journey, if it greater than the first predetermined threshold value, it may be considered that failure is assisted by target
Cheng Yinfa's, so target association journey can no longer be reruned, that is, the upper level function of target association journey is returned to, skip over target association journey
Invocation step, continue to execute subsequent processing.Further, in order to avoid the father association journey to target association journey is adjusted repeatedly when being executed
Journey is assisted with target, so when terminating operational objective association journey, the father that can also terminate operational objective association journey assists journey.Need what is illustrated
It is that all higher levels that father assists journey and can refer to target association journey assist journey, as thread A calls association journey B, association journey B to call association journey C, association journey C
Invocation target assists journey D, then the father of target association journey D assists journey that can include association journey B and association journey C.In addition, terminating operational objective association journey
And after his father assists journey, server can record failure, and prompt technical staff's target association that journey goes wrong.Ordinary circumstance
Under, the technical staff of server side can be in advance for the invocation step setting troubleshooting side of association's journey each in some thread
Case when breaking down or assist Cheng Wufa calling as the association Cheng Yunhang of calling, that is, triggers preset troubleshooting scheme, should
Troubleshooting scheme can be to skip invocation step or call spare function etc., in this way, terminate target association's journey and its
After father assists journey, the thread belonging to target association journey will not be out of service, can continue other processing.
Further, terminate operational objective association journey and target association journey father assist journey after, can record target association journey because
The number for breaking down and being terminated, meanwhile, in order to avoid the other association's journeys for journey being assisted to belong to same association's journey type with target exist
Identical failure can record association's journey of identical association's journey type because of the number unification that failure is terminated, so assist journey in target
After being terminated operation, target can be assisted the corresponding number of stoppages of association's journey type belonging to journey to add one by server.
Optionally, based on above-mentioned Fault Isolation mechanism, it can be detected when target assists journey to create, accordingly
Processing can be as follows:When creating target association journey again, if the corresponding number of stoppages of association's journey type belonging to target association journey is big
In the second predetermined threshold value, then refuse to create target association journey.
In force, when creating target association journey again, server can first detect association's journey type belonging to target association journey
The corresponding number of stoppages if the number of stoppages is more than the second predetermined threshold value, can be determined that association's journey under association's journey type has
Very big probability causes process to break down, then can refuse to create target association journey, that is, show and create failed message.Certainly, technology
Personnel after all association Cheng Jinhang reparations, can reset the corresponding number of stoppages under to association's journey type belonging to target association journey,
In this way, when again create target association journey when, server then can smoothly invocation target association journey function, and operational objective assist journey.
Fig. 4 will be combined herein, the processing of above-mentioned Fault Isolation will be specifically described, and when target assists Cheng Yunhang, be caused
Its affiliated process, which breaks down, carries out resume, if resume number (is equal to failure frequency to reach more than certain threshold value
To predetermined threshold value), then it terminates operational objective association's journey and his father assists journey, and determines the classification of target association journey, target is then assisted into journey
The affiliated corresponding number of stoppages of association's journey type adds one.It, can be first to the association belonging to association's journey and then when creating new association's journey
Journey classification is judged, if the corresponding number of stoppages of association's journey classification is more than predetermined threshold value, refuses to create association's journey, if association
The corresponding number of stoppages of journey type is less than predetermined threshold value, then normal to create association's journey, above-mentioned processing is " association's journey type mistake in figure
Filter ".
Fig. 5 is the overall framework figure of the present embodiment, wherein main include three association's thread management layer, association's journey, Fault Isolation portions
Point, association's thread management layer segment can be regarded as association's thread management thread again, and the corresponding association's process control of journey is respectively assisted for managing to assist in Cheng Chi
Block when association's journey partially illustrates association Cheng Yunhang, is triggered at " yield " sentence and is hung up, the activation association journey after the external world returns to message
Operating mechanism, Fault Isolation part realizes above-mentioned according to the number of stoppages, terminates operation association's journey or refusal creates association's journey
Processing.
In the embodiment of the present invention, as process resume, it is stored in the storage of the process data in shared storage area
Address integrally shifts, and process data includes the function execution position and operation data that are stored when target association journey is hung up.It adopts
With this programme, because having recorded relative position of the related data of above-mentioned target association journey in the storage region of process data, therefore
And even if the storage address of process data is deviated, since relative position does not change, hung up in target association journey
When, if process resume, the related data of the target association journey of record can also be found based on relative position, so as to
Continue to run with target association journey.
For the ease of understanding scheme, the embodiment of the present invention also illustratively provides operation association journey in a kind of network equipment
Disposed of in its entirety flow, specifically can be as follows:
Step 1:The establishment of role B that the client that the server (i.e. the network equipment) of game A receives game A is sent please
It asks;
Step 2:Server creates establishment and the active thread C of role B under the process of game A;
Step 3:During server active thread C, need to carry out role name duplicate checking processing, call role name duplicate checking function, touch
Hair creates association journey D;
Step 4:The corresponding number of stoppages of association's journey type belonging to server detection association journey D, if the number of stoppages is more than in advance
If threshold value, then stop creating association journey D, if the number of stoppages is less than predetermined threshold value, jump to step 5;
Step 5:Server creates and runs association journey D, and assists program-controlled clamp dog E for association's journey D distribution;
Step 6:During server operation association journey D, association journey D needs to obtain data F, and association journey D is hung up, and server is to database
The acquisition request of transmission data F;
Step 7:The function execution position and operation data of server storage association journey D in program-controlled clamp dog E is assisted, and discharge
The process resource that journey D is assisted to occupy;
Step 8:Server receives the data F that database returns;
Step 9:Whois lookup assists program-controlled clamp dog E, obtains function execution position and the operation of the association journey D wherein stored
Data;
Step 10:Server continues to run with association journey D according to above-mentioned function execution position and operation data;
Step 11:Association's journey D operations finish, and return to role name duplicate checking result;
Step 12:Server based role name duplicate checking result continues to run with thread C.
Based on identical technical concept, the embodiment of the present invention additionally provides a kind of device for running association's journey, as shown in fig. 6,
The device includes:
Memory module 601, during assisting Cheng Yunhang in target, when target association journey is hung up, described in storage
Target assists the function execution position and operation data of Cheng Dangqian, records the opposite position of target storage position and initial storage location
It puts, wherein, storage location of the target storage position for the function execution position and operation data, the initial storage position
It is set to the initial position of the storage region of the target association affiliated process of journey;
Acquisition module 602, for when the activation trigger event for detecting target association journey, according to the opposite position
It puts, obtains the function execution position and operation data;
Module 603 is run, for re-calling the function of target association journey, based on the function execution position and operation
Data continue to run with target association journey.
Optionally, as shown in fig. 7, described device further includes:
Distribution module 604, for when creating the target association journey, journey being assisted to distribute Destination Storage Unit for the target;
The memory module 601, is specifically used for:
The function execution position of target association Cheng Dangqian and operation data are stored to the Destination Storage Unit, record
The storage location of the Destination Storage Unit and the relative position of initial storage location.
Optionally, the operation module 603, is specifically used for:
If the execution state of target association journey is suspended state, the function of target association journey is re-called.
Optionally, as shown in figure 8, described device further includes:
Fault logging module 605, during assisting Cheng Yunhang in the target, if belonging to target association journey
Process breaks down, then the corresponding number of stoppages of target association journey is added one;
Module 606 is terminated, if being more than the first predetermined threshold value for the corresponding number of stoppages of target association journey, in institute
When stating the process restarting belonging to target association journey, the father for terminating operation target association's journey and target association journey assists journey, and
The corresponding number of stoppages of association's journey type belonging to journey is assisted to add one the target, wherein, it is tactile that the father of target association journey, which assists journey,
Hair calls association's journey of the function of target association journey.
Optionally, as shown in figure 9, described device further includes:
Creation module 607, for when creating target association journey again, if association's journey class belonging to target association journey
The corresponding number of stoppages of type is more than the second predetermined threshold value, then refuses to create target association journey.
In the embodiment of the present invention, as process resume, it is stored in the storage of the process data in shared storage area
Address integrally shifts, and process data includes the function execution position and operation data that are stored when target association journey is hung up.It adopts
With this programme, because having recorded relative position of the related data of above-mentioned target association journey in the storage region of process data, therefore
And even if the storage address of process data is deviated, since relative position does not change, hung up in target association journey
When, if process resume, the related data of the target association journey of record can also be found based on relative position, so as to
Continue to run with target association journey.
It should be noted that:The device of operation association journey that above-described embodiment provides is when journey is assisted in operation, only with above-mentioned each work(
Can module division progress for example, in practical application, can be as needed and by above-mentioned function distribution by different functions
Module is completed, i.e., the internal structure of device is divided into different function modules, described above all or part of to complete
Function.In addition, the device of operation association journey that above-described embodiment provides belongs to same design with running the embodiment of the method for association's journey,
Specific implementation process refers to embodiment of the method, and which is not described herein again.
Figure 10 is the structure diagram according to a kind of network equipment shown in an exemplary embodiment.The network equipment can be with
For implementing the method for operation association journey provided in above-described embodiment.
The network equipment 1000 can include the memory 120, defeated of one or more computer readable storage mediums
Enter unit 130, display unit 140, sensor 150, voicefrequency circuit 160, WiFi (wireless fidelity, Wireless Fidelity)
Module 170, including there are one or the processor 180 of more than one processing core and the components such as power supply 190.This field skill
Art personnel are appreciated that the network equipment infrastructure shown in Figure 10 does not form the restriction to the network equipment, can include than figure
Show that more or fewer components either combine certain components or different components arrangement.Wherein:
Memory 120 can be used for storage software program and module, and processor 180 is stored in memory 120 by operation
Software program and module, so as to perform various functions application and data processing.Memory 120 can mainly include storage journey
Sequence area and storage data field, wherein, storing program area can storage program area, the application program (ratio needed at least one function
Such as sound-playing function, image player function) etc.;Storage data field can be stored to be created according to using for the network equipment 1000
Data (such as audio data, phone directory etc.) etc..In addition, memory 120 can include high-speed random access memory, may be used also
To include nonvolatile memory, for example, at least a disk memory, flush memory device or other volatile solid-states
Part.Correspondingly, memory 120 can also include Memory Controller, to provide processor 180 and input unit 130 to storage
The access of device 120.
Input unit 130 can be used for receiving the number inputted or character information and generate and user setting and function
Control related keyboard, mouse, operating lever, optics or the input of trace ball signal.Specifically, input unit 130 may include touching
Sensitive surfaces 131 and other input equipments 132.Touch sensitive surface 131, also referred to as touch display screen or Trackpad are collected and are used
Family on it or neighbouring touch operation (such as user using any suitable object such as finger, stylus or attachment in touch-sensitive table
Operation on face 131 or near touch sensitive surface 131), and corresponding attachment device is driven according to preset formula.It is optional
, touch sensitive surface 131 may include both touch detecting apparatus and touch controller.Wherein, touch detecting apparatus detection is used
The touch orientation at family, and the signal that touch operation is brought is detected, transmit a signal to touch controller;Touch controller is from touch
Touch information is received in detection device, and is converted into contact coordinate, then gives processor 180, and processor 180 can be received
The order sent simultaneously is performed.Furthermore, it is possible to using multiple types such as resistance-type, condenser type, infrared ray and surface acoustic waves
Realize touch sensitive surface 131.In addition to touch sensitive surface 131, input unit 130 can also include other input equipments 132.Specifically,
Other input equipments 132 can include but is not limited to physical keyboard, function key (such as volume control button, switch key etc.),
It is one or more in trace ball, mouse, operating lever etc..
Display unit 140 can be used for display by information input by user or be supplied to the information and the network equipment of user
1000 various graphical user interface, these graphical user interface can be by figure, text, icon, video and its arbitrary combinations
To form.Display unit 140 may include display panel 141, optionally, LCD (Liquid Crystal may be used
Display, liquid crystal display), the forms such as OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) come
Display panel 141 is configured.Further, touch sensitive surface 131 can cover display panel 141, when touch sensitive surface 131 is detected at it
On or near touch operation after, send to processor 180 with determine touch event type, be followed by subsequent processing device 180 according to touch
The type for touching event provides corresponding visual output on display panel 141.Although in Fig. 10, touch sensitive surface 131 and display
Panel 141 is the component independent as two to realize input and input function, but in some embodiments it is possible to by touch-sensitive
Surface 131 is integrated with display panel 141 and realizes and outputs and inputs function.
The network equipment 1000 may also include at least one sensor 150, for example, optical sensor, motion sensor and other
Sensor.Specifically, optical sensor may include ambient light sensor and proximity sensor, wherein, ambient light sensor can basis
The light and shade of ambient light adjusts the brightness of display panel 141, proximity sensor can when the network equipment 1000 is moved in one's ear,
Close display panel 141 and/or backlight.As one kind of motion sensor, gravity accelerometer can detect all directions
The size of upper (generally three axis) acceleration, can detect that size and the direction of gravity, can be used to identify mobile phone posture when static
Application (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (for example pedometer, strikes
Hit) etc.;Gyroscope, barometer, hygrometer, thermometer, infrared ray sensor for can also configure as the network equipment 1000 etc. its
His sensor, details are not described herein.
Voicefrequency circuit 160, loud speaker 161, the audio that microphone 162 can be provided between user and the network equipment 1000 connect
Mouthful.The transformed electric signal of the audio data received can be transferred to loud speaker 161, by loud speaker 161 by voicefrequency circuit 160
Be converted to voice signal output;On the other hand, the voice signal of collection is converted to electric signal by microphone 162, by voicefrequency circuit
160 receive after be converted to audio data, then after audio data output processor 180 is handled, through RF circuits 110 to be sent to ratio
Audio data is exported to memory 120 to be further processed by such as another network equipment.Voicefrequency circuit 160 is also possible to
Including earphone jack, to provide the communication of peripheral hardware earphone and the network equipment 1000.
WiFi belongs to short range wireless transmission technology, and the network equipment 1000 can help user to receive by WiFi module 170
It sends e-mails, browse webpage and access streaming video etc., it has provided wireless broadband internet to the user and has accessed.Although figure
10 show WiFi module 170, but it is understood that, and must be configured into for the network equipment 1000 is not belonging to, completely may be used
To be omitted in the range for the essence for not changing invention as needed.
Processor 180 is the control centre of the network equipment 1000, utilizes each of various interfaces and connection whole mobile phone
A part is stored in storage by running or performing the software program being stored in memory 120 and/or module and call
Data in device 120 perform the various functions of the network equipment 1000 and processing data, so as to carry out integral monitoring to mobile phone.It can
Choosing, processor 180 may include one or more processing cores;Preferably, processor 180 can integrate application processor and modulation
Demodulation processor, wherein, the main processing operation system of application processor, user interface and application program etc., modulation /demodulation processing
Device mainly handles wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 180.
The network equipment 1000 further includes the power supply 190 (such as battery) powered to all parts, it is preferred that power supply can lead to
Cross power-supply management system and processor 180 be logically contiguous, so as to by power-supply management system realize management charging, electric discharge and
The functions such as power managed.Power supply 190 can also include one or more direct current or AC power, recharging system, electricity
The random components such as source fault detection circuit, power supply changeover device or inverter, power supply status indicator.
Specifically in the present embodiment, the display unit of the network equipment 1000 is touch-screen display, and the network equipment 1000 is also
Including memory and one, either more than one program one of them or more than one program is stored in memory
In, and be configured to by one either the execution of more than one processor state one or more than one program and include to carry out
State the instruction of the processing of operation association journey.
One of ordinary skill in the art will appreciate that hardware can be passed through by realizing all or part of step of above-described embodiment
It completes, relevant hardware can also be instructed to complete by program, the program can be stored in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all the present invention spirit and
Within principle, any modification, equivalent replacement, improvement and so on should all be included in the protection scope of the present invention.
Claims (10)
- A kind of 1. method for running association's journey, which is characterized in that the method includes:During target assists Cheng Yunhang, when target association journey is hung up, the function for storing the target association Cheng Dangqian is held Line position is put and operation data, records the relative position of target storage position and initial storage location, wherein, the target stores position Be set to the storage location of the function execution position and operation data, the initial storage location for the target assist belonging to journey into The initial position of the storage region of journey;When the activation trigger event for detecting target association journey, according to the relative position, the function execution position is obtained It puts and operation data;The function of target association journey is re-called, based on the function execution position and operation data, continues to run with the mesh Mark association journey;During the target assists Cheng Yunhang, if the process belonging to target association journey breaks down, by the mesh The corresponding number of stoppages of mark association journey adds one;If the corresponding number of stoppages of target association journey is more than the first predetermined threshold value, in the process belonging to target association journey During restarting, the father association journey for running target association's journey and target association journey is terminated, and the target is assisted belonging to journey The corresponding number of stoppages of association's journey type adds one, wherein, it is that target association journey is called in triggering that the father of target association journey, which assists journey, Association's journey of function.
- 2. according to the method described in claim 1, it is characterized in that, the method further includes:When creating the target association journey, journey is assisted to distribute Destination Storage Unit for the target;The function execution position and operation data of the storage target association Cheng Dangqian, records target storage position and initially deposits The relative position that storage space is put, including:The function execution position of target association Cheng Dangqian and operation data are stored to the Destination Storage Unit, described in record The storage location of Destination Storage Unit and the relative position of initial storage location.
- 3. method according to claim 1 or 2, which is characterized in that the function for re-calling target association journey, packet It includes:If the execution state of target association journey is suspended state, the function of target association journey is re-called.
- 4. according to the method described in claim 1, it is characterized in that, the method further includes:When creating the target association journey again, if the corresponding number of stoppages of association's journey type belonging to target association journey is more than Second predetermined threshold value is then refused to create target association journey.
- 5. a kind of device for running association's journey, which is characterized in that described device includes:Memory module during assisting Cheng Yunhang in target, when target association journey is hung up, stores target association journey Current function execution position and operation data record the relative position of target storage position and initial storage location, wherein, institute Target storage position is stated as the function execution position and the storage location of operation data, the initial storage location is the mesh The initial position of the storage region of the mark association affiliated process of journey;Acquisition module, for when detecting that the target assists the activation trigger event of journey, according to the relative position, obtaining institute State function execution position and operation data;Module is run, for re-calling the function of target association journey, based on the function execution position and operation data, after Target described in reforwarding row assists journey;Fault logging module, during assisting Cheng Yunhang in the target, if the process belonging to target association journey goes out The corresponding number of stoppages of target association journey is then added one by existing failure;Module is terminated, if being more than the first predetermined threshold value for the corresponding number of stoppages of target association journey, in the target When assisting the process restarting belonging to journey, termination runs target association's journey and the father of target association journey assists journey, and by described in The corresponding number of stoppages of association's journey type belonging to target association journey adds one, wherein, the father of target association journey assists journey to be called for triggering Association's journey of the function of target association journey.
- 6. device according to claim 5, which is characterized in that described device further includes:Distribution module, for when creating the target association journey, journey being assisted to distribute Destination Storage Unit for the target;The memory module, is specifically used for:The function execution position of target association Cheng Dangqian and operation data are stored to the Destination Storage Unit, described in record The storage location of Destination Storage Unit and the relative position of initial storage location.
- 7. device according to claim 5 or 6, which is characterized in that the operation module is specifically used for:If the execution state of target association journey is suspended state, the function of target association journey is re-called.
- 8. device according to claim 5, which is characterized in that described device further includes:Creation module, for when creating target association journey again, if association's journey type belonging to target association journey corresponds to The number of stoppages be more than the second predetermined threshold value, then refuse to create target association journey.
- 9. a kind of network equipment, which is characterized in that the network equipment includes processor and memory, is stored in the memory Have at least one instruction, at least one section of program, code set or instruction set, at least one instruction, at least one section of program, The code set or instruction set are loaded by the processor and are performed to realize that the operation as described in Claims 1-4 is any is assisted The method of journey.
- 10. a kind of computer readable storage medium, which is characterized in that at least one instruction, extremely is stored in the storage medium Few one section of program, code set or instruction set, at least one instruction, at least one section of program, the code set or the instruction Collection is loaded by processor and is performed the method to realize the operation association journey as described in Claims 1-4 is any.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710432602.8A CN107329812B (en) | 2017-06-09 | 2017-06-09 | A kind of method and apparatus for running association's journey |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710432602.8A CN107329812B (en) | 2017-06-09 | 2017-06-09 | A kind of method and apparatus for running association's journey |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107329812A CN107329812A (en) | 2017-11-07 |
CN107329812B true CN107329812B (en) | 2018-07-06 |
Family
ID=60195170
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710432602.8A Active CN107329812B (en) | 2017-06-09 | 2017-06-09 | A kind of method and apparatus for running association's journey |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107329812B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110618868A (en) * | 2019-08-29 | 2019-12-27 | 凡普数字技术有限公司 | Method and device for writing data in batch and storage medium |
CN112395050B (en) * | 2020-11-30 | 2024-02-23 | 深信服科技股份有限公司 | Virtual machine backup method and device, electronic equipment and readable storage medium |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE60044752D1 (en) * | 1999-09-01 | 2010-09-09 | Intel Corp | BRANCH COMMAND FOR A MULTI-PROCESSING PROCESSOR |
US8079035B2 (en) * | 2005-12-27 | 2011-12-13 | Intel Corporation | Data structure and management techniques for local user-level thread data |
CN104461730B (en) * | 2013-09-22 | 2017-11-07 | 华为技术有限公司 | A kind of virtual resource allocation method and device |
CN106598801A (en) * | 2015-10-15 | 2017-04-26 | 中兴通讯股份有限公司 | Coroutine monitoring method and apparatus |
-
2017
- 2017-06-09 CN CN201710432602.8A patent/CN107329812B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN107329812A (en) | 2017-11-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104639672B (en) | The method and apparatus for carrying out domain name mapping | |
CN106973099B (en) | A kind of data-updating method, apparatus and system | |
CN105278937B (en) | A kind of method and device showing pop-up box message | |
JP6195182B2 (en) | Application scenario identification method, power consumption management method, apparatus, and terminal device | |
CN105490919B (en) | Message cancelling method and device | |
CN104142868B (en) | Establish the method and device of connection | |
CN106778117B (en) | Permission open method, apparatus and system | |
CN107357725B (en) | Application testing method and device | |
CN104427074B (en) | A kind of methods, devices and systems for showing incoming information | |
CN104980455B (en) | A kind of multiple terminals method of data synchronization based on cloud storage, device and system | |
CN108039963B (en) | Container configuration method and device and storage medium | |
CN105022955B (en) | A kind of locking means and mobile terminal of application program | |
CN106709347B (en) | Using the method and device of operation | |
CN108595218A (en) | A kind of method and apparatus of loading system dynamic base | |
US20220391278A1 (en) | Detecting datacenter mass outage with near real-time/offline using ml models | |
CN110058850A (en) | A kind of development approach of application, device and storage medium | |
CN108804915A (en) | Virus method for cleaning, storage device and electric terminal | |
CN107329812B (en) | A kind of method and apparatus for running association's journey | |
CN106713608A (en) | Application function state modifying method and apparatus, and terminal | |
CN104239316B (en) | Search the method and device of object | |
CN106789307B (en) | Configuration data processing method, apparatus and system | |
CN108287706A (en) | Data processing method and device | |
CN108090345A (en) | Linux system external command performs method and device | |
CN107015866B (en) | Data processing method and device | |
CN107066860B (en) | A kind of fingerprint identification method and mobile terminal |
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 |