Specific implementation mode
A kind of data clearing method of this specification embodiment offer, device and server.
In order to make those skilled in the art more fully understand the technical solution in this specification, below in conjunction with this explanation
Attached drawing in book embodiment is clearly and completely described the technical solution in this specification embodiment, it is clear that described
Embodiment be only this specification a part of the embodiment, instead of all the embodiments.The embodiment of base in this manual,
Every other embodiment obtained by those of ordinary skill in the art without making creative efforts, should all belong to
The range of this specification protection.
A kind of a kind of specific embodiment of data clearing method of this specification introduced below.Fig. 1 is that this specification provides
A kind of flow diagram of embodiment of data clearing method, present description provides the methods as described in embodiment or flow chart
Operating procedure, but may include either more or less operating procedure without performing creative labour based on routine.In embodiment
The step of enumerating sequence is only a kind of mode in numerous step execution sequences, does not represent and unique executes sequence.In reality
In system or server product when executing, can either method shown in the drawings sequence be executed or is held parallel according to embodiment
Row (such as environment of parallel processor or multiple threads).It is specific as shown in Figure 1, the method may include:
S102:Service request is received, the identification information of the business datum of the service request is set.
In this specification embodiment, operation system can be the business of the service request after receiving service request
Identification information is arranged in data.Specifically, the identification information is used as the distinguishing identifier of different business datums.
In practical applications, the identification information can be the identification information that current business system generates, or from
The identification information that other interaction ends obtain.In specific embodiment, the identification information is according to certain regular sequence generated
Number or business request number etc. can indicate the business datum once asked unique mark data.
S104:Create the execution thread of the service request.
In this specification embodiment, operation system can be that the service request creates after receiving new service request
Execution thread.
S106:Obtain the first thread context data of the execution thread.
In this specification embodiment, the first thread context data can be the memory for storing corresponding execution thread
In thread context data.
In this specification embodiment, the thread context data can according to business datum generate data, it is described
Identification information corresponding to business datum can be the identification information of corresponding thread context data.
In further embodiments, the thread context data can according to business datum and business datum mark
The data that information generates.
In this specification embodiment, according to business datum generate thread context data may include using business datum as
Thread context data, or it is used as thread context data after business datum is packed.
Correspondingly, it may include by industry to generate thread context data according to the identification information of business datum and business datum
The identification information of data of being engaged in and business datum is believed as thread context data, or by the mark of the business datum and business datum
Breath is used as thread context data after being packed.
In addition, in this specification embodiment, the business datum in the first thread context data can be current industry
The business datum of business request, or the business datum of the service request executed before.
S108:Detect the first thread context data identification information whether the identification information with the business datum
Unanimously.
In this specification embodiment, after obtaining first thread context data, it can detect in the first thread
Whether the identification information of context data is consistent with the identification information of the business datum of current service request, in order to be believed according to mark
Whether breath judges whether the business datum corresponding to the first thread context data of current execution thread is to have held always
The business datum for the service request that row is completed.
S110:When the result of detection is no, the first thread context data of the execution thread is cleared up.
Specifically, when the result of step S108 detections is no, it may be determined that corresponding to the first thread context data
Business datum be the service request for having executed completion business datum;Correspondingly, may determine that memory leaks, it can
Directly to clean up current thread context data (the i.e. described first thread context data).
From the foregoing, it can be seen that by the way that mark is arranged for the business datum of currently received service request in this specification embodiment
Information can detect that the business datum corresponding to the thread context data of current execution thread is based on the identification information
The no business datum for current service request, and then may determine whether that service request has executed completion but clear in time
The thread context data of reason.
In further embodiments, as shown in Fig. 2, Fig. 2 is the another real of the data clearing method that this specification provides
Apply the flow diagram of example.Specifically, when the result of step S108 detections is to be, it may be determined that the first thread context number
According to the business datum that corresponding business datum is current service request;Correspondingly, on the basis of embodiment shown in Fig. 1,
The method can also include:
S112:The service request is executed according to the business datum of current service request.
In further embodiments, the method can also include:
The second thread context data are generated according to the business datum of the service request.
In further embodiments, the method further includes:
Third thread context data are generated according to the business datum of the service request and corresponding identification information.
Specifically, in this specification embodiment, the second thread context data and the third thread context number
According to generation method may refer to the generation steps of above-mentioned thread context data, details are not described herein.
In addition, generating the second thread context data according to the business datum of the service request and being asked according to the business
The business datum asked and corresponding identification information generate the step of third thread context data can before step S108,
It can be after step S108.
In a specific embodiment, when according to the business datum of the service request the second thread context number of generation
According to the step of generating third thread context data according to the business datum of the service request and corresponding identification information
When before step S108, the identification information of the detection first thread context data whether the mark with the business datum
Knowing information may include unanimously:
Detect the first thread context data identification information whether the mark with the second thread context data
It is consistent to know information;
And/or
Detect the first thread context data identification information whether the mark with the third thread context data
It is consistent to know information.
After current service request processing terminates, above and below the second thread context data and the third thread
Literary data can be as the first thread context data of corresponding execution thread.
In further embodiments, as shown in figure 3, Fig. 3 is the another real of the data clearing method that this specification provides
Apply the flow diagram of example.Specifically, in some scenes, after creating execution thread for current service request, the execution
There are no the thread context data generated corresponding to current service data in the memory of thread, completion has not also been executed
When thread context data corresponding to the business datum of service request, above and below the first thread for the execution thread that step S106 is obtained
Literary data can be sky.Correspondingly, the method can also include:
S114:Judge whether the first thread context data is empty;
S116:When the result judged is no, whether the identification information of the execution detection first thread context data
It is consistent with the identification information of the business datum.
In other embodiments, the method can also include:
When the result judged is is, the service request is executed according to the business datum.
In practical applications, after service request executes completion, corresponding business thread or more can also directly be cleared up
Literary data.
It can be seen that a kind of one or more embodiments of data clearing method of this specification are by for currently received industry
Identification information is arranged in the business datum of business request, can detect to have whether there is service request in memory by the identification information
Through executing the thread context data completed but do not cleared up in time, and exist in detecting memory on the thread that do not clear up in time
It can timely be cleared up when context data, avoid the accumulation problem that memory overflow occurs in thread operation processing procedure.
On the other hand this specification also provides a kind of data scrubbing device, Fig. 4 is the data scrubbing dress that this specification provides
The structural schematic diagram for a kind of embodiment set, as shown in figure 4, described device 400 may include:
Service request receiving module 410 can be used for receiving service request;
Identification information setup module 420 can be used for being arranged the identification information of the business datum of the service request;
Execution thread creation module 430 can be used for creating the execution line of the service request;
Thread context data acquisition module 440 can be used for obtaining the first thread context number of the execution thread
According to;
Identification information detection module 450, can be used for detecting the first thread context data identification information whether
It is consistent with the identification information of the business datum;
Data scrubbing module 460 can be used for, when the result that the identification information detection module detects is no, clearing up institute
State the first thread context data of execution thread.
This specification also provides another embodiment of data scrubbing device, is also carried as shown in figure 5, Fig. 5 is this specification
For the structural schematic diagram of another embodiment of data scrubbing device, on the basis of embodiment shown in Fig. 4, described device
400 can also include:
First service request execution module 470 can be used for when the result of identification information detection module detection being yes
When, the service request is executed according to the business datum.
In another embodiment, described device 400 can also include:
First data generation module can be used for generating the second thread context according to the business datum of the service request
Data.
In another embodiment, described device 400 can also include:
Second data generation module can be used for being given birth to according to the business datum of the service request and corresponding identification information
At third thread context data.
In another embodiment, described device 400 can also include:
Judgment module can be used for judging whether the first thread context data is empty;
Data processing module, can be used for when it is described judge the result that mould judges as it is no when, execute and detect the First Line
Whether the identification information of journey context data is consistent with the identification information of the business datum.
In another embodiment, described device 400 can also include:
Second service request execution module, can be used for when it is described judge result that mould judges to be when, according to the industry
Data of being engaged in execute the service request.
The above-mentioned data clearing method or device that this specification embodiment provides can be executed by processor in a computer
Corresponding program instruction realizes, such as using the c++ language of windows operating systems the ends PC realize or other for example using
Android, iOS system programming language are realized in intelligent terminal, and realization of the processing logic based on quantum computer etc..
As shown in fig. 6, Fig. 6 is the schematic configuration diagram according to the data scrubbing server of an exemplary embodiment of this specification.Hard
Part level, the server may include processor, internal bus, network interface, memory and nonvolatile memory, go back certainly
May include the required hardware of other business.Processor reads corresponding computer program to interior from nonvolatile memory
It is then run in depositing, forms data scrubbing device on logic level.Certainly, other than software realization mode, the application is simultaneously
It is not excluded for other realization methods, such as the mode etc. of logical device or software and hardware combining, that is to say, that following process flow
Executive agent be not limited to each logic unit, can also be hardware or logical device.
Specifically, on the other hand this specification also provides a kind of data scrubbing server, including processor and memory, institute
It states memory and stores the computer program instructions executed by the processor, the computer program instructions may include:
Service request is received, the identification information of the business datum of the service request is set;
The execution thread for creating the service request obtains the first thread context data of the execution thread;
Whether the identification information for detecting the first thread context data is consistent with the identification information of the business datum;
When the result of detection is no, the first thread context data of the execution thread is cleared up.
In this specification embodiment, the processor may include central processing unit (CPU) or graphics processor
(GPU), naturally it is also possible to including other microcontroller, logic gates, integrated circuits with logic processing capability etc. or its
It is appropriately combined.Memory described in the embodiment of the present application can be for protecting stored memory device.In digital display circuit, energy
The equipment for preserving binary data can be memory;In integrated circuits, one not physical form have store function
Circuit may be memory, such as RAM, FIFO;In systems, the storage device with physical form can also be named storage
Device etc..When realization, which can also be realized by the way of cloud storage, specific implementation, and this specification is not
Mistake limits.
It can be seen that the embodiment of a kind of data clearing method of this specification, device or server is by currently to receive
Service request business datum be arranged identification information, can detect to ask with the presence or absence of business in memory by the identification information
The thread context data for having executed and having completed but not clearing up in time are sought, and there is the line that do not clear up in time in detecting memory
It can timely be cleared up when journey context data, avoid the accumulation problem that memory overflow occurs in thread operation processing procedure.
It is above-mentioned that this specification specific embodiment is described.Other embodiments are in the scope of the appended claims
It is interior.In some cases, the action recorded in detail in the claims or step can be come according to different from the sequence in embodiment
It executes and desired result still may be implemented.In addition, the process described in the accompanying drawings not necessarily require show it is specific suitable
Sequence or consecutive order could realize desired result.In some embodiments, multitasking and parallel processing be also can
With or it may be advantageous.
In the 1990s, the improvement of a technology can be distinguished clearly be on hardware improvement (for example,
Improvement to circuit structures such as diode, transistor, switches) or software on improvement (improvement for method flow).So
And with the development of technology, the improvement of current many method flows can be considered as directly improving for hardware circuit.
Designer nearly all obtains corresponding hardware circuit by the way that improved method flow to be programmed into hardware circuit.Cause
This, it cannot be said that the improvement of a method flow cannot be realized with hardware entities module.For example, programmable logic device
(Programmable Logic Device, PLD) (such as field programmable gate array (Field Programmable Gate
Array, FPGA)) it is exactly such a integrated circuit, logic function determines device programming by user.By designer
Voluntarily programming comes a digital display circuit " integrated " on a piece of PLD, designs and makes without asking chip maker
Dedicated IC chip.Moreover, nowadays, substitution manually makes IC chip, this programming is also used instead mostly " patrols
Volume compiler (logic compiler) " software realizes that software compiler used is similar when it writes with program development,
And the source code before compiling also write by handy specific programming language, this is referred to as hardware description language
(Hardware Description Language, HDL), and HDL is also not only a kind of, but there are many kind, such as ABEL
(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description
Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL
(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby
Hardware Description Language) etc., VHDL (Very-High-Speed are most generally used at present
Integrated Circuit Hardware Description Language) and Verilog.Those skilled in the art also answer
This understands, it is only necessary to method flow slightly programming in logic and is programmed into integrated circuit with above-mentioned several hardware description languages,
The hardware circuit for realizing the logical method flow can be readily available.
Controller can be implemented in any suitable manner, for example, controller can take such as microprocessor or processing
The computer for the computer readable program code (such as software or firmware) that device and storage can be executed by (micro-) processor can
Read medium, logic gate, switch, application-specific integrated circuit (Application Specific Integrated Circuit,
ASIC), the form of programmable logic controller (PLC) and embedded microcontroller, the example of controller includes but not limited to following microcontroller
Device:ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320, are deposited
Memory controller is also implemented as a part for the control logic of memory.It is also known in the art that in addition to
Pure computer readable program code mode is realized other than controller, can be made completely by the way that method and step is carried out programming in logic
Controller is obtained in the form of logic gate, switch, application-specific integrated circuit, programmable logic controller (PLC) and embedded microcontroller etc. to come in fact
Existing identical function.Therefore this controller is considered a kind of hardware component, and to including for realizing various in it
The device of function can also be considered as the structure in hardware component.Or even, it can will be regarded for realizing the device of various functions
For either the software module of implementation method can be the structure in hardware component again.
Device, module or the unit that above-described embodiment illustrates can specifically be realized, Huo Zheyou by computer chip or entity
Product with certain function is realized.It is a kind of typically to realize that equipment is computer.Specifically, computer for example can be a
People's computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media player, navigation
Any equipment in equipment, electronic mail equipment, game console, tablet computer, wearable device or these equipment
Combination.
For convenience of description, it is divided into various units when description apparatus above with function to describe respectively.Certainly, implementing this
The function of each unit is realized can in the same or multiple software and or hardware when specification.
It should be understood by those skilled in the art that, the embodiment of the present invention can be provided as method, apparatus or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention
Apply the form of example.Moreover, the present invention can be used in one or more wherein include computer usable program code computer
The computer program production implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The present invention be with reference to according to the method for the embodiment of the present invention, the flow of equipment (device) and computer program product
Figure and/or block diagram describe.It should be understood that can be realized by computer program instructions every first-class in flowchart and/or the block diagram
The combination of flow and/or box in journey and/or box and flowchart and/or the block diagram.These computer programs can be provided
Instruct the processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine so that the instruction executed by computer or the processor of other programmable data processing devices is generated for real
The device for the function of being specified in present one flow of flow chart or one box of multiple flows and/or block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that instruction generation stored in the computer readable memory includes referring to
Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device so that count
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, in computer or
The instruction executed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in a box or multiple boxes.
In a typical configuration, computing device includes one or more processors (CPU), input/output interface, net
Network interface and memory.
Memory may include computer-readable medium in volatile memory, random access memory (RAM) and/or
The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium
Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology realizes information storage.Information can be computer-readable instruction, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase transition internal memory (PRAM), static RAM (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), fast flash memory bank or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storages, magnetic tape cassette, tape magnetic disk storage, graphene stores or other
Magnetic storage apparatus or any other non-transmission medium can be used for storage and can be accessed by a computing device information.According to herein
In define, computer-readable medium does not include temporary computer readable media (transitory media), such as data of modulation
Signal and carrier wave.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability
Including so that process, method, commodity or equipment including a series of elements include not only those elements, but also wrap
Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that wanted including described
There is also other identical elements in the process of element, method, commodity or equipment.
It will be understood by those skilled in the art that the embodiment of this specification can be provided as method, apparatus or computer program production
Product.Therefore, complete hardware embodiment, complete software embodiment or implementation combining software and hardware aspects can be used in this specification
The form of example.Moreover, this specification can be used in one or more wherein include computer usable program code computer
The computer program production implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
This specification can describe in the general context of computer-executable instructions executed by a computer, such as journey
Sequence module.Usually, program module include routines performing specific tasks or implementing specific abstract data types, program, object,
Component, data structure etc..This specification can also be put into practice in a distributed computing environment, in these distributed computing environment
In, by executing task by the connected remote processing devices of communication network.In a distributed computing environment, program module
It can be located in the local and remote computer storage media including storage device.
Each embodiment in this specification is described in a progressive manner, identical similar portion between each embodiment
Point just to refer each other, and each embodiment focuses on the differences from other embodiments.Especially for device and
For server example, since it is substantially similar to the method embodiment, so description is fairly simple, related place is referring to side
The part of method embodiment illustrates.
The foregoing is merely the embodiments of this specification, are not limited to this specification.For art technology
For personnel, this specification can have various modifications and variations.It is all this specification spirit and principle within made by it is any
Modification, equivalent replacement, improvement etc., should be included within right.