CN106445962A - Data importing method and device - Google Patents

Data importing method and device Download PDF

Info

Publication number
CN106445962A
CN106445962A CN201510487940.2A CN201510487940A CN106445962A CN 106445962 A CN106445962 A CN 106445962A CN 201510487940 A CN201510487940 A CN 201510487940A CN 106445962 A CN106445962 A CN 106445962A
Authority
CN
China
Prior art keywords
data
file
imported
request
importing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510487940.2A
Other languages
Chinese (zh)
Inventor
李济景
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201510487940.2A priority Critical patent/CN106445962A/en
Publication of CN106445962A publication Critical patent/CN106445962A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data importing method and device, and relates to the field of the information technology. The storage space of a web server can be saved, web server resources consumed when the web server processes a file to be imported can be saved, so that the waste of the storage space of the web server can be avoided, and the handling performance of the web server is improved. The method comprises the following steps of: receiving a file importing request sent from a client side, wherein the file importing request carries the file to be imported; obtaining the data of the file to be imported from the file importing request; and storing the data into a database. The data importing method is suitable for importing the data.

Description

A kind of data lead-in method and device
Technical field
The present invention relates to areas of information technology, more particularly to a kind of data lead-in method and device.
Background technology
With the continuous development of Internet technology, increasing Web page application program occurs therewith.Wherein, Web page application program is the application program based on browser/server framework, based on browser/server framework Application program support data inputting demand, that is, user can to Web page application program upload data, then The data that user uploads is carried out typing by Web page application program.For faster logging data, web application journey Sequence provides the function of file importing.
At present, when carrying out data importing, typically the file that webpage client uploads is saved in webpage clothes After business device is local, then read the data receiving in file, then the data after reading is saved in web service In the local data base of device.However, when needing to import substantial amounts of data, needing in advance in web page server Locally preserve the substantial amounts of file including above-mentioned data, because substantial amounts of file can cause to take substantial amounts of net Page server storage, and take the web page server money that substantial amounts of web page server process file is consumed Source, thus lead to the waste of web page server memory space server resource.
Content of the invention
In view of this, the present invention provides a kind of data lead-in method and device, and main purpose is to save Web page server memory space, and the webpage that web page server process file to be imported is consumed can be saved Server resource is such that it is able to avoid web page server memory space and the waste of web page server resource.
According to one aspect of the present invention, there is provided a kind of data lead-in method:Including:
Receive the file importing request that client sends, described file imports in request and carries literary composition to be imported Part;
Import the data obtaining described file to be imported request from described file;
Described data is saved in data base.
According to another aspect of the present invention, provide a kind of data importing device, including:
Receiving unit, the file for receiving client transmission imports request, and described file imports in request and takes With file to be imported;
Acquiring unit, obtains described literary composition to be imported for importing in request from the file that described receiving unit receives The data of part;
Storage unit, for being saved in the data obtaining from described acquiring unit in data base.
By technique scheme, technical scheme provided in an embodiment of the present invention at least has following advantages:
The present invention provides a kind of data lead-in method and device, and web page server is receiving the literary composition that client sends After part imports request, described file imports in request and carries file to be imported;Importing from described file please Seek the middle data obtaining described file to be imported;Then described data is saved in data base.Exist with current When carrying out data importing, in advance the file including above-mentioned data is saved in web page server and locally compares, The present invention, after the file receiving client transmission imports request, directly imports acquisition request from file described The data of file to be imported is it is not necessary to be saved in web page server locally by file to be imported, and does not need Locally read the data file to be imported from web page server such that it is able to save web page server storage sky Between, and the web page server resource that web page server process file to be imported is consumed can be saved, and then It can be avoided that the waste of web page server memory space and web page server resource.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technology of the present invention Means, and being practiced according to the content of description, and in order to allow above and other mesh of the present invention , feature and advantage can become apparent, below especially exemplified by the specific embodiment of the present invention.
Brief description
By reading the detailed description of hereafter preferred implementation, various other advantages and benefit are for ability Domain those of ordinary skill will be clear from understanding.Accompanying drawing is only used for illustrating the purpose of preferred implementation, and simultaneously It is not considered as limitation of the present invention.And in whole accompanying drawing, it is denoted by the same reference numerals identical Part.In the accompanying drawings:
The flow chart that Fig. 1 shows a kind of data lead-in method provided in an embodiment of the present invention;
The flow chart that Fig. 2 shows another kind data lead-in method provided in an embodiment of the present invention;
Fig. 3 shows a kind of structural representation of data importing device provided in an embodiment of the present invention;
Fig. 4 shows the structural representation of another kind data importing device provided in an embodiment of the present invention.
Specific embodiment
It is more fully described the exemplary embodiment of the disclosure below with reference to accompanying drawings.Although showing in accompanying drawing The exemplary embodiment of the disclosure it being understood, however, that may be realized in various forms the disclosure and should be by Embodiments set forth here is limited.On the contrary, these embodiments are provided to be able to be best understood from this Open, and complete for the scope of the present disclosure can be conveyed to those skilled in the art.
Embodiments provide a kind of data lead-in method, wherein, the embodiment of the present invention provided one Plant the executive agent of data lead-in method, can be server.Below as shown in figure 1, methods described bag Include:
101st, receive the file importing request that client sends.
Wherein, file imports in request and carries file to be imported.File to be imported can be text literary composition Part, the content of text of text can be directly exposed to file and import in request, and the form of text can Think " .txt " form or " .csv " form, the embodiment of the present invention does not limit.For example, When the form of text is " .txt " form, file to be imported can be for " importing file 1.txt”;When the form of text is " .csv " form, file to be imported can be for " importing File 2.csv ".Client can be web browser, for example, client can for baidu browser, Sohu's browser or 360 browsers, Tengxun's browser, the embodiment of the present invention does not limit.By Http protocol (HTML (Hypertext Markup Language), Hyper Text Transfer can be passed through in web browser Protocol) interact with web page server, the file that client sends imports request for being HTTP Request, HTTP request can be the URL (unified resource being browsed webpage by web browser according to needed for user Finger URL, Uniform Resource Locator) and file generated to be imported.
For the embodiment of the present invention, step 101 is specifically as follows:When web browser receives files passe During instruction, web browser sends file to web page server and imports request, and file imports the request body of request In carry the file of user's upload, the upper transmitting file of user file as to be imported, thus web page server The file that web browser transmission can be received imports request.
For example, when user needs to upload data to Web page application program, it is clear that web page user can open webpage The file look on device imports the page, and the file importing page upload then passed through on web browser comprises data Text.The step opening the importing page of the file on web browser is specifically as follows:Web page user Input the URL of web page server in web browser, then web browser sends to described web page server File imports accessing page request, and web page server, after receiving file importing accessing page request, generates HTML (HTML, the Hypertext Markup Language) page, i.e. the file importing page; Then, connected to net by Transmission Control Protocol (transmission control protocol, Transfer Control Protocol) Page browsing device sends file and imports the page.User can import the literary composition on the page by the file of web browser Part browse controls select file to be imported, when the file in user's striking or webpage clicking browser imports During the upload button of the page, web browser sends file to web page server and imports request, i.e. web page browsing Device sends HTTP request to web page server, carries the text literary composition of user's upload in the request body of HTTP request Part, thus web page server can receive the HTTP request of web browser transmission.
102nd, import, from file, the data obtaining file to be imported request.
For the embodiment of the present invention, step 102 is specifically as follows:Import when web page server receives file After request, first, read file and import request;Then, read file and import the literary composition to be imported in request Part;Finally, read the data that file imports the file to be imported in request.For example, it is possible to file is imported In the asynchronous instance objects reading many partial memories stream provider class of request stream, as newly-built object Provider (provider);File imports after asking stream reading to finish, and file is just provider's In Content (content), wherein, Content is the attribute of provider, exists in the form of a list, Item in Content is all the example of HTTPContent;Then, read the main body of HTTPContent example Part reads file to be imported;Finally, read the data of file to be imported.For example, file imports HTTP and asks File " importing file 3.txt " to be imported is carried, first, by HTTP request function reading in asking Read file and import HTTP request;Then, file is read by file function reading and " import file 3.txt”;Finally, data " you in file " importing file 3.txt " is read by Data Read Function Good, welcome to use this browser ".
103rd, the data from file acquisition to be imported is saved in data base.
For the embodiment of the present invention, step 103 is specifically as follows:To protect from the data of file acquisition to be imported It is stored on the local data base of web page server.The local data base of web page server can be Oracle data Storehouse system or ACCESS Database Systems, the embodiment of the present invention does not limit.Store webpage clothes In the local data base of business device, data can use for other users, when web page server receives other users During the HTTP request sending, web page server takes out the data of user's needs, Ran Hougen from local data base According to this data genaration html page, then pass through the web page browsing to other users for the Transmission Control Protocol linkup transmit Device.With current after web page server receives file and imports request, in advance file to be imported is saved in net Page server local compare, embodiment of the present invention web page server receive file import request after, directly Import, from file, the data reading request in file to be imported, then store data into web page server originally The data base on ground is above it is not necessary to be saved in web page server locally by file to be imported, and does not need from net Page server local reads the data in file to be imported, saves web page server and stores file institute to be imported The web page server resource that the memory space taking is consumed with process file to be imported is such that it is able to avoid net Page server storage and the waste of web page server resource, can lift server process speed simultaneously, And then the experience of user can be lifted.
For the embodiment of the present invention, specific application scenarios can be as follows, but not limited to this, including: In user needs to A webpage during typing user basic information, user can input A in A web browser The URL http of web page server://www.A.com, then A web browser send out to described A web page server File is sent to import accessing page request, A web page server, after receiving file importing accessing page request, leads to Cross Transmission Control Protocol and send the file importing page to web browser.Then, user can pass through web browser The browsing file control that imports on the page of file select file " user basic information .txt " to be imported, When the file in user's striking or webpage clicking browser imports the upload button of the page, web browser Send file to web page server and import request, that is, web browser sends HTTP request to web page server, " user basic information .txt " file is carried in the request body of HTTP request.
After web page server receives the HTTP request of web browser transmission, first, reading HTTP please Ask;Then, read " user basic information .txt " file in HTTP request;Finally, read HTTP Data " the name of " user basic information .txt " file in request:Tester 1, phone: 024-12345678, address:Shenyang City peace zone;Name:Tester 2, phone: 010-82345678, address:Haidian District, Beijing City;”.Finally, A web page server is by data " name:Tester 1, phone:024-12345678, address:Shenyang City peace zone;Name: Tester 2, phone:010-82345678, address:Haidian District, Beijing City;" be saved in local In data base.With in advance " user basic information .txt " file is saved on A web page server at present, Read data " name again:Tester 1, phone:024-12345678, address:Shenyang City's peace Area;Name:Tester 2, phone:010-82345678, address:Haidian District, Beijing City;" phase Than, the embodiment of the present invention, directly reads the data of " user basic information .txt " file from HTTP request Save A web page server to process the server resource that consumed of " user basic information .txt " file and deposit Memory space shared by storage " user basic information .txt " file is such that it is able to avoid web page server to deposit Storage space waste, can lift server process speed simultaneously, and then can lift the experience of user.
A kind of data lead-in method provided in an embodiment of the present invention, web page server is receiving what client sent After file imports request, described file imports in request and carries file to be imported;Import from described file The data of described file to be imported is obtained in request;Then described data is saved directly in data base.With At present when carrying out data importing, in advance the file including above-mentioned data is saved in web page server local Compare, the present invention, after receiving the file importing request that client sends, directly imports request from file and obtains Take the data of described file to be imported it is not necessary to file to be imported is saved in web page server locally, and Do not need locally to read the data file to be imported such that it is able to save web page server from web page server Memory space, and the web page server money that web page server process file to be imported is consumed can be saved Source, and then it can be avoided that the waste of web page server memory space and web page server resource.
Embodiments provide another kind of data lead-in method, below as shown in Fig. 2 methods described bag Include:
201st, receive the file importing request that client sends.
Wherein, file imports in request and carries file to be imported.File to be imported can be text literary composition Part, the content of text of text can be directly exposed to file and import in request, and the form of text can Think " .txt " form or " .csv " form, the embodiment of the present invention does not limit.Client Can be web browser, because web browser can be handed over web page server by http protocol Mutually, the file that client sends imports request for being HTTP request, and HTTP request can be clear by webpage The URL that device of looking at browses webpage according to needed for user generates and file to be imported.
For the embodiment of the present invention, step 201 is specifically as follows:When web browser receives files passe During instruction, web browser sends file to web page server and imports request, and file imports the request body of request In carry the file of user's upload, the upper transmitting file of user file as to be imported, thus web page server The file that web browser transmission can be received imports request.
202nd, import, from file, the data obtaining file to be imported request.
For the embodiment of the present invention, step 202 is specifically as follows:According to preset Data Read Function, from institute State file and import the data obtaining described file to be imported in request.Described according to preset Data Read Function, The data obtaining described file to be imported from the importing request of described file is specifically as follows:According to function ReadAsStreamAsync, obtains described file and imports file to be imported in request;According to function StreamReader, obtains the data of described file to be imported.
Wherein, preset Data Read Function can be write by development language platform, and development language platform is permissible For .NET platform or C (C language, The C Programming Lauguage), C# (C#, C SHARP Programming Lauguage), C++ (C Plus Plus, The C++Programming Language), the development language such as JAVA (JAVA programming language, JAVA Programming Language) Platform, the embodiment of the present invention is not construed as limiting.For different development language platforms, preset Data Read Function Name can be identical.For example, in .NET platform, C, C#, C++, JAVA development language platform In, the function reading reading HTTP request stream all can be named as The function reading of Request.Content.ReadAsMultipartAsync, reading file to be imported Be named as ReadAsStreamAsync, the data reading in file to be imported function reading all permissible It is named as StreamReader.
For the embodiment of the present invention, step 202 can also be specifically:The file that client sends imports request For HTTP request, after web page server receives HTTP request stream, first, read HTTP request stream, Specifically can be in .NET platform, using function reading Request.Content.ReadAsMultipartAsync, asynchronous for HTTP request stream is read One instance objects of MultipartMemoryStreamProvider class, as newly-built object provider.HTTP request stream read finish after, file just in the Content of provider, wherein, Content is the attribute of provider, exists in the form of a list, the item in Content is all The example of HTTPContent.Specifically can be realized by false code, as follows:
Var provider=new MultipartMemoryStreamProvider ();// by HTTP request stream In asynchronous instance objects provider reading MultipartMemoryStreamProvider class
IEnumerable<HTTPContent>Bodyparts=awaitRequest.content.ReadAsMul tipartAsync(Provider);// read HTTP request stream
Then, read file to be imported in HTTP request stream, specifically can call HTTPContent example Function reading ReadAsStreamAsync be read as Stream stream, Stream stream is literary composition to be imported Part.Specifically can be realized by false code, as follows:
Stream stream=await bodypart.ReadAsStreamAsync ();// reading HTTP please Seek file to be imported in stream
Finally, read the data in file to be imported, specifically can call function reading StreamReader reads the content of Stream stream, and the content of Stream stream is the number in file to be imported According to such that it is able to complete the transmission from webpage client to web page server of data in file to be imported.Tool Body can be realized by false code, as follows:
StreamReader reader=new StreamReader (stream);// read file to be imported In data
203rd, judge whether from the data of file acquisition to be imported be encryption data.
For the embodiment of the present invention, step 203 is specifically as follows:Judge that file imports in request whether there is Encrypted identification information, if file imports in request there is encrypted identification information, confirms to obtain from file to be imported The data taking is encryption data;Or judge that file imports the announcement information in request with the presence or absence of data encryption, If file imports the announcement information that there is data encryption in request, illustrate that in file to be imported, data is encryption number According to.
Wherein, encryption data can be encrypted generation for the data in file to be imported by AES Data.Specifically, the data in file to be imported can be carried out add by using rivest, shamir, adelman Close, generate encryption data;By using symmetric encipherment algorithm, the data in file to be imported can also be carried out Encryption, generates encryption data, and the embodiment of the present invention does not limit.Using rivest, shamir, adelman to be imported It can be that the data in file to be imported is read in a character string that data in file is encrypted, then to this Character string carries out Hash operation, then obtains the cryptographic Hash of the data in file to be imported, using RSA Algorithm Cryptographic Hash is encrypted.Symmetric encipherment algorithm can be DES (data encryption standardss, Data Encryption Standard), 3DES (triple DEAs, Triple DES), can also be AES (high series According to encryption standard, Advanced Encryption Standard) and Blowfish algorithm, present invention enforcement Example does not limit.Encryption data can be presented in plaintext string data in file to be imported.
For the embodiment of the present invention, step 203 is specifically as follows:Judge the data from file acquisition to be imported Whether be plaintext string data, if from the data of file acquisition to be imported be plaintext string data, really Recognizing from the data of file acquisition to be imported is encryption data.By the data in file to be imported is carried out adding Close, it can be avoided that the data in file to be imported is intercepted and maliciously uses such that it is able to ensure that user imports The safety of data.
If 204 is encryption data from the data of file acquisition to be imported, by the number from file acquisition to be imported According to being decrypted.
For the embodiment of the present invention, step 204 is specifically as follows:If web page server obtains from file to be imported The data taking is encryption data, using the decipherment algorithm corresponding with AES, this encryption data is solved Close such that it is able to the data from file acquisition to be imported is decrypted.If encryption data is by using right AES is claimed to generate encryption data, then web page server is to web browser acquisition request symmetric encipherment algorithm Encryption key.
For example, web page server from the data of file acquisition to be imported is " Wm7#ki5jh+%WE4JKS JAF ", " Wm7#ki5jh+%WE4JKS JAF " is plaintext string number According to illustrating that the data from file acquisition to be imported is encryption data, then use corresponding with AES Decipherment algorithm is decrypted to " Wm7#ki5jh+%WE4JKS JAF ", and the data after deciphering is " tester Bank card password is 123456 ".
For the embodiment of the present invention, the step arranged side by side with step 204 is:If the number from file acquisition to be imported According to not being encryption data, directly the data from file acquisition to be imported is saved in the local number of web page server According on storehouse.
205th, the data after deciphering is saved directly in data base.
For the embodiment of the present invention, specifically can also include before step 205:Filter rule according to preset Then, the data after deciphering is filtered.Now, the data after described filtration is saved directly to data base In.Wherein, preset filtering rule can be configured it is also possible to according to system default according to the demand of user Pattern is configured, and the embodiment of the present invention does not limit.Preset filtering rule is specifically as follows in data Word, space, forbidden character etc. are deleted, and for example, file to be imported is bank account information .txt literary composition Part, the data in bank account information .txt file after deciphering is " account:Test00190, close Code:Address, Real Name:Tester, phone:022-12345678, address:Tianjin Nankai District garden Road ";Comprise due in the local data base of web page server " account ", " password ", " Real Name ", " phone ", " address " field, and account information can not comprise space, Before storing data in local data base, two spaces in " test00190 " are deleted and becomes For " test00190 ", by " the account in bank account information .txt file:, password:, true surname Name:, phone, address:" word and symbol deleted.Now, it is saved in the number in data base According to for " test00190 ", " address ", " tester ", " 022-12345678 ", " Tianjin City Nankai District garden Road ";" test00190 ", " address ", " tester ", " 022-12345678 ", " Nankai District, Tianjin City garden Road " respectively " account " in correspondence database, " password ", " Real Name ", " phone ", " address " field.By data was carried out Filter, ensure that and preferably adapt to the local data base's of web page server from the data of file acquisition to be imported Storage mode, thus ensure the concordance of data database storing.
For the embodiment of the present invention, specifically can also include before step 205:According to preset data genaration Rule, by data new for the data genaration after deciphering;Now, newly-generated data is preserved.Its In, preset data create-rule can be configured it is also possible to according to system default mould according to the demand of user Formula is configured, and the embodiment of the present invention does not limit.For example, file to be imported is user profile .txt literary composition Part, the data of user profile .txt file is " Li Mingming graduates from university for 2007 ", and web page server is local Data base in data storage language be English, then " Li Mingming graduates from university for 2007 " is translated into " Ming-ming Li graduated from university in 2007 ", then by data " Ming-ming Li graduated from university in 2007 " is saved in web page server originally On the data base on ground.By by data new for data genaration, ensure that the data from file acquisition to be imported Preferably adapt to the storage mode of the local data base of web page server, thus ensureing data database storing Concordance.
For the embodiment of the present invention, step 205 is specifically as follows:Data after deciphering is saved in webpage clothes On the local data base of business device.The local data base of web page server can be oracle database system, Can be ACCESS Database Systems, the embodiment of the present invention does not limit.Receive with working as web page server at present Import after request to file, in advance file to be imported is saved in web page server and locally compares, the present invention is real Apply a web page server after receiving file importing request, directly read to be imported from file importing request Data in file, local without file to be imported is saved in web page server, and do not need from Web page server locally reads the data in file to be imported, saves web page server and stores file to be imported The web page server resource that shared memory space is consumed with process file to be imported is such that it is able to avoid Web page server memory space and the waste of web page server resource, can lift server process speed simultaneously Degree, and then the experience of user can be lifted.
For the embodiment of the present invention, specific application scenarios can be as follows, but not limited to this, including: In user needs to B webpage during typing bank account information, user can input B in B web browser The URL http of web page server://www.B.com, then B web browser send out to described B web page server File is sent to import accessing page request, B web page server, after receiving file importing accessing page request, leads to Cross Transmission Control Protocol and send the file importing page to web browser.Then, user can pass through web browser The browsing file control that imports on the page of file select file " bank account information .CSV " to be imported, When the file in user's striking or webpage clicking browser imports the upload button of the page, web browser Send file to web page server and import request, that is, web browser sends HTTP request to web page server, " bank account information .CSV " file is carried in the request body of HTTP request.
After web page server receives the HTTP request of web browser transmission, first, by function reading Request.Content.ReadAsMultipartAsync, asynchronous for HTTP request stream is read In one instance objects provider of MultipartMemoryStreamProvider class;Then, call Function reading ReadAsStreamAsync of HTTPContent example is read as " bank account information .CSV " File;Finally, function reading StreamReader is called to read " the bank account letter in HTTP request The data " XXXFXXGFXHXYYGYYHGYHGYUUUHUUUUU " of breath .CSV " file, by judging " bank Data in accounts information .CSV " file is encryption data, and encryption data is by using symmetric cryptography Algorithm generates, and now, B web page server is to the encryption of B web browser acquisition request symmetric encipherment algorithm Key.Then use the decipherment algorithm pair corresponding with AES " XXXFXXGFXHXYYGYYHGYHGYUUUHUUUUU " is decrypted, and the data after deciphering is " account: 622356566578680th, password:888888th, holder name:Diffuse Coptosapelta, phone: 010-87345674, address:Chaoyang District, Beijing City ".In advance will " bank account letter with present File is saved on B web page server breath .CSV ", then reads in " bank account information .CSV " file Data is compared, the embodiment of the present invention, by function reading Request.Content.ReadAsMultipartAsync, function reading ReadAsStreamAsync, reading Take function StreamReader, directly can read " bank account information .CSV " file from HTTP request Data, save B web page server and process the server that consumed of " bank account information .CSV " file Memory space shared by resource and storage " bank account information .CSV " file is such that it is able to avoid webpage Server storage wastes, and can lift server process speed simultaneously, and then can lift the body of user Test.Additionally, by being encrypted the data in " bank account information .CSV ", it can be avoided that data quilt Intercept and maliciously use such that it is able to ensure that user imports the safety of data.
Due to comprising " account ", " password ", " holder's surname in the local data base of B web page server Name ", " phone ", " address " field, and account information can not comprise space, is being saved in Before data base, need to filter to by the data after deciphering, that is, delete " 622356566578 680 " space in, is changed into " 622356566578680 ", by " bank account information .CSV " file " account:, password:, holder name:, phone, address:" word and symbol carry out Delete.Then, by data " 622356566578680 ", " 888888 ", " Diffuse Coptosapelta ", " 010-87345674 ", " Chaoyang District, Beijing City " are saved in " account " in data base, " close respectively Code ", " Real Name ", " phone ", on the corresponding position of " address " field.By by number According to being filtered, ensure that the data obtaining from " bank account information .CSV " preferably adapts to webpage clothes The storage mode of the local data base of business device, thus ensure the concordance of data database storing.
Another kind data lead-in method provided in an embodiment of the present invention, web page server is receiving client transmission File import request after, described file imports in request and carries file to be imported;Lead from described file Enter to obtain the data of described file to be imported in request;Then described data is saved in data base.With mesh Front carry out data import when, in advance the file including above-mentioned data is saved in the local phase of web page server The present invention, after receiving the file importing request that client sends, directly imports request from file and obtains ratio The data of described file to be imported it is not necessary to that file to be imported is saved in web page server is local, and not Need locally to read the data file to be imported such that it is able to saving web page server is deposited from web page server Storage space, and the web page server resource that web page server process file to be imported is consumed can be saved, And then it can be avoided that the waste of web page server memory space and web page server resource.
Further, implementing as method shown in Fig. 1, embodiments provides a kind of data Gatherer, as shown in figure 3, described device includes:Receiving unit 31, acquiring unit 32, storage unit 33.
Receiving unit 31, can be used for receiving the file importing request that client sends, described file imports please File to be imported is carried in asking.
Acquiring unit 32, can be used for acquisition from the file importing request that described receiving unit 31 receives described The data of file to be imported.
Storage unit 33, can be used for the data obtaining from described acquiring unit 32 is saved in data base.
It should be noted that each functional unit involved by a kind of data importing device provided in an embodiment of the present invention Other accordingly describe, may be referred to the corresponding description of Fig. 1, will not be described here.
A kind of data importing device provided in an embodiment of the present invention, web page server is receiving what client sent After file imports request, described file imports in request and carries file to be imported;Import from described file The data of described file to be imported is obtained in request;Then described data is saved in data base.With current When carrying out data importing, in advance the file including above-mentioned data is saved in the local phase of web page server The present invention, after receiving the file importing request that client sends, directly imports request from file and obtains ratio The data of described file to be imported it is not necessary to that file to be imported is saved in web page server is local, and not Need locally to read the data file to be imported such that it is able to saving web page server is deposited from web page server Storage space, and the web page server resource that web page server process file to be imported is consumed can be saved, And then it can be avoided that the waste of web page server memory space and web page server resource.
Further, implementing as method shown in Fig. 2, embodiments provides another kind of number According to gatherer, as shown in figure 4, described device includes:Receiving unit 41, acquiring unit 42, preservation are single Unit 43.
Receiving unit 41, can be used for receiving the file importing request that client sends, described file imports please File to be imported is carried in asking.
Acquiring unit 42, can be used for acquisition from the file importing request that described receiving unit 41 receives described The data of file to be imported.
Storage unit 43, can be used for the data obtaining from described acquiring unit 42 is saved in data base.
Described acquiring unit 42, specifically can be used for, according to preset Data Read Function, importing from described file The data of described file to be imported is obtained in request.
Described acquiring unit 42, specifically can be also used for, according to function ReadAsStreamAsync, obtaining institute State file and import file to be imported in request.
Described acquiring unit 42, specifically can be also used for according to function StreamReader, waits to lead described in acquisition Enter the data of file.
Described device also includes:Judging unit 44 and decryption unit 45.
Described judging unit 44, can be used for judging whether the data obtaining from described acquiring unit 42 is encryption Data.
Described decryption unit 45, if can be used for data that described judging unit 44 judges as encryption data, will Described data is decrypted.
Described storage unit 43, the data after specifically can be used for deciphering described decryption unit 45 is saved in number According in storehouse.
It should be noted that each function list involved by another kind data importing device provided in an embodiment of the present invention Other of unit accordingly describe, and may be referred to the corresponding description of Fig. 2, will not be described here.
Another kind data importing device provided in an embodiment of the present invention, web page server is receiving client transmission File import request after, described file imports in request and carries file to be imported;Lead from described file Enter to obtain the data of described file to be imported in request;Then described data is saved in data base.With mesh Front carry out data import when, in advance the file including above-mentioned data is saved in the local phase of web page server The present invention, after receiving the file importing request that client sends, directly imports request from file and obtains ratio The data of described file to be imported it is not necessary to that file to be imported is saved in web page server is local, and not Need locally to read the data file to be imported such that it is able to saving web page server is deposited from web page server Storage space, and the web page server resource that web page server process file to be imported is consumed can be saved, And then it can be avoided that the waste of web page server memory space and web page server resource.
Through the above description of the embodiments, those skilled in the art can be understood that this Bright can realize by the mode of software plus necessary common hardware naturally it is also possible to pass through hardware, but a lot In the case of the former is more preferably embodiment.Based on such understanding, technical scheme substantially or Person says that what prior art was contributed partly can be embodied in the form of software product, and this computer is soft Part product is stored in the storage medium that can read, such as the floppy disk of computer, hard disk or CD etc., if including Dry instruction is with so that a computer equipment (can be personal computer, server, or the network equipment Deng) execution each embodiment of the present invention described in method.
The above, the only specific embodiment of the present invention, but protection scope of the present invention is not limited to This, any those familiar with the art the invention discloses technical scope in, can readily occur in Change or replacement, all should be included within the scope of the present invention.Therefore, protection scope of the present invention should It is defined by described scope of the claims.

Claims (10)

1. a kind of data lead-in method is it is characterised in that include:
Receive the file importing request that client sends, described file imports in request and carries literary composition to be imported Part;
Import the data obtaining described file to be imported request from described file;
Described data is saved in data base.
2. data lead-in method according to claim 1 it is characterised in that described from described file The data obtaining described file to be imported in importing request includes:
According to preset Data Read Function, import, from described file, the number obtaining described file to be imported request According to.
3. data lead-in method according to claim 2 it is characterised in that described according to preset number According to function reading, the data obtaining described file to be imported from the importing request of described file includes:
According to function ReadAsStreamAsync, obtain described file and import file to be imported in request;
According to function StreamReader, obtain the data of described file to be imported.
4. data lead-in method according to claim 1 is it is characterised in that leading from described file After entering the data obtaining described file to be imported in request, also include:
Judge whether described data is encryption data;
If so, described data is decrypted;
Described described data is saved in data base includes:
Data after deciphering is saved in data base.
5. data lead-in method according to claim 1 is it is characterised in that protecting described data Before being stored in data base, also include:
According to preset filtering rule, described data is filtered;
Described described data is saved in data base includes:
Data after described filtration is saved in data base.
6. the data lead-in method according to any one of claim 1-5 is it is characterised in that described treat The file importing is text.
7. a kind of data importing device is it is characterised in that include:
Receiving unit, the file for receiving client transmission imports request, and described file imports in request and takes With file to be imported;
Acquiring unit, obtains described literary composition to be imported for importing in request from the file that described receiving unit receives The data of part;
Storage unit, for being saved in the data obtaining from described acquiring unit in data base.
8. data importing device according to claim 1 it is characterised in that
Described acquiring unit, specifically for according to preset Data Read Function, importing request from described file Obtain the data of described file to be imported.
9. data importing device according to claim 8 it is characterised in that
Described acquiring unit, is specifically additionally operable to according to function ReadAsStreamAsyn, obtains described file and leads Enter file to be imported in request;
Described acquiring unit, is specifically additionally operable to, according to function StreamReader, obtain described file to be imported Data.
10. data importing device according to claim 1 is it is characterised in that described device is also wrapped Include:Judging unit and decryption unit,
Described judging unit, whether the data for judging to obtain from described acquiring unit is encryption data;
Described decryption unit, if the data judging for described judging unit is as encryption data, by described data It is decrypted;
Described storage unit, is saved in data base specifically for the data after deciphering described decryption unit.
CN201510487940.2A 2015-08-10 2015-08-10 Data importing method and device Pending CN106445962A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510487940.2A CN106445962A (en) 2015-08-10 2015-08-10 Data importing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510487940.2A CN106445962A (en) 2015-08-10 2015-08-10 Data importing method and device

Publications (1)

Publication Number Publication Date
CN106445962A true CN106445962A (en) 2017-02-22

Family

ID=58093668

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510487940.2A Pending CN106445962A (en) 2015-08-10 2015-08-10 Data importing method and device

Country Status (1)

Country Link
CN (1) CN106445962A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107092672A (en) * 2017-04-13 2017-08-25 中国联合网络通信集团有限公司 Data maintaining method, apparatus and system
CN107241422A (en) * 2017-06-23 2017-10-10 郑州云海信息技术有限公司 It is a kind of in real time by the method for external user and subscriber group information with stepping Apache Ranger
CN113761037A (en) * 2020-09-28 2021-12-07 西安京迅递供应链科技有限公司 Import and export method, device, server, medium and service system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1862543A (en) * 2006-06-21 2006-11-15 千乡万才科技(中国)有限公司 Method for leading-in and deriving data in browser/servicer system
US20060265374A1 (en) * 2005-05-19 2006-11-23 Smith Thomas W Multipurpose database
CN101419628A (en) * 2008-12-03 2009-04-29 浪潮集团山东通用软件有限公司 Data general-purpose leading-in method based on excel file format
US20100145949A1 (en) * 2004-06-25 2010-06-10 Yan Arrouye Methods and systems for managing data
CN101931706A (en) * 2010-09-01 2010-12-29 惠州Tcl移动通信有限公司 Method and device for inputting backup data into mobile terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100145949A1 (en) * 2004-06-25 2010-06-10 Yan Arrouye Methods and systems for managing data
US20060265374A1 (en) * 2005-05-19 2006-11-23 Smith Thomas W Multipurpose database
CN1862543A (en) * 2006-06-21 2006-11-15 千乡万才科技(中国)有限公司 Method for leading-in and deriving data in browser/servicer system
CN101419628A (en) * 2008-12-03 2009-04-29 浪潮集团山东通用软件有限公司 Data general-purpose leading-in method based on excel file format
CN101931706A (en) * 2010-09-01 2010-12-29 惠州Tcl移动通信有限公司 Method and device for inputting backup data into mobile terminal

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107092672A (en) * 2017-04-13 2017-08-25 中国联合网络通信集团有限公司 Data maintaining method, apparatus and system
CN107241422A (en) * 2017-06-23 2017-10-10 郑州云海信息技术有限公司 It is a kind of in real time by the method for external user and subscriber group information with stepping Apache Ranger
CN107241422B (en) * 2017-06-23 2020-08-11 浪潮云信息技术股份公司 Method for synchronizing external user and user group information into Apache Range in real time
CN113761037A (en) * 2020-09-28 2021-12-07 西安京迅递供应链科技有限公司 Import and export method, device, server, medium and service system

Similar Documents

Publication Publication Date Title
US11991162B2 (en) Secure application access system
JP6835999B2 (en) Virtual service provider zone
JP6626095B2 (en) Confidential information processing method, apparatus, server, and security determination system
JP5591232B2 (en) Information transmission using virtual input layout
CN103607385B (en) Method and apparatus for security detection based on browser
US20150365385A1 (en) Method and apparatus for securing sensitive data in a cloud storage system
CN110598442A (en) Sensitive data self-adaptive desensitization method and system
US8332655B2 (en) Method for order invariant correlated encrypting of data and SQL queries for maintaining data privacy and securely resolving customer defects
CN105830133B (en) File safeguard system and user terminal
CN103324671A (en) Information memorization and management method and device based on Webkit browser
CN104391974B (en) The processing method of browser and its favorites data
CN109409045A (en) Browser automated log on account number safety guard method and device
CN105827582A (en) Communication encryption method, device and system
CN109241484A (en) A kind of sending method and equipment of the web data based on encryption technology
US11140213B2 (en) Systems and methods for distributing electronic documents
EP3471010A1 (en) Generic runtime protection for transactional data
CN108429785A (en) A kind of generation method, reptile recognition methods and the device of reptile identification encryption string
CN111680477A (en) Method and device for exporting spreadsheet file, computer equipment and storage medium
CN107241300A (en) The hold-up interception method and device of user&#39;s request
CN111212033A (en) Page display method and device based on combined web crawler defense technology and electronic equipment
CN106445962A (en) Data importing method and device
US20170200020A1 (en) Data management system, program recording medium, communication terminal, and data management server
KR100374108B1 (en) Method of and apparatus for sharing personal information in network
Guo et al. ShadowFPE: new encrypted web application solution based on shadow DOM
CN102724328B (en) Read client refreshes method, system and device after a while

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 100083 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing

Applicant after: Beijing Guoshuang Technology Co.,Ltd.

Address before: 100086 Cuigong Hotel, 76 Zhichun Road, Shuangyushu District, Haidian District, Beijing

Applicant before: Beijing Guoshuang Technology Co.,Ltd.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20170222

RJ01 Rejection of invention patent application after publication