CN104243532A - Data access method and system - Google Patents

Data access method and system Download PDF

Info

Publication number
CN104243532A
CN104243532A CN201310248957.3A CN201310248957A CN104243532A CN 104243532 A CN104243532 A CN 104243532A CN 201310248957 A CN201310248957 A CN 201310248957A CN 104243532 A CN104243532 A CN 104243532A
Authority
CN
China
Prior art keywords
data
client
access
identifying code
parameter
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
CN201310248957.3A
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.)
Hongfujin Precision Industry Shenzhen Co Ltd
Hon Hai Precision Industry Co Ltd
Original Assignee
Hongfujin Precision Industry Shenzhen Co Ltd
Hon Hai Precision Industry 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 Hongfujin Precision Industry Shenzhen Co Ltd, Hon Hai Precision Industry Co Ltd filed Critical Hongfujin Precision Industry Shenzhen Co Ltd
Priority to CN201310248957.3A priority Critical patent/CN104243532A/en
Publication of CN104243532A publication Critical patent/CN104243532A/en
Pending legal-status Critical Current

Links

Landscapes

  • Storage Device Security (AREA)

Abstract

The invention provides a data access method. The data access method comprises the steps that access request data sent by a client side are received, wherein the access request data comprise client side parameters and data obtaining parameters; according to the parameters of the client side, whether the client has the authority to have access a server or not is verified; when the client has the authority to have access to the server, data are obtained in the database of the server according to the data obtaining parameters; a data file is generated with the obtained data and is fed back to the client side. The invention further provides a data access system. By the adoption of the data access method and system, different client sides can have access to the same data in the server.

Description

Data access method and system
Technical field
The present invention relates to a kind of data access method and system, especially relate to a kind of method and system by data in client-access server.
Background technology
Along with the development of science and technology, client kind on the market gets more and more, the various fixing terminals such as such as mobile phone, panel computer, notebook computer and computer.When a set of application system (such as systems soft ware, application software) is mounted to different types of client, the application system developing different editions is often needed to carry out corresponding different types of client.Described in different clients, application system is all to having database for carrying out the storage of data, therefore, and the access of different types of client with regard to needing data access layer corresponding to exploitation to realize data.Like this, bring a lot of repetition, loaded down with trivial details data access code to developer, also cause very large puzzlement to follow-up maintenance.
Summary of the invention
In view of above content, be necessary to provide a kind of data access method and system, data corresponding for different types of client are stored in server by it, realize the access of different types of client to data in the database of this server.
A kind of data access method, be applied in server, the method comprising the steps of: (a) receives the access request data that client sends, and this access request data comprises client parameter and data acquisition parameters; Whether (b) client according to described client Verification has the authority of access services device; C (), when described client has the authority of access services device, obtains data according to described data acquisition parameters in the database of server; And the data genaration data file of acquisition is back to client by (d).
A kind of data access system, run in server, this system comprises: receiver module, and for receiving the access request data that client sends, this access request data comprises client parameter and data acquisition parameters; Whether authentication module, have the authority of access services device for client according to described client Verification; Acquisition module, for when described client has the authority of access services device, obtains data according to described data acquisition parameters in the database of server; And return module, for the data genaration data file of acquisition is back to client.
Compared to prior art, data corresponding for different types of client are stored in server by data access method provided by the invention and system, achieve the access of different types of client to data in the database of this server, data are visited without the need to developing different data access layers in various client, thus save the repetition of developer, loaded down with trivial details work, and alleviate follow-up difficult in maintenance.
Accompanying drawing explanation
Fig. 1 is the network architecture diagram of server of the present invention and client.
Fig. 2 is the functional block diagram of data access system preferred embodiment of the present invention.
Fig. 3 is the operation process chart of data access method preferred embodiment of the present invention.
Fig. 4 is an instantiation of allocation list in the present invention.
Main element symbol description
Server 100
Data access system 10
Receiver module 11
Authentication module 12
Acquisition module 13
Return module 14
Database 20
Data access interface 30
Network 200
Client 300
Input unit 40
Display screen 50
Following embodiment will further illustrate the present invention in conjunction with above-mentioned accompanying drawing.
Embodiment
Consulting shown in Fig. 1, is the network architecture diagram of server of the present invention and client.In this preferred embodiment, described server 100 is connected with multiple client 300 by network 200.Described network 200 can be intranet (Intranet), also can be the communication network of the Internet (Internet) or other type, as GPRS, Wi-Fi/WLAN, 3G/WCDMA, 3.5G/HSDPA etc.Described client 300 can be the various types of terminal such as mobile phone, panel computer, notebook computer and computer.
Described server 100 is connected with database 20 by DataBase combining, this DataBase combining can be JDBC(Java Database Connectivity, Java DataBase combining) or ODBC(Open Database Connectivity, open CNC) etc.Described server 100 comprises data access system 10 and data access interface 30.The access request data that this data access system 10 sends for receiving client 300, and in database 20, obtain data by data access interface 30, and the data of acquisition are back to client 300.Described data access interface 30 obtains data for the access request data according to client 300 in database 20.
Described client 300 comprises input unit 40 and display screen 50, and described input unit 40 is for receiving the access request of user's input.Described display screen 50 is for showing the data being received from server 100.
Consulting shown in Fig. 2, is the functional block diagram of data access system preferred embodiment of the present invention.This data access system 10 runs in the data access layer of server 100, comprises receiver module 11, authentication module 12, acquisition module 13 and returns module 14.Module 11-14 comprises computerization program command.
The access request data that receiver module 11 sends for receiving client 300, this access request data comprises client parameter and data acquisition parameters.This client parameter comprises the parameter such as title, category codes, access identifying code of client 300.Described data acquisition parameters comprises the information such as type (such as integer, character type) of key word of the inquiry, request msg.
The difference of kind belonging to corresponding client 300, each client 300 is all to there being a category codes.Such as, the category codes of mobile phone is 001, and the category codes of panel computer is 002 etc.Each client 300 is all to there being one to access identifying code, and this access identifying code identifies the access rights of different clients 300.Such as, name is called that first-hand machine, category codes are the client of 001, and access identifying code is FAGRqw.
It should be noted that, when the input unit 40 of client 300 receives access request (key word of the inquiry of such as user's input) of user's input, client 300 produces access request data corresponding to this access request, and after this access request data being encrypted, be sent to server 100 by the mode of post ().After server 100 receives the access request data of encryption, decipher this access request data to obtain described client parameter and data acquisition parameters.Send again after encrypted access request msg, the fail safe of data can be increased, prevent the request of data phenomenon of malice from occurring.
Whether authentication module 12 has the authority of access services device 100 for client 300 according to described client Verification.
It should be noted that, store an allocation list in database 20, this allocation list is for storing the authorization information of different clients 300 to realize the management of variety classes client 300.What this allocation list comprised the title of different clients 300, category codes, access identifying code and fetched data returns form.The form that returns of described fetched data can be XML format, JSON form (JavaScript Object Notation) etc.Consulting shown in Fig. 4, is an instantiation of this allocation list.
Whether authentication module 12 is searched in allocation list has and title in described client parameter and all identical client 300 of category codes.When finding in allocation list with title in described client parameter and all identical client 300 of category codes, whether the access identifying code of the client 300 found described in authentication module 12 judges is identical with the access identifying code in described client parameter.When the access identifying code of the described client 300 found is identical with the access identifying code in described client parameter, authentication module 12 judges that described client 300 has the authority of access services device 100.When not finding in allocation list and title in described client parameter and all identical client 300 of category codes, or described in the access identifying code of client 300 that finds not identical with the access identifying code in described client parameter time, authentication module 12 judges that described client 300 does not have the authority of access services device 100.
Such as, when title in client parameter, category codes and access identifying code are followed successively by: the first mobile phone, 001 and FAGRqw time, authentication module 12 can find all identical client 300 of title, category codes and access identifying code in the allocation list shown in Fig. 4, then illustrate that described client 300 has the authority of access services device 100.
When described client 300 has the authority of access services device 100, acquisition module 13 for obtaining data according to described data acquisition parameters in database 20.In this preferred embodiment, acquisition module 13 carries out searching of data by data access interface 30 in database 20, and described data access interface 30 searches data according to the key word of the inquiry in data acquisition parameters.When finding data in database 20, acquisition module 13 obtains this data found.When not finding data in database 20, acquisition module 13 gets the non-existent information of data.
Return module 14 for the data genaration data file of acquisition is back to client 300.In this preferred embodiment, return module 14 and return form by the data genaration data file (such as XML file, JSON file) of described acquisition according to the fetched data of the described client 300 found, and by the form of Response.Write (), the data file of generation is returned to client 300.When client 300 receives this data file, this data file is shown on display screen 50 by client 300.
By after in the Data Integration of different types of client 300 to the database 20 of server 100, the present invention receives the access request of client 300, and obtains the data in database 20 by data access interface 30 in server 100.In amendment allocation list, the information of client 300 can increase or delete the access rights to server 100 newly, thus visit data without the need to developing different data access layers in various client 300, save the repetition of developer, loaded down with trivial details work, and alleviate follow-up difficult in maintenance.
Consulting shown in Fig. 3, is the flow chart of data access method preferred embodiment of the present invention.
Step S10, receiver module 11 receives the access request data that client 300 sends, and this access request data comprises client parameter and data acquisition parameters.This client parameter comprises the parameter such as title, category codes, access identifying code of client 300.Described data acquisition parameters comprises the information such as type (such as integer, character type) of key word of the inquiry, request msg.
It should be noted that, when the input unit 40 of client 300 receives access request (key word of the inquiry of such as user's input) of user's input, client 300 produces access request data corresponding to this access request, and after this access request data being encrypted, be sent to server 100 by the mode of post ().After server 100 receives the access request data of encryption, decipher this access request data to obtain described client parameter and data acquisition parameters.
Step S20, whether authentication module 12 client 300 according to described client Verification has the authority of access services device 100.When described client 300 does not have the authority of access services device 100, direct process ends.When described client 300 has the authority of access services device 100, perform step S30.
In this preferred embodiment, whether authentication module 12 is searched in allocation list has and title in described client parameter and all identical client 300 of category codes.When finding in allocation list with title in described client parameter and all identical client 300 of category codes, whether the access identifying code of the client 300 found described in authentication module 12 judges is identical with the access identifying code in described client parameter.When the access identifying code of the described client 300 found is identical with the access identifying code in described client parameter, authentication module 12 judges that described client 300 has the authority of access services device 100.When not finding in allocation list and title in described client parameter and all identical client 300 of category codes, or described in the access identifying code of client 300 that finds not identical with the access identifying code in described client parameter time, authentication module 12 judges that described client 300 does not have the authority of access services device 100.
Step S30, acquisition module 13 obtains data according to described data acquisition parameters in database 20.In this preferred embodiment, acquisition module 13 carries out searching of data by data access interface 30 in database 20, and described data access interface 30 searches data according to the key word of the inquiry in data acquisition parameters.When finding data in database 20, acquisition module 13 obtains this data found.When not finding data in database 20, acquisition module 13 gets the non-existent information of data.
Step S40, returns module 14 and the data genaration data file of acquisition is back to client 300.In this preferred embodiment, return module 14 and return form by the data genaration data file (such as XML file, JSON file) of described acquisition according to the fetched data of the described client 300 found, and by the form of Response.Write (), the data file of generation is returned to client 300.When client 300 receives this data file, this data file is shown on display screen 50 by client 300.
It should be noted last that, above embodiment is only in order to illustrate technical scheme of the present invention and unrestricted, although with reference to above preferred embodiment to invention has been detailed description, those of ordinary skill in the art is to be understood that, can modify to technical scheme of the present invention or equivalent replacement, and not depart from the spirit and scope of technical solution of the present invention.

Claims (10)

1. a data access method, run in server, it is characterized in that, the method comprises:
Receiving step: receive the access request data that client sends, this access request data comprises client parameter and data acquisition parameters;
Verification step: whether client has the authority of access services device according to described client Verification;
Obtaining step: when described client has the authority of access services device, obtain data according to described data acquisition parameters in the database of server; And
Return step: the data genaration data file of acquisition is back to client.
2. data access method as claimed in claim 1, it is characterized in that, store an allocation list in described server, what store the title of different clients, category codes, access identifying code and fetched data in this allocation list returns form.
3. data access method as claimed in claim 2, it is characterized in that, described verification step comprises:
Search in allocation list and whether have and title in described client parameter and all identical client of category codes;
When finding in allocation list with title in described client parameter and all identical client of category codes, whether the access identifying code of the client found described in judgement is identical with the access identifying code in described client parameter;
When the access identifying code of the described client found is identical with the access identifying code in described client parameter, judge that described client has the authority of access services device; And
When not finding in allocation list and title in described client parameter and all identical client of category codes, or described in the access identifying code of client that finds not identical with the access identifying code in described client parameter time, judge that described client does not have the authority of access services device.
4. data access method as claimed in claim 3, is characterized in that, described in return step according to described in find the fetched data of client return form by the data genaration data file of described acquisition.
5. data access method as claimed in claim 1, it is characterized in that, described obtaining step comprises:
Searching of data is carried out in a database by the data access interface in server;
When finding data in a database, obtain the data that this finds; And
When not finding data in a database, get the non-existent information of data.
6. a data access system, is applied in server, it is characterized in that, this system comprises:
Receiver module, for receiving the access request data that client sends, this access request data comprises client parameter and data acquisition parameters;
Whether authentication module, have the authority of access services device for client according to described client Verification;
Acquisition module, for when described client has the authority of access services device, obtains data according to described data acquisition parameters in the database of server; And
Return module, for the data genaration data file of acquisition is back to client.
7. data access system as claimed in claim 6, it is characterized in that, store an allocation list in described server, what store the title of different clients, category codes, access identifying code and fetched data in this allocation list returns form.
8. data access system as claimed in claim 7, it is characterized in that, by following steps, described authentication module verifies whether described client has the authority of access services device:
Search in allocation list and whether have and title in described client parameter and all identical client of category codes;
When finding in allocation list with title in described client parameter and all identical client of category codes, whether the access identifying code of the client found described in judgement is identical with the access identifying code in described client parameter;
When the access identifying code of the described client found is identical with the access identifying code in described client parameter, judge that described client has the authority of access services device; And
When not finding in allocation list and title in described client parameter and all identical client of category codes, or described in the access identifying code of client that finds not identical with the access identifying code in described client parameter time, judge that described client does not have the authority of access services device.
9. data access system as claimed in claim 8, is characterized in that, described in return module according to described in find the fetched data of client return form by the data genaration data file of described acquisition.
10. data access system as claimed in claim 6, is characterized in that, described acquisition module obtains the data in database by following steps:
Searching of data is carried out in a database by the data access interface in server;
When finding data in a database, obtain the data that this finds; And
When not finding data in a database, get the non-existent information of data.
CN201310248957.3A 2013-06-21 2013-06-21 Data access method and system Pending CN104243532A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310248957.3A CN104243532A (en) 2013-06-21 2013-06-21 Data access method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310248957.3A CN104243532A (en) 2013-06-21 2013-06-21 Data access method and system

Publications (1)

Publication Number Publication Date
CN104243532A true CN104243532A (en) 2014-12-24

Family

ID=52230872

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310248957.3A Pending CN104243532A (en) 2013-06-21 2013-06-21 Data access method and system

Country Status (1)

Country Link
CN (1) CN104243532A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105183751A (en) * 2015-07-13 2015-12-23 深信服网络科技(深圳)有限公司 Database access method and database access device
CN105391686A (en) * 2015-10-15 2016-03-09 桂林电子科技大学 Data access method and data access device
CN105512861A (en) * 2015-12-09 2016-04-20 南通科俊建筑工程有限公司 Office automatic information processing method and system
CN105955872A (en) * 2016-04-25 2016-09-21 乐视控股(北京)有限公司 Server performance test method and system
CN107465641A (en) * 2016-06-02 2017-12-12 上海海典软件股份有限公司 Based on three-tier architecture software systems and its data request method
CN107734046A (en) * 2017-10-26 2018-02-23 山东浪潮通软信息科技有限公司 Method, service end, client and the system of remote operation database
CN108574620A (en) * 2017-03-09 2018-09-25 腾讯科技(深圳)有限公司 A kind of data subscription method, device, server and system
CN110019045A (en) * 2017-12-29 2019-07-16 北京奇虎科技有限公司 Method and device is landed in log
CN111343168A (en) * 2020-02-19 2020-06-26 深圳壹账通智能科技有限公司 Identity authentication method and device, computer equipment and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101515932A (en) * 2009-03-23 2009-08-26 中兴通讯股份有限公司 Method and system for accessing Web service safely
EP2239673A1 (en) * 2009-04-09 2010-10-13 Université de Berne Method and system for storing data upon a public net
CN102347957A (en) * 2011-11-18 2012-02-08 王鑫 Cloud network admission identifying system and admission identifying technology

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101515932A (en) * 2009-03-23 2009-08-26 中兴通讯股份有限公司 Method and system for accessing Web service safely
EP2239673A1 (en) * 2009-04-09 2010-10-13 Université de Berne Method and system for storing data upon a public net
CN102347957A (en) * 2011-11-18 2012-02-08 王鑫 Cloud network admission identifying system and admission identifying technology

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105183751A (en) * 2015-07-13 2015-12-23 深信服网络科技(深圳)有限公司 Database access method and database access device
CN105391686A (en) * 2015-10-15 2016-03-09 桂林电子科技大学 Data access method and data access device
CN105512861A (en) * 2015-12-09 2016-04-20 南通科俊建筑工程有限公司 Office automatic information processing method and system
CN105955872A (en) * 2016-04-25 2016-09-21 乐视控股(北京)有限公司 Server performance test method and system
CN107465641A (en) * 2016-06-02 2017-12-12 上海海典软件股份有限公司 Based on three-tier architecture software systems and its data request method
CN108574620A (en) * 2017-03-09 2018-09-25 腾讯科技(深圳)有限公司 A kind of data subscription method, device, server and system
CN107734046A (en) * 2017-10-26 2018-02-23 山东浪潮通软信息科技有限公司 Method, service end, client and the system of remote operation database
CN110019045A (en) * 2017-12-29 2019-07-16 北京奇虎科技有限公司 Method and device is landed in log
CN110019045B (en) * 2017-12-29 2024-04-16 北京奇虎科技有限公司 Log floor method and device
CN111343168A (en) * 2020-02-19 2020-06-26 深圳壹账通智能科技有限公司 Identity authentication method and device, computer equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN104243532A (en) Data access method and system
CN111191221B (en) Configuration method and device of authority resources and computer readable storage medium
CN109474456B (en) Configuration data processing method, device, computer equipment and storage medium
CN107026832A (en) Account logon method, equipment and server
CN106685907B (en) A kind of generation method and device of session key
US20120030337A1 (en) Apparatus and method for identifying access terminal
JP2012520502A (en) System and method for integrating and operating a plurality of access statistics servers
CN109284321B (en) Data loading method, device, computing equipment and computer readable storage medium
CN103415014B (en) The method and apparatus authenticated is carried out for mobile terminal
CN111651468A (en) Data updating method and device based on SQL analysis, electronic equipment and storage medium
CN107911249A (en) Order line sending method, device and the equipment of a kind of network equipment
CN108173839B (en) Authority management method and system
CN110990008B (en) Page updating method and device, storage medium and electronic equipment
US20120090035A1 (en) System and Tool for Logistics Data Management on Secured Smart Mobile Devices
CN110661851A (en) Data exchange method and device
AU2014256198A1 (en) Terminal, network side device, terminal application control method, and system
Jain et al. Data Communication and Information Exchange in Distributed IoT Environment: Issues and Their Solutions
CN113051299A (en) Proxy information processing method, proxy information processing device, computer equipment and storage medium
CN111417927A (en) Resource authority processing method and device, storage medium and chip
CN114238767B (en) Service recommendation method, device, computer equipment and storage medium
CN109117152B (en) Service generation system and method
CN111538672A (en) Test case layered test method, computer device and computer-readable storage medium
US20160246783A1 (en) Systems and methods for managing data related to network elements from multiple sources
CN108268545B (en) Method and device for establishing hierarchical user label library
US20220301012A1 (en) Apparatuses and methods for facilitating a generation and use of models

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20141224

WD01 Invention patent application deemed withdrawn after publication