Detailed description of the invention
Embodiments of the invention are described below in detail, and the example of described embodiment is shown in the drawings, the most identical
Or similar label represents same or similar element or has the element of same or like function.Retouch below with reference to accompanying drawing
The embodiment stated is exemplary, it is intended to is used for explaining the present invention, and is not considered as limiting the invention.
Below with reference to the accompanying drawings acquisition methods and the device of the data of the embodiment of the present invention are described.
Fig. 1 is the flow chart of the acquisition methods of the data according to one embodiment of the invention, and the present embodiment is carried out from server side
Describe.
As it is shown in figure 1, the acquisition methods of these data includes:
S101, is received the file of at least one client upload, and preserves the file received by first thread.
In traditional technical scheme, it is that same thread completes that server receives and parses through the file of client upload.
In an embodiment of the present invention, the file of the file and parsing client upload that receive client upload can be divided into two
Thread is respectively completed, and so can be effectively prevented from the situation of transmitting file time-out.
Specifically, the file of at least one client upload can be received by first thread, and preserve the file received.This
Outward, when preserving the file received, the service identification of file can also be preserved.Wherein, service identification is not included in file,
But can upload onto the server with file, service identification is for determining the business belonging to file simultaneously.
Such as, user is after the files passe page clicks on " uploading " button, and client can be by the business mark of file and this document
Knowledge uploads onto the server.Server is preserving after file, can return to upload to client by current thread and successfully responds letter
Breath.
S102, is resolved, to obtain the data that file comprises the file preserved by the second thread.
After preserving the file received, by the second thread, the file preserved can be resolved, to obtain what file comprised
Data.
Specifically, the business of correspondence can be determined according to the service identification of file, and business of dispatching in the second thread is to correspondence
File resolves, and is then saved in parsing program by corresponding analysis result.More specifically, can be by each file
Service identification and completed to resolve current line number correspondence corresponding to part and be saved in parsing program.
For example, if file comprising user profile of transferring accounts, receiving the information such as user profile and transfer amounts, therefore may be used
According to above-mentioned information determine this document corresponding be transferred account service, then can dispatch transferred account service in the second thread and this document is entered
Row resolves, to obtain the data in file.Such as, completed analysis unit and be divided into first to walk to the 6th row data, then can solve
Preserving current parsing progress in analysis program is the 6th row.
After being saved in parsing program by corresponding analysis result, resolve program also by intervalometer timing inquiry,
To obtain the parsing progress of the file being not fully complete parsing.Then according to the business that the data attribute scheduling comprised in file is corresponding,
The file being not fully complete parsing is proceeded to resolve by the parsing progress further according to the file being not fully complete parsing.Such as: files passe
During there is mechanical disorder, program can be resolved by intervalometer inquiry, if current file to have completed to resolve part corresponding
Current line number be 6, then can from the 7th row continue this document is resolved so that user is without re-executing files passe
Operation.
Additionally, due to the file of the file and parsing client upload receiving client upload is divided into two threads to be respectively completed,
After the success of Client-Prompt files passe, the resolving of this document is completed the most, therefore, by correspondence
Analysis result be saved in parsing program in after, also can receive client send parsing progress queries request, and according to
Resolve progress queries requesting query and resolve program, to obtain the parsing progress of respective file, then return to client and resolve
Progress, enables the user of client to understand the parsing progress of file in time.
The acquisition methods of the data of the embodiment of the present invention, receives the file of at least one client upload by first thread, and
Preserve the file received, and by the second thread, the file preserved is resolved, to obtain the data that file comprises,
Avoid the overlapping development of files passe function, save resource;By files passe and document analysis being divided into two threads
Complete, efficiently avoid session timeout, the phenomenon that files passe is failed, improve work efficiency.
Fig. 2 is the flow chart of the acquisition methods of the data according to one specific embodiment of the present invention.
As in figure 2 it is shown, the acquisition methods of these data includes:
S201, server receives file and the service identification of correspondence thereof of client upload by current thread, and preserves file
And the service identification of correspondence.
In an embodiment of the present invention, server can provide a unified files passe page, and client can be by this page
Upload the file that different business is corresponding.Each file is respectively provided with the service identification of correspondence.Wherein, service identification is not included in literary composition
In part, but can upload onto the server with file, service identification is for determining the business belonging to file simultaneously.As in figure 2 it is shown,
Business A and business B are uploaded the page by identical file and are carried out uploading of file.After files passe success, client can be
Whether the page is immediately seen files passe result, and complete without waiting for document analysis.
S202, creates document analysis task in current thread, and document analysis task is preserved to document analysis task list.
Server, after receiving and preserve the file of client upload, can create document analysis task in current thread, then
Document analysis task is preserved to document analysis task list.Wherein, document analysis task can include the store path of file with
And the service identification of file.
S203, is scheduling document analysis task by asynchronous thread, so that corresponding file is resolved by different business.
In an embodiment of the present invention, by asynchronous thread, document analysis task can be scheduling, according to different business marks
Know scheduling different business corresponding file is resolved.As in figure 2 it is shown, file A correspondence business A, then schedulable business
File A is resolved by A;File B correspondence business B, then file B is resolved by schedulable business B.Often resolve
A line record, can be saved in line number corresponding for this record in document analysis task list.
If user wonders the parsing progress of file, then can enter document analysis job enquiry page interrogation literary composition by client
Part resolves task list, thus knows the progress of document analysis.
Certainly, during file is resolved, if it occur that such as mechanical disorders such as deadlock, power-off, also by
Intervalometer reschedules not being parsed of task, has continued document analysis at interruption.Intervalometer can also be every one
Fix time to inquire about in document analysis task list and the most still have not being parsed of task, such as document analysis of inquiry in every 10 minutes
Task list, if still there being not being parsed of task, then reschedules not being parsed of task, has continued at interruption
Document analysis.
The acquisition methods of the data of the embodiment of the present invention, provides unified for different business and uploads platform, and each business is respectively to right
The file answered resolves, it is to avoid the session timeout phenomenon produced to big file uploading with when resolving, and machine can occur
In the case of device fault, it is achieved continued the parsing of file at interruption, it is to avoid user repeats upload operation, improves
Work efficiency.
In order to realize above-described embodiment, the present invention also proposes the acquisition device of a kind of data.
Fig. 3 is the structural representation of the acquisition device of the data according to one embodiment of the invention.
As it is shown on figure 3, the acquisition device of these data comprises the steps that preservation module 110 and acquisition module 120, wherein, obtain
Module 120 also includes resolution unit 121 and storage unit 122.
Preserve module 110 and be used for being received by first thread the file of at least one client upload, and preserve the literary composition received
Part.
In traditional technical scheme, it is that same thread completes that server receives and parses through the file of client upload.
In an embodiment of the present invention, the file of the file and parsing client upload that receive client upload can be divided into two
Thread is respectively completed, and so can be effectively prevented from the situation of transmitting file time-out.
Specifically, preserve module 110 and can be received the file of at least one client upload by first thread, and preserve reception
The file arrived.Additionally, when preserving the file received, preserve module 110 and also can preserve the service identification of file.Wherein,
Service identification is not included in file, but can upload onto the server with file simultaneously, and service identification is used for determining belonging to file
Business.
Such as, user is after the files passe page clicks on " uploading " button, and client can be by the business mark of file and this document
Knowledge uploads onto the server.Server is preserving after file, can return to upload to client by current thread and successfully responds letter
Breath.
Acquisition module 120 is for resolving, to obtain the data that file comprises the file preserved by the second thread.
Specifically, acquisition module 120 can include resolution unit 121 and storage unit 122.
Resolution unit 121 for determining the business of correspondence according to the service identification of file, and dispatches business pair in the second thread
Corresponding file resolves.
Storage unit 122 is for being saved in corresponding analysis result in parsing program.
Specifically, storage unit 122 can be by the service identification of each file and the current line number having completed parsing part correspondence
Correspondence is saved in parsing program.
For example, if file comprising user profile of transferring accounts, receiving the information such as user profile and transfer amounts, therefore may be used
According to above-mentioned information determine this document corresponding be transferred account service, then can dispatch transferred account service in the second thread and this document is entered
Row resolves, to obtain the data in file.Such as, completed analysis unit and be divided into first to walk to the 6th row data, then can solve
Preserving current parsing progress in analysis program is the 6th row.
Additionally, the acquisition device of the data of the embodiment of the present invention may also include timing enquiry module 130.
Regularly enquiry module 130 is for after being saved in corresponding analysis result in parsing program, and timing inquiry resolves
Program, to obtain the parsing progress of the file being not fully complete parsing.
After timing enquiry module 130 obtains the parsing progress of the file being not fully complete parsing, acquisition module 120 schedulable pair
The file being not fully complete parsing is proceeded to resolve by the business answered according to the parsing progress of the file being not fully complete parsing.
Specifically, acquisition module 120 can resolve program by intervalometer timing inquiry, to obtain the file being not fully complete parsing
Parsing progress.Then according to the business that the data attribute scheduling comprised in file is corresponding, further according to the file being not fully complete parsing
Parsing progress the file being not fully complete parsing is proceeded resolve.Such as: mechanical disorder occurs during files passe, can
Program is resolved by intervalometer inquiry, if the current line number that current file has completed to resolve part corresponding is 6, then can be from
7th row continues to resolve this document so that user is without re-executing files passe operation.
It addition, the acquisition device of the data of the embodiment of the present invention may also include processing module 140 and returns module 150.
Processing module 140, for after being saved in parsing program by corresponding analysis result, receives what client sent
Parsing progress queries is asked, and resolves program according to resolving progress queries requesting query, enters obtaining the parsing of respective file
Degree.
Return module 150 for returning parsing progress to client.
The acquisition device of the data of the embodiment of the present invention, receives the file of at least one client upload by first thread, and
Preserve the file received, and by the second thread, the file preserved is resolved, to obtain the data that file comprises,
Avoid the overlapping development of files passe function, save resource;By files passe and document analysis being divided into two threads
Complete, efficiently avoid session timeout, the phenomenon that files passe is failed, improve work efficiency.
In the description of this specification, reference term " embodiment ", " some embodiments ", " example ", " tool
Body example " or the description of " some examples " etc. means to combine this embodiment or example describes specific features, structure, material
Material or feature are contained at least one embodiment or the example of the present invention.In this manual, the signal to above-mentioned term
Property statement be necessarily directed to identical embodiment or example.And, the specific features of description, structure, material or spy
Point can be to combine in one or more embodiments in office or example in an appropriate manner.Additionally, in the case of the most conflicting,
Those skilled in the art can be by the different embodiments described in this specification or example and different embodiment or the spy of example
Levy and be combined and combine.
Additionally, term " first ", " second " are only used for describing purpose, and it is not intended that instruction or imply relatively important
Property or the implicit quantity indicating indicated technical characteristic.Thus, define " first ", " second " feature permissible
Express or implicitly include at least one this feature.In describing the invention, " multiple " are meant that at least two,
Such as two, three etc., unless otherwise expressly limited specifically.
In flow chart or at this, any process described otherwise above or method description are construed as, and represent and include one
Or the module of code, fragment or the part of the executable instruction of the more step for realizing specific logical function or process,
And the scope of the preferred embodiment of the present invention includes other realization, wherein can not press order that is shown or that discuss,
Including according to involved function by basic mode simultaneously or in the opposite order, performing function, this should be by the present invention's
Embodiment person of ordinary skill in the field understood.
Represent in flow charts or the logic described otherwise above at this and/or step, for example, it is possible to be considered as reality
The sequencing list of the executable instruction of existing logic function, may be embodied in any computer-readable medium, for instruction
Execution system, device or equipment (system such as computer based system, including processor or other can perform from instruction
System, device or equipment instruction fetch also perform the system instructed) use, or combine these instruction execution systems, device or set
Standby and use.For the purpose of this specification, " computer-readable medium " can be any can to comprise, store, communicate, propagate
Or transmission procedure for instruction execution system, device or equipment or combines these instruction execution systems, device or equipment and uses
Device.The more specifically example (non-exhaustive list) of computer-readable medium includes following: have one or more cloth
The electrical connection section (electronic installation) of line, portable computer diskette box (magnetic device), random access memory (RAM), only
Reading memorizer (ROM), erasable read only memory (EPROM or flash memory) of editing, fiber device, and
Portable optic disk read only memory (CDROM).It addition, computer-readable medium can even is that can print thereon described
The paper of program or other suitable media, because then can carry out such as by paper or other media are carried out optical scanning
Edit, interpret or be processed to electronically obtain described program with other suitable methods if desired, then stored
In computer storage.
Should be appreciated that each several part of the present invention can realize by hardware, software, firmware or combinations thereof.In above-mentioned reality
Execute in mode, software that multiple steps or method in memory and can be performed by suitable instruction execution system with storage or
Firmware realizes.Such as, if realized with hardware, with the most the same, available well known in the art under
Any one or their combination in row technology realize: have the logic gates for data signal realizes logic function
Discrete logic, there is the special IC of suitable combination logic gate circuit, programmable gate array (PGA), existing
Field programmable gate array (FPGA) etc..
Those skilled in the art are appreciated that realizing all or part of step that above-described embodiment method carries is can
Completing instructing relevant hardware by program, described program can be stored in a kind of computer-readable recording medium,
This program upon execution, including one or a combination set of the step of embodiment of the method.
Additionally, each functional unit in each embodiment of the present invention can be integrated in a processing module, it is also possible to be each
Individual unit is individually physically present, it is also possible to two or more unit are integrated in a module.Above-mentioned integrated module was both
Can realize to use the form of hardware, it would however also be possible to employ the form of software function module realizes.If described integrated module with
The form of software function module realizes and as independent production marketing or when using, it is also possible to be stored in a computer-readable
Take in storage medium.
Storage medium mentioned above can be read only memory, disk or CD etc..Although above it has been shown and described that
Embodiments of the invention, it is to be understood that above-described embodiment is exemplary, it is impossible to be interpreted as limitation of the present invention,
Above-described embodiment can be changed, revises, replace and modification by those of ordinary skill in the art within the scope of the invention.