WO2017156916A1 - 数据访问方法和装置 - Google Patents

数据访问方法和装置 Download PDF

Info

Publication number
WO2017156916A1
WO2017156916A1 PCT/CN2016/087452 CN2016087452W WO2017156916A1 WO 2017156916 A1 WO2017156916 A1 WO 2017156916A1 CN 2016087452 W CN2016087452 W CN 2016087452W WO 2017156916 A1 WO2017156916 A1 WO 2017156916A1
Authority
WO
WIPO (PCT)
Prior art keywords
data access
attribute
business object
access request
value
Prior art date
Application number
PCT/CN2016/087452
Other languages
English (en)
French (fr)
Inventor
王甲民
Original Assignee
百度在线网络技术(北京)有限公司
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 百度在线网络技术(北京)有限公司 filed Critical 百度在线网络技术(北京)有限公司
Publication of WO2017156916A1 publication Critical patent/WO2017156916A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services

Definitions

  • the embodiments of the present invention relate to information processing technologies, and in particular, to a data access method and apparatus.
  • XX School establishes a student information management system established to maintain student information, or a mobile sales information management system established by XX Mobile Sales Company to collect and maintain sales products.
  • management systems mainly include client software and a back-end server that stores the database.
  • FIG. 1 is a schematic diagram of human-computer interaction of a client software of a student information management system.
  • a data access request may be sent through the client software, and the background database passes the database access request after receiving the data access request.
  • the content is operated to return the result data corresponding to the data access request to the corresponding client software.
  • the foreground client generally including the web client and the mobile app client
  • the background server generally use different computer technologies
  • the division of labor is completed.
  • the main system building process includes: client developers design business objects and the services they need.
  • the server side manually writes the access service code according to the requirements provided by the client, and finally realizes the establishment of the system through the design confirmation and joint debugging of the client and the server interface.
  • the main drawback of the prior art is that the front-end interface lacks a unified interface specification, and the server side needs to repeatedly write server-side code for a client that needs similar functions, that is, the background service lacks a general implementation and cannot be reused, and Back-end server developers bring a lot of repetitive work.
  • embodiments of the present invention provide a data access method and apparatus to optimize an existing database-based data access system establishment process, and greatly reduce the repetitive workload of data access system developers.
  • an embodiment of the present invention provides a data access method, including:
  • a data access request sent by the client includes: a business object attribute corresponding to a form item name submitted by the client, a preset interval, and an operator for the attribute of the business object , a name-value pair connector, and a target attribute or value entered by the user corresponding to the input value of the form item;
  • an embodiment of the present invention further provides a data access method, including:
  • the data access request includes: a business object attribute corresponding to a form item name of the submitted form, a preset interval, and an operator and a name for the attribute of the business object Value pair connector, and form item The target attribute or value entered by the user corresponding to the input value;
  • the data access result is that the server performs a corresponding data access operation according to the business object access method corresponding to the set data access interface based on the parsed business object attribute, operator, and target attribute or value. And the visit was obtained.
  • an embodiment of the present invention provides a data access apparatus, configured in a server, including:
  • the access request receiving module is configured to receive, according to the setting data access interface, a data access request sent by the client, where the data access request includes: a business object attribute corresponding to a form item name submitted by the client, a preset interval, and The operator attribute, name value pair connector, and the target attribute or value entered by the user corresponding to the input value of the form item;
  • An access request parsing module configured to parse a business object attribute, an operator, and a target attribute or value from the received data access request;
  • An operation execution module configured to perform a corresponding data access operation according to the business object access method corresponding to the set data access interface, based on the parsed business object attribute, operator, and target attribute or value;
  • the access result returns a module for returning the access result to the client.
  • the embodiment of the present invention further provides a data access device, configured in the client, including:
  • the access request sending module is configured to send a data access request to the set data access interface of the server, where the data access request includes: a business object attribute corresponding to the form item name of the submitted form, a preset interval, and a service The operator of the object attribute, the name value pair connector, and the target attribute or value entered by the user corresponding to the input value of the form item;
  • a result receiving module configured to receive a data access result returned by the server and corresponding to the data access request
  • the data access result is that the server performs a corresponding data access operation according to the business object access method corresponding to the set data access interface based on the parsed business object attribute, operator, and target attribute or value. And the visit was obtained.
  • the embodiment of the present invention sends a service object attribute in the submitted form, an operator for the business object attribute, and a target attribute or value to the server in the form of a name-value pair, and the server identifies the specific spacer connecting the above parameters.
  • the general-purpose data analysis method can be used to obtain the above parameters, and the technical effect of the corresponding access result is generated according to the standardized data access interface that receives the above parameters, and the existing database-based data is optimized. Access to the system establishment process greatly reduces the repetitive workload of data access system developers.
  • FIG. 1 is a schematic diagram of human-computer interaction of a client software of a student information management system in the prior art
  • FIG. 2 is a flow chart of a data access method according to a first embodiment of the present invention
  • FIG. 3 is a flow chart of a data access method according to a second embodiment of the present invention.
  • FIG. 4 is a flowchart of a data access method according to a third embodiment of the present invention.
  • FIG. 5 is a flowchart of a data access method according to a fourth embodiment of the present invention.
  • FIG. 6a is a schematic diagram of an implementation of a background server according to an embodiment of the present invention.
  • 6b is a comparison diagram of a construction process of a data access system in the prior art and the embodiment of the present invention.
  • Figure 7 is a structural diagram of a data access device according to a seventh embodiment of the present invention.
  • Figure 8 is a structural diagram of a data access device according to an eighth embodiment of the present invention.
  • FIG. 9 is a block diagram showing the structure of a computer system suitable for implementing the terminal device or server of the embodiment of the present application.
  • the client mainly transmits form form data through a GET command or a POST command of HTTP (HyperText Transfer Protocol).
  • a background data server wherein the form form includes a plurality of name-value lists, and the background data server completes data access or business operations by parsing the name and value of the commands and data in the list, and returns a result.
  • Data or page to the client
  • the form form is the underlying data in the data transmission process.
  • This form of transmission lacks management of the data organization, and the form is very primitive.
  • the client developer can also convert the form form data into a JSON object format (typically by encapsulation or packaging) before passing the data to the background data server, ie: the form form All the data in the data is converted to a certain standard JSON object format data (standardized name value pair format data), and then transmitted to the background data server, background data service
  • the data received by the server is a qualified JSON code that can be used directly.
  • the data in the converted JSON object format is:
  • the server-side developer must follow the programming convention with the client developer, from the set location of the received data or according to the set data parsing method, from the client.
  • the basic operation instruction based on the business object attribute (also referred to as a field) is parsed in the data sent by the terminal, and is output to a data processing interface (URI address) corresponding to the business object for processing.
  • URI address data processing interface
  • the fuzzy matching field value is the basic operation instruction of the data of "Zhang San”
  • the server needs to receive the name of the form form or the JSON object according to the convention.
  • the attribute name is extracted in turn: "name”, the operation type for the attribute name: "fuzzy match” and the attribute value: "Zhang San”.
  • the main drawback of the prior art is that the front and back interface lacks specifications, the background service lacks a common implementation and cannot be reused. At the same time, if the client generates a demand change (increasing the gender query function), the server side needs to synchronize the code to adapt. Client modification.
  • the data of the JSON object type is essentially the data of the name-value pair.
  • the difference is that the two are connected to the connector by different name values.
  • the name-value pairs of the JSON object type are connected by ":", for example: ""name”: "Bender””. If a basic operation instruction as described above can be expressed in the form of a name-value pair, the server can obtain the data and the simple analysis of the name-value pair regardless of the form of the data sent by the client. instruction.
  • a basic operation instruction as described above needs to include three parameters (property name: "name”, operation type for attribute name: “fuzzy match” and attribute value: "Zhang The third "), or the need to use the triple data representation, and the data form of the name value pair is a binary data form, if it is not processed, the name value pair cannot be used to represent the basic operation instruction.
  • the inventor creatively proposes that the business object attribute in the basic operation instruction and the operator for the business object attribute are connected by a personalized spacer, and the attribute value is used as the first data in the name value pair.
  • the second data in the pair of name values such that the pair of name values in the form of a two-group can be skillfully used to represent a basic operation instruction including three parameters.
  • This conversion method greatly simplifies the representation of attribute operation commands, and is consistent with the form form and mobile application interface elements. Without increasing the complexity of existing development technologies, the degree of standardization of front and back interfaces and service automation are greatly improved. Processing power, that is, the core invention of the present invention.
  • FIG. 2 is a flowchart of a data access method according to a first embodiment of the present invention.
  • the method in this embodiment may be implemented by a data access device, and the device may be implemented by using hardware and/or software, and may be generally integrated.
  • the server and the method of the embodiment is generally applicable to The server queries the locally stored database and returns the corresponding access result according to the client's data access request.
  • the method of this embodiment specifically includes:
  • the developer of the front-end client sets the action attribute of the different form form to the URI (Uniform Resource Identifie) address corresponding to the data access interface of the background server according to different functions of the form form.
  • the action attribute of the form form is used to indicate where the form data is sent when the form is submitted.
  • the data access request corresponding to the form form is automatically sent to the setting of the server set by the action attribute of the form form.
  • Data access interface
  • the data access request may be data in a preset form format or data in a JSON object format, which is not limited in this embodiment.
  • the form form is encapsulated into data in a JSON object format, and then sent as a data access request.
  • the data access request is content in the form of an HTTP GET command or a POST command.
  • the data access request includes: a business object attribute corresponding to a form item name submitted by the client, a preset interval, an operator for the business object attribute, a name-value pair connector, and The target attribute or value entered by the user corresponding to the form item input value.
  • the client needs to set the business object attribute and the name of a target form item (also known as the form's name attribute).
  • the operator for the business object attribute is connected as a form item name by a preset separator.
  • a value is generated corresponding to the target form item name and the form item through the target form (ie, The value attribute of the form) is a pair of name values formed by the user-entered target attribute or value, and the name value pair is connected by a name-value pair connector.
  • the preset spacer can preferably be: "$", “$$” or "_" by careful selection. It can be understood by those skilled in the art that the preset spacer can also be selected as other symbols according to the foregoing selection principle, which is not limited in this embodiment.
  • the business object attribute corresponding to the name of the form item submitted by the client may specifically refer to a field name of the business object accessed by the user, for example, a business object (or a data record) named “student”, including The "name", “age”, and “sex” fields, and the field names of the above fields are the business object attributes.
  • the operator for the attribute of the business object is specifically a related operation performed by the field value corresponding to the field name, and the target attribute or value input by the user corresponding to the input value of the form item specifically refers to the operation of the attribute of the business object.
  • the associated action attribute or action value is specifically refer to the operation of the attribute of the business object.
  • a form item name is set to age$inc
  • the business object attribute corresponding to the form is "age”
  • the operator for the business object attribute is "+”
  • the operation value entered by the user is "1”
  • the operation command corresponds to +1 the field value in the age field.
  • the business object attributes, operators, and target attributes or values are sequentially connected to the connectors by a preset spacer and a name value. Therefore, a preferred embodiment of the present embodiment
  • the preset interval and the name-value pair connector included in the data access request may be first identified by means of keyword matching, and then the business object attribute, the operator, and the target attribute or value may be acquired;
  • the data access request may be first identified.
  • the preset interval is included, and then the business object attribute, the operator and the target attribute or value are parsed according to the relative positional relationship between the business object attribute, the operator and the target attribute or the value and the preset interval.
  • the background basic service framework (typically, the Tomcat application service under Java) first parses the data access request into a binary data in the form of a name-value pair, ie, The target attribute or value can be directly parsed, and then the predetermined attribute is identified in the data corresponding to the form item name, and the business object attribute and the operator can be separately obtained.
  • different URI addresses in the server correspond to data access interfaces of different business objects, and may be accessed according to different business objects based on data in the locally stored database (typically, add, delete, change, and check) , perform the corresponding data access operation.
  • the interface After the parsed business object attribute, operator, and target attribute or value are input to the set data access interface, the interface performs a corresponding data access operation according to the corresponding business object access method.
  • the server provides an identical set of functionally unified unified service object access methods for each service object, and the externally released interface is preferably implemented by Restful Web Service technology.
  • the client preferably uses the HTTP GET command to send data access requests, so as to maximize compatibility and facilitate the testing, debugging, and operation and maintenance operations of the background service directly on the native browser.
  • the server may generate a corresponding return result for the data access request of the client, or may not generate any return result (for example, adding or deleting the corresponding data information only in the database in the server), which is preferred in this embodiment.
  • the server for the data access request sent by the client, the server generates an access result for parsing and displaying by the client.
  • the returned result is data in a JSON object format
  • the content of the returned result may include a success flag, failure information, correct result data, and the like.
  • the embodiment of the present invention sends a service object attribute in the submitted form, an operator for the business object attribute, and a target attribute or value to the server in the form of a name-value pair, and the server identifies the specific spacer connecting the above parameters.
  • the general-purpose data analysis method can be used to obtain the above parameters, and the technical effect of the corresponding access result is generated according to the standardized data access interface that receives the above parameters, and the existing database-based data is optimized. Access to the system establishment process greatly reduces the repetitive workload of data access system developers.
  • a standard operator set and a standard access method set can be designed by a server-side developer, and the quasi-operator set and the standard access method set are provided to the client.
  • Developer Enables client developers to write clients using server-defined standard operators and standard access methods
  • the end code can realize that the server-side code can be multiplexed in different servers corresponding to different clients only after some set data conversion processing.
  • the standard access method defines a URI address corresponding to different data access interfaces in the server, and different URI addresses use different business object access methods to perform corresponding data access operations.
  • the client developer obtains the corresponding URI address in the standard access method set according to the data processing called by the front end, so that the server performs the corresponding data access function.
  • a schematic table of a standard set of access methods is shown in Table 2. Among them, the beanPath corresponds to different business objects.
  • the data access interface is determined by a standard URI address corresponding to an action attribute of a form submitted by a client, where the standard URI address corresponds to a corresponding service object and a standard access method set. Standard access method. To achieve reuse of server-side code.
  • FIG. 3 is a flow chart of a data access method according to a second embodiment of the present invention.
  • the embodiment is optimized based on the foregoing embodiments.
  • the data access request is optimized to data in a preset form format, wherein the name-value pair connector is in the form format.
  • the business object attribute, the operator and the target attribute or the value are parsed from the received data access request, and the data access request is converted into the name and the name of the form item through the background infrastructure service. Determining the target attribute or value by the binary data corresponding to the form item input value; identifying the preset spacer in the first data corresponding to the form item name; according to the preset interval At the location in the first data, the business object attribute and the operator are parsed.
  • the method in this embodiment specifically includes:
  • the data access request is specifically data of a preset form format.
  • the data access request comprises: a business object attribute corresponding to a form item name submitted by the client, a preset interval character, an operator for the business object attribute, a name value pair connector, and a form item input.
  • the target attribute or value entered by the user corresponding to the value.
  • the name value pair connector is a connector for connecting the form item name and the form item input value in the form format.
  • the server-side developer defines different URI addresses for different business objects and standard access methods applied, and the operation object consists of the business object attribute and the operator for the object attribute as a URI.
  • the background basic service framework will automatically convert the data into (name$like, Zhangsan) binary. Groups, then by identifying "$" in name$like, can finally parse out (name, like, three), and then simply get the object properties, operators and target properties or values.
  • the embodiment of the present invention only increases the work of parsing the part of the name$like compared with the existing development method, and strengthens the former without changing the traditional development method and reducing the ability of the traditional development.
  • Background interface specification to achieve reuse of server-side code.
  • the technical solution of the embodiment identifies the preset interval from the received data access request by receiving a data access request in a preset form format sent by the client based on the setting data access interface, according to the location of the operator Identifying the name-value pair connector, according to the location value of the connector, the technical means of parsing the target attribute or value, and implementing the general-purpose data analysis method to obtain the above parameter, and receiving according to the The standardized data access interface of the above parameters generates the technical effect of the corresponding access result.
  • the client developer needs to temporarily modify or debug the client program code
  • the developer needs to manually enter the HTTP GET command corresponding to the data access request in the native browser, and the form form
  • the data access request has strict format requirements and is inconvenient to input directly.
  • the client developer can simply and directly construct an HTTP GET command based on the business object attribute, operator and target attribute or value and send it to the server. It greatly facilitates the convenience of developers programming and debugging.
  • FIG. 4 is a flow chart of a data access method according to a third embodiment of the present invention. This embodiment is optimized based on the first embodiment. In this embodiment, the data access request is optimized to data in a JSON object format.
  • the method in this embodiment specifically includes:
  • the data access request is data in a JSON object format
  • the JSON object is generated by data encapsulation in a form format.
  • the name of the JSON object corresponds to a form item name in the data of the form format
  • the value pair of the JSON object corresponds to a form item input value in the data of the form format
  • the name value pair is connected.
  • the symbol is a connector for connecting the name of the JSON object and the value pair of the JSON object in the JSON object format, and the name value pair connector is specifically ":".
  • the data access request comprises: a business object attribute corresponding to a form item name submitted by the client, a preset interval character, an operator for the business object attribute, a name value pair connector, and a form item input.
  • the JSON object can be automatically parsed.
  • the method in this embodiment mainly parses the business object attribute and the operator by identifying a preset interval.
  • the data access request in the JSON object format sent by the client is received according to the setting data access interface, and the business object is parsed from the received data access request according to the location of the identified preset interval.
  • the technical means of attributes, operators, and target attributes or values can implement a general-purpose data analysis method to obtain the above parameters, and generate a corresponding access result according to a standardized data access interface that receives the above parameters.
  • Technical effects optimize the existing database-based data access system establishment process, greatly reducing the workload of data access system developers.
  • FIG. 5 is a flowchart of a data access method according to a fourth embodiment of the present invention.
  • the method in this embodiment may be implemented by a data access device, and the device may be implemented by using hardware and/or software, and may be generally integrated.
  • the method of the present embodiment is generally applicable to a situation in which a client sends a data access request to a server and receives an access result returned by the server.
  • the method of this embodiment specifically includes:
  • the data access request includes: a business object attribute corresponding to the form item name of the submitted form, a preset interval, an operator for the business object attribute, a name-value pair connector, and a form item. Enter the target attribute or value entered by the user for the value.
  • the client configures the name attribute (that is, the form item name) of the delivery form as a business object attribute, a preset spacer, and an operator for the business object attribute, and will be associated with the submitted form.
  • the data access request may be generated by using the target attribute or value input by the user corresponding to the form item input value as the value attribute of the form.
  • the data access request can be sent to the set data access interface of the server.
  • the operator for the attribute of the business object included in the data access request and the URI address corresponding to the setting data access interface of the server are the standard operator set provided by the server and the standard operation method of the standard business object.
  • the data access result is that the server performs a corresponding data access operation according to the business object access method corresponding to the set data access interface based on the parsed business object attribute, operator, and target attribute or value. And the visit was obtained.
  • the embodiment of the present invention sends a service object attribute in the submitted form, an operator for the business object attribute, and a target attribute or value to the server in the form of a name-value pair, and the server identifies the specific spacer connecting the above parameters.
  • the technical means of parsing the above parameters optimizes the establishment process of the existing database-based data access system, which greatly reduces the workload of the data access system developers.
  • sending a data access request to the setting data access interface of the server may include:
  • the data access request is sent to the set data access interface corresponding to the standard URI.
  • the sending a data access request to the setting data access interface of the server may further include:
  • the data access request is sent to the set data access interface corresponding to the standard URI.
  • FIG. 6a An implementation framework diagram of a background server based on an embodiment of the present invention is shown in FIG. 6a, and a typical data access process for implementing the client and server interactivity of the embodiment of the present invention is shown in conjunction with FIG. 6a. Describe as follows:
  • Front-end (or client-side) data entry The WEB side or the mobile App side enters the data to be processed through the data form, and the input is completed and submitted to the URI address corresponding to the background server, and each URI address corresponds to a business object access method.
  • the basic design method of the WEB form is to set the form item name to the form of ⁇ business object attribute ⁇ $ ⁇ operation symbol ⁇ , and the form item input value is obtained by the value attribute of the form.
  • Background service (or server) processing: After receiving the standardized format parameters passed by the front end, the background server parses the operation command, accesses and operates the corresponding background data.
  • the basic rule is that the business object attribute corresponds to the field of the database object, the operator of the business object attribute specifies the operation method of the corresponding field, the logical operator queries the positioning data, sets the operator update data, and some general access processing operators, such as paging, Sorting, grouping aggregation calculations, etc.
  • the background service finally returns the corresponding request result and the request status by accessing the database processing completion request, and returns an error code and corresponding error information if an error occurs, and the returned result is usually expressed in a Json object format.
  • the front-end processing result shows: the front-end receives the result returned by the background service, first parses whether an error occurs, and if there is an error, prompts the user to perform error processing. If there is no error, the return information is displayed for the user to process next.
  • the corresponding background server method parses the incoming parameter, performs the corresponding data access operation, returns the data access result, and displays the result content on the WEB page. Since the background service no longer needs manual development, the front-end interface does not need to be confirmed by both parties.
  • the service interface is very flexible and can be applied to most scenarios. For example, the interval query condition for increasing the height only adds two name attributes to height$gt and height. The two ⁇ input> tags of $lt can be used without modifying the code content in the backend server.
  • FIG. 6b is a comparison diagram of the construction process of the data access system in the prior art and the embodiment of the present invention.
  • the method of the embodiment of the present invention accesses the background data service in a general Internet environment (such as mobile sales systems, work order management systems, etc., you can use the tool to directly generate the background server code.
  • a general Internet environment Such as mobile sales systems, work order management systems, etc.
  • the main reason is that for the background data service access in the general Internet environment, the business object access method required by the client and the operation method for the business object attribute are similar.
  • the difference can be satisfied.
  • the use of the client that is, the reuse of the background server code.
  • the prior art requires manual coding to implement the background service.
  • the method in the embodiment of the present invention is directly generated by using a tool, and the function that cannot be satisfied by the tool code generation may be manually extended or re-developed.
  • the inventor discovered through research and test that the unified general-purpose background service code generated by the tool is built on well-designed and unified operation symbols and operation methods. It has very good flexibility and reliability, and has undergone rigorous function and performance testing. It is enough to meet the needs of more than 70% of the information operation management system, more than 95% of the information retrieval needs, greatly improve the research and development efficiency and product quality, and the overall data access application system research and development efficiency is increased by about 50%. On the basis of greatly saving labor costs, the system development efficiency is effectively improved.
  • FIG. 7 is a structural diagram of a data access device according to a fifth embodiment of the present invention.
  • the data access device is configured in a server. As shown in FIG. 7, the device includes: an access request receiving module 71.
  • the access request receiving module 71 is configured to receive, according to the setting data access interface, a data access request sent by the client, where the data access request includes: a business object attribute corresponding to a form item name submitted by the client, and a preset interval And an operator, a name-value pair connector, and a target attribute or value entered by the user corresponding to the input value of the form item;
  • An access request parsing module 72 configured to parse a business object attribute, an operator, and a target attribute or value from the received data access request;
  • the access operation execution module 73 is configured to perform a corresponding data access operation according to the business object access method corresponding to the set data access interface based on the parsed business object attribute, operator, and target attribute or value;
  • the access result returns to the module 74 for returning the access result to the client.
  • the embodiment of the present invention sends a service object attribute in the submitted form, an operator for the business object attribute, and a target attribute or value to the server in the form of a name-value pair, and the server identifies the specific spacer connecting the above parameters.
  • the general-purpose data analysis method can be used to obtain the above parameters, and the technical effect of the corresponding access result is generated according to the standardized data access interface that receives the above parameters, and the existing database-based data is optimized. Access to the system establishment process greatly reduces the workload of data access system developers.
  • the data access request may be data in a preset form format, wherein the name value pair connector is used to connect the form item name in the form format and the The connector for the form item input value.
  • the data access request may be data in a JSON object format, where the JSON object is generated by data encapsulation in a form format;
  • the name of the JSON object corresponds to a form item name in the data of the form format
  • the value pair of the JSON object corresponds to a form item input value in the data of the form format
  • the name value pair connector is A connector for connecting the name of the JSON object and the value pair of the JSON object in the JSON object format.
  • the preset spacer may be $, $$ or _.
  • the data access device provided by the embodiment of the present invention can be used to perform the data access method provided by the first embodiment to the third embodiment of the present invention, and has corresponding functional modules to achieve the same beneficial effects.
  • FIG. 8 is a structural diagram of a data access apparatus according to a sixth embodiment of the present invention.
  • the data access apparatus is configured in a client. As shown in FIG. 8, the apparatus includes: accessing The request sending module 81 and the return result receiving module 82 are provided. among them:
  • the access request sending module 81 is configured to send a data access request to the set data access interface of the server, where the data access request includes: a business object attribute corresponding to the form item name of the submitted form, a preset interval, and The operator of the business object attribute, the name value pair connector, and the target attribute or value entered by the user corresponding to the input value of the form item;
  • result receiving module 82 configured to receive a data access result returned by the server and corresponding to the data access request
  • the data access result is that the server performs a corresponding data access operation according to the business object access method corresponding to the set data access interface based on the parsed business object attribute, operator, and target attribute or value. And the visit was obtained.
  • the embodiment of the present invention sends a service object attribute in the submitted form, an operator for the business object attribute, and a target attribute or value to the server in the form of a name-value pair, and the server identifies the specific spacer connecting the above parameters.
  • the technical means of parsing the above parameters optimizes the establishment process of the existing database-based data access system, which greatly reduces the workload of the data access system developers.
  • the data access device provided by the embodiment of the present invention can be used to execute the data access method provided by Embodiment 4 of the present invention, and has corresponding functional modules to achieve the same beneficial effects.
  • the embodiments of the present invention may be implemented by a program executable by a computer device, so that they may be stored in a storage device and executed by a processor, and the program may be stored in a computer readable storage medium.
  • the above mentioned storage medium may be a read only memory, a magnetic disk or an optical disk, etc.; or they may be separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof may be fabricated as a single integrated circuit module.
  • the invention is not limited to any particular hard The combination of pieces and software.
  • FIG. 9 is a block diagram showing the structure of a computer system suitable for implementing the terminal device or server of the embodiment of the present application.
  • computer system 900 includes a central processing unit (CPU) 901 that can be loaded into a program in random access memory (RAM) 903 according to a program stored in read only memory (ROM) 902 or from storage portion 908. And perform various appropriate actions and processes.
  • RAM random access memory
  • ROM read only memory
  • various programs and data required for the operation of the system 900 are also stored.
  • the CPU 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904.
  • An input/output (I/O) interface 905 is also coupled to bus 904.
  • the following components are connected to the I/O interface 905: an input portion 906 including a keyboard, a mouse, etc.; an output portion 907 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), and the like, and a storage portion 908 including a hard disk or the like. And a communication portion 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the Internet.
  • Driver 910 is also connected to I/O interface 905 as needed.
  • a removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory or the like is mounted on the drive 910 as needed so that a computer program read therefrom is installed into the storage portion 908 as needed.
  • an embodiment of the present disclosure includes a computer program product comprising a computer program tangibly embodied on a machine readable medium, the computer program comprising program code for executing the method illustrated in the flowchart.
  • the computer program can be downloaded and installed from the network via the communication portion 909, and/or installed from the removable medium 911.
  • each block in the flowchart or block diagram can represent a module, a program segment, or a portion of code.
  • the module, program segment, or portion of code includes one or more executable instructions for implementing the specified logical functions.
  • the functions noted in the blocks may also occur in a different order than that illustrated in the drawings. For example, two successively represented blocks may in fact be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts can be implemented in a dedicated hardware-based system that performs the specified function or operation. Or it can be implemented by a combination of dedicated hardware and computer instructions.
  • the present application further provides a non-volatile computer storage medium, which may be a non-volatile computer storage medium included in the apparatus described in the foregoing embodiments; It may be a non-volatile computer storage medium that exists alone and is not assembled into the terminal.
  • the non-volatile computer storage medium stores one or more programs, when the one or more programs are executed by a device, causing the device to: receive a data access request sent by the client based on the setting data access interface, The data access request includes: a business object attribute corresponding to a form item name submitted by the client, a preset interval, an operator for the business object attribute, a name value pair connector, and a value corresponding to the input value of the form item.
  • the target attribute or value entered by the user; the business object attribute, operator, and target attribute or value are parsed from the received data access request; based on the parsed business object attribute, operator, and target attribute or value, Setting a business object access method corresponding to the data access interface, performing a corresponding data access operation; and returning the access result to the client.
  • the non-volatile computer storage medium stores one or more programs, when the one or more programs are executed by a device, causing the device to: send a data access request to a set data access interface of the server,
  • the data access request includes: a business object attribute corresponding to a form item name of the submitted form, a preset interval character, an operator for the business object attribute, a name value pair connector, and a value corresponding to the input value of the form item.
  • the object access method is obtained by performing a corresponding data access operation.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明实施例公开了一种数据访问方法和装置。所述方法包括:基于设定数据访问接口接收客户端发送的数据访问请求,数据访问请求包括:与客户端所递交表单的表单项名称对应的业务对象属性、预设间隔符以及针对业务对象属性的操作符、名值对连接符、以及与表单项输入值对应的由用户输入的目标属性或数值;从所接收的数据访问请求中解析出业务对象属性、操作符和目标属性或数值;基于所解析出的业务对象属性、操作符和目标属性或数值,按照与设定数据访问接口对应的业务对象访问方法,执行相应数据访问操作;以及将访问结果返回给客户端。本发明的技术方案优化了现有的基于数据库的数据访问系统的建立流程,减少了数据访问系统开发人员的工作量。

Description

数据访问方法和装置
相关申请的交叉引用
本申请要求于2016年3月16日提交的中国专利申请号为“201610151390.1”的优先权,其全部内容作为整体并入本申请中。
技术领域
本发明实施例涉及信息处理技术,尤其涉及一种数据访问方法和装置。
背景技术
随着计算机技术的不断发展,越来越多的信息都是以数字化的形式存储于各种数据库中,因此,各类信息管理系统也营运而生。例如:XX学校建立为了维护学生信息所建立的学生信息管理系统,或者XX移动销售公司为了统计和维护销售产品所建立的移动销售信息管理系统等。一般来说,这类管理系统主要包括客户端软件以及存储数据库的后台服务器。
其中,在图1中示出了一种学生信息管理系统的客户端软件的人机交互示意图。如图1所示,如果一个学生信息管理系统的操作用户需要进行学生信息的查询或者修改时,可以通过该客户端软件发送数据访问请求,后台数据库在接收到数据访问请求后,通过对数据库中的内容进行操作,进而向相应的客户端软件返回与该数据访问请求对应的结果数据。
在现有技术中,在搭建上述信息管理系统的过程中,由于前台客户端(一般包括Web客户端以及移动App客户端)以及后台服务器一般使用不同的计算机技术,因此一般由不同技能的开发人员分工完成。主要的系统建设流程包括:客户端开发人员设计业务对象以及所需要的服务, 服务器端根据客户端提供的需求,人工编写访问服务代码,最后通过客户端以及服务器接口的设计确认以及联调,最终实现系统的建立。
现有技术的主要缺陷在于,前后台接口缺少统一接口规范,服务器端针对需要相似功能的客户端,也需要重复编写服务器端代码,也即,后台器服务缺少通用实现而无法复用,进而为后台服务器开发人员带来了大量的重复性工作量。
发明内容
有鉴于此,本发明实施例提供一种数据访问方法和装置,以优化现有的基于数据库的数据访问系统的建立流程,大大减少数据访问系统开发人员的重复性工作量。
在第一方面,本发明实施例提供了一种数据访问方法,包括:
基于设定数据访问接口接收客户端发送的数据访问请求,所述数据访问请求包括:与客户端所递交表单的表单项名称对应的业务对象属性、预设间隔符以及针对业务对象属性的操作符、名值对连接符、以及与表单项输入值对应的由用户输入的目标属性或数值;
从所接收的数据访问请求中解析出业务对象属性、操作符和目标属性或数值;
基于所解析出的业务对象属性、操作符和目标属性或数值,按照与所述设定数据访问接口对应的业务对象访问方法,执行相应数据访问操作;以及
将访问结果返回给所述客户端。
在第二方面,本发明实施例还提供了一种数据访问方法,包括:
向服务器的设定数据访问接口发送数据访问请求,其中,所述数据访问请求包括:与所递交表单的表单项名称对应的业务对象属性、预设间隔符以及针对业务对象属性的操作符、名值对连接符、以及与表单项 输入值对应的由用户输入的目标属性或数值;
接收所述服务器返回的与所述数据访问请求对应的数据访问结果;
其中,所述数据访问结果是所述服务器根据基于所解析出的业务对象属性、操作符和目标属性或数值,按照与所述设定数据访问接口对应的业务对象访问方法,执行相应数据访问操作而访问获得的。
在第三方面,本发明实施例提供了一种数据访问装置,配置于服务器中,包括:
访问请求接收模块,用于基于设定数据访问接口接收客户端发送的数据访问请求,所述数据访问请求包括:与客户端所递交表单的表单项名称对应的业务对象属性、预设间隔符以及针对业务对象属性的操作符、名值对连接符、以及与表单项输入值对应的由用户输入的目标属性或数值;
访问请求解析模块,用于从所接收的数据访问请求中解析出业务对象属性、操作符和目标属性或数值;
访问操作执行模块,用于基于所解析出的业务对象属性、操作符和目标属性或数值,按照与所述设定数据访问接口对应的业务对象访问方法,执行相应数据访问操作;以及
访问结果返回模块,用于将访问结果返回给所述客户端。
在第四方面,本发明实施例还提供了一种数据访问装置,配置于客户端中,包括:
访问请求发送模块,用于向服务器的设定数据访问接口发送数据访问请求,其中,所述数据访问请求包括:与所递交表单的表单项名称对应的业务对象属性、预设间隔符以及针对业务对象属性的操作符、名值对连接符、以及与表单项输入值对应的由用户输入的目标属性或数值;
返回结果接收模块,用于接收所述服务器返回的与所述数据访问请求对应的数据访问结果;
其中,所述数据访问结果是所述服务器根据基于所解析出的业务对象属性、操作符和目标属性或数值,按照与所述设定数据访问接口对应的业务对象访问方法,执行相应数据访问操作而访问获得的。
本发明实施例通过控制客户端将所递交表单中的业务对象属性、针对业务对象属性的操作符以及目标属性或数值以名值对的形式发送至服务器,服务器通过识别连接上述参数的特定间隔符以解析上述参数的技术手段,可以实现基于通用性的数据解析方法获取上述参数,并根据接收上述参数的标准化的数据访问接口,生成对应的访问结果的技术效果,优化现有的基于数据库的数据访问系统的建立流程,大大减少了数据访问系统开发人员的重复性工作量。
附图说明
图1是现有技术的一种学生信息管理系统的客户端软件的人机交互示意图;
图2是本发明第一实施例的一种数据访问方法的流程图;
图3是本发明第二实施例的一种数据访问方法的流程图;
图4是本发明第三实施例的一种数据访问方法的流程图;
图5是本发明第四实施例的一种数据访问方法的流程图;
图6a是基于本发明实施例的一种后台服务器的实现框架图;
图6b是现有技术与本发明实施例中的数据访问系统的搭建流程对比图;
图7是本发明第七实施例的一种数据访问装置的结构图;
图8是本发明第八实施例的一种数据访问装置的结构图;
图9示出了适于用来实现本申请实施例的终端设备或服务器的计算机系统的结构示意图。
具体实施方式
为了使本发明的目的、技术方案和优点更加清楚,下面结合附图对本发明具体实施例作进一步的详细描述。可以理解的是,此处所描述的具体实施例仅仅用于解释本发明,而非对本发明的限定。
另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部内容。在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各项操作(或步骤)描述成顺序的处理,但是其中的许多操作可以被并行地、并发地或者同时实施。此外,各项操作的顺序可以被重新安排。当其操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。
为了便于后续说明,首先对本方案的发明构思进行简单介绍:
一般来说,对于通过前台的WEB客户端或移动App客户端访问后台数据服务器的系统来说,客户端主要通过HTTP(HyperText Transfer Protocol,超文本传输协议)的GET命令或POST命令传递form表单数据给后台数据服务器,其中,所述form表单中包括有多个名值对(name-value)列表,后台数据服务器通过解析名值对列表中的命令和数据,完成数据访问或业务操作,返回结果数据或页面给客户端;
其中,form表单是数据传输过程中的底层数据,这种形式的传输对数据组织缺乏管理,形式十分原始。为了便于后续的数据处理,客户端的开发人员还可以在向后台数据服务器传递数据之前,首先将form表单数据转化为JSON对象的格式(典型的,通过封装或者打包的方式),即:将form表单里的所有数据转化的具有一定规范的JSON对象格式的数据(标准化的名值对格式数据),然后传输到后台数据服务器,后台数据服 务器接收到的数据是直接可以使用的合格JSON代码。
例如:一个典型的form表单格式的数据为:
<form enctype='application/json'>
<input name='name'value='Bender'>
<select name='hind'>
<option selected>Bitable</option>
<option>Kickable</option>
</select>
<input type='checkbox'name='shiny'checked>
</form>
将其转化后的JSON对象格式的数据为:
{
"name":"Bender"
,"hind":"Bitable"
,"shiny":true
}
然而,不管客户端发送的是上述哪种形式的数据,服务器端的开发人员都要根据与客户端开发人员的编程约定,从接收的数据的设定位置或者按照设定的数据解析方式,从客户端发送的数据中解析出基于业务对象属性(也可称为字段)的基本操作指令,输出至与该业务对象对应的数据处理接口(URI地址)中进行处理。例如,针对一条在字段名为“name”的数据记录中,模糊匹配字段值为“张三”的数据的基本操作指令,服务器需要根据约定,从接收到的form表单或者JSON对象所对应的名值对数据中,依次提取出属性名:“name”、针对属性名的操作类型:“模糊匹配”以及属性值:“张三”。
显然,现有技术的主要缺陷在于,前后台接口缺少规范,后台服务缺少通用实现而无法复用,同时,如果客户端产生需求变更(增加按性别查询功能),需要服务器端同步修改代码以适应客户端的修改。
通过研究发现:不论客户端发送的是form表单类型的数据,还是 JSON对象类型的数据,其本质均是要发送名值对形式的数据,差别在于,两者通过不同的名值对连接符相连,form表单类型的名值对通过“=”相连,例如:“input name='name'”,JSON对象类型的名值对通过“:”相连,例如:“"name":"Bender"”。如果可以将一个如前所述的基本操作指令以名值对的形式来表示,服务器端不论客户端发送何种形式的数据,均可通过对名值对的简单解析,获取所述的数据和指令。
为了实现上述方案需要克服的技术难点是:一个如前所述的基本操作指令需要包括三个参数(属性名:“name”、针对属性名的操作类型:“模糊匹配”以及属性值:“张三”),或者说需要使用三元组数据表示,而名值对的数据形式为二元组数据形式,如果不经过处理,无法使用该名值对表示该基本操作指令。基于此,发明人创造性的提出,将基本操作指令中的业务对象属性以及针对业务对象属性的操作符通过一个个性化的间隔符连接后,作为名值对中的第一数据,将属性值作为名值对中的第二数据,这样既可巧妙的使用二元组形式的名值对来表示包括有三个参数的基本操作指令。
基于上述操作命令的构成规则可以成功地把一个操作命令三元组转换为符合赋值语法的二元组,例如age+1转换为age$inc=1(inc表示“+”命令符号)。这种转换方式极大地简化了属性操作命令的表示方法,与form表单以及移动App界面元素保持整齐一致,在不增加现有开发技术复杂性前提下,大幅度提高前后台接口标准化程度和服务自动化处理能力,也即本发明的核心发明点。
第一实施例
图2为本发明第一实施例提供的一种数据访问方法的流程图,本实施例的方法可以由数据访问装置来执行,该装置可通过硬件和/或软件的方式实现,并一般可集成于服务器中,且本实施例的方法一般可适用于 服务器根据客户端的数据访问请求,查询本地存储的数据库并返回相应的访问结果的情形。本实施例的方法具体包括:
210、基于设定数据访问接口接收客户端发送的数据访问请求。
在本实施例中,前端客户端的开发人员根据form表单的不同功能将不同form表单的action属性设置为与后台服务器的数据访问接口对应的URI(Uniform Resource Identifie,统一资源标识符)地址。其中,form表单的action属性用于指明当提交表单时,向何处发送表单数据。
在上述设置完成后,当客户端用户在本地递交与访问内容对应的form表单时,与所述form表单对应的数据访问请求会自动发送至所述form表单的action属性所设置的服务器的设定数据访问接口。
在本实施例中,所述数据访问请求可以为预设表单格式的数据,也可以为JSON对象格式的数据,本实施例对此并不进行限制。
其中,如果数据访问请求为JSON对象格式的数据,则在客户端用户递交form表单后,将该form表单封装为JSON对象格式的数据后,作为数据访问请求进行发送。
典型的,所述数据访问请求为HTTP GET命令或POST命令形式的内容。
在本实施例中,所述数据访问请求包括:与客户端所递交表单的表单项名称对应的业务对象属性、预设间隔符以及针对业务对象属性的操作符、名值对连接符、以及与表单项输入值对应的由用户输入的目标属性或数值。
如前所述,为了把一个操作命令三元组转换为符合赋值语法的二元组,客户端在设置某一目标表单项名称(也称为表单的name属性)时,需要将业务对象属性以及针对业务对象属性的操作符通过一个预设间隔符相连后的整体作为表单项名称。在用户递交该目标表单后,会相应生成包括所述目标表单项名称以及通过该目标表单的表单项输入值(也即 表单的value属性)获取的由用户输入的目标属性或数值构成的名值对,该名值对通过名值对连接符相连。
典型的,如果所述数据访问请求为预设表单格式的数据,名值对连接符可以为“=”;如果所述数据访问请求为JSON对象格式的数据,名值对连接符可以为“:”。
其中,在选取该预设间隔符时,也需要仔细考量,要求由该预设间隔符构成的表单项名称既要满足变量名称规范、足够简单易用,并足够特殊以保证不与业务对象属性的名称混淆。
发明人通过仔细甄选,确定所述预设间隔符优选可以为:“$”、“$$”或“_”。当然本领域技术人员可以理解的是,该预设间隔符还可以基于上述选取原则选取为其他形式的符号,本实施例对此并不进行限制。
其中,与客户端所递交表单的表单项名称对应的业务对象属性具体可以指用户所访问的业务对象的字段名称,例如,名为“student”的业务对象(或者说数据记录)中,包括有“name”、“age”以及“sex”字段,上述字段的字段名称为所述业务对象属性。针对业务对象属性的操作符具体是指针对该字段名称对应的字段值所执行的相关操作,而与表单项输入值对应的由用户输入的目标属性或数值具体是指与该业务对象属性的操作符关联的操作属性或者操作数值。
在一个具体例子中,如果一个表单项名称设置为age$inc,可以确定与该表单对应的业务对象属性为“age”,针对业务对象属性的操作符为“+”,用户输入的操作数值为“1”,发送给后台服务的操作命令为age$inc=1,该操作命令对应于将age字段中的字段值+1。
220、从所接收的数据访问请求中解析出业务对象属性、操作符和目标属性或数值。
如前所述,业务对象属性、操作符和目标属性或数值这三者通过预设间隔符以及名值对连接符依次相连。因此,在本实施例的一个优选的 实施方式中,可以通过关键词匹配的方式,首先识别出所述数据访问请求中包括的预设间隔符以及名值对连接符,进而可以获取业务对象属性、操作符和目标属性或数值;
在本实施例的另一个优选的实施方式中,由于所述业务对象属性、操作符和目标属性或数值相对于所述预设间隔符的位置固定,因此可以首先识别出所述数据访问请求中包括的预设间隔符,之后根据所述业务对象属性、操作符和目标属性或数值与所述预设间隔符之间的相对位置关系,解析出业务对象属性、操作符和目标属性或数值。
更一般的,设定数据访问接口在接收到数据访问请求之后,后台基础服务框架(典型的,Java下tomcat应用服务)首先将数据访问请求解析为名值对形式的二元组数据,即,可以直接解析出目标属性或数值,之后通过在与表单项名称对应的数据中识别预定分隔符,进而可以分别获取所述业务对象属性以及操作符。
230、基于所解析出的业务对象属性、操作符和目标属性或数值,按照与所述设定数据访问接口对应的业务对象访问方法,执行相应数据访问操作。
在本实施例中,服务器中不同的URI地址对应于不同业务对象的数据访问接口,可以基于本地存储的数据库中的数据按照不同的业务对象访问方法(典型的,增、删、改以及查),执行相应数据访问操作。
在将所解析出的业务对象属性、操作符和目标属性或数值输入至所述设定数据访问接口后,该接口会按照对应的业务对象访问方法,执行相应数据访问操作。
在本实施例的一个优选的实施方式中,服务器为每个业务对象提供完全相同的一组功能完整的统一业务对象访问方法,对外发布的接口优选采用Restful Web Service技术实现。
客户端优选采用HTTP GET命令发送数据访问请求,以便最大限度保持兼容性,便于直接在原生浏览器上实现后台服务的测试、调试、运维操作。
240、将访问结果返回给所述客户端。
一般情况下,服务器针对客户端的数据访问请求可以产生对应的返回结果,也可以不产生任何返回结果(例如,仅在服务器中的数据库中添加或者删除相应的数据信息),在本实施例的优选实施方式中,针对所述客户端发送的数据访问请求,所述服务器均产生一个访问结果,用于客户端的解析以及展示。
优选的,所述返回结果为JSON对象格式的数据,该返回结果的内容可以包括成功标志、失败信息及正确的结果数据等。
本发明实施例通过控制客户端将所递交表单中的业务对象属性、针对业务对象属性的操作符以及目标属性或数值以名值对的形式发送至服务器,服务器通过识别连接上述参数的特定间隔符以解析上述参数的技术手段,可以实现基于通用性的数据解析方法获取上述参数,并根据接收上述参数的标准化的数据访问接口,生成对应的访问结果的技术效果,优化现有的基于数据库的数据访问系统的建立流程,大大减少了数据访问系统开发人员的重复性工作量。
在现有技术中,还具有一个明显的技术问题:在客户端的服务需求发生变更时,服务器端的开发人员需要同步调整对应的访问服务代码,此外,接口的设计确认、需求变更修改以及联调,会使客户端以及服务器端的开发人员产生大量的沟通管理工作量。
基于上述技术问题,在本实施例的一个优选的实施方式中,可以由服务器端的开发人员设计标准操作符集以及标准访问方法集,并将该准操作符集以及标准访问方法集提供给客户端的开发人员。使得客户端的开发人员使用服务器预先定义的标准操作符以及标准访问方法编写客户 端代码,进而可以实现服务器端代码仅经过一些设定的数据变换处理后,即可实现在与不同客户端对应的不同服务器中进行复用。
其中,所述标准操作符集中定义了可以满足客户端开发人员基本需求的操作符。在表1中示出了一种标准操作符集的示意表。
表1
Figure PCTCN2016087452-appb-000001
其中,所述标准访问方法集中定义了与服务器中不同数据访问接口对应的URI地址,不同的URI地址使用不同的业务对象访问方法,执行相应数据访问操作。客户端的开发人员根据前端所需调用的数据处理,在所述标准访问方法集中获取相应的URI地址,以使服务器执行相应数据访问功能。在表2中示出了一种标准访问方法集的示意表。其中,beanPath对应于不同的业务对象。
表2
Figure PCTCN2016087452-appb-000002
相应的,在上述各实施例的基础上,所述数据访问接口由与客户端所递交表单的action属性对应的标准URI地址确定,所述标准URI地址对应于相应业务对象以及标准访问方法集中的标准访问方法。以实现对服务器端代码的复用。
第二实施例
图3是本发明第二实施例的一种数据访问方法的流程图。本实施例以上述各实施例为基础进行优化,在本实施例中,将所述数据访问请求优化为预设表单格式的数据,其中,所述名值对连接符为在所述表单格式下用于连接所述表单项名称以及所述表单项输入值的连接符。
同时,将从所接收的数据访问请求中解析出业务对象属性、操作符和目标属性或数值优化为:通过后台基础框架服务,将所述数据访问请求转化为与所述表单项名称以及与所述表单项输入值分别对应的二元组数据,解析出所述目标属性或数值;在与所述表单项名称对应的第一数据中识别所述预设间隔符;根据所述预设间隔符在所述第一数据中的位置,解析出所述业务对象属性以及所述操作符。
相应的,本实施例的方法具体包括:
310、基于设定数据访问接口接收客户端发送的预设表单格式的数据访问请求。
在本实施例中,所述数据访问请求具体为预设表单格式的数据。
相应的,所述数据访问请求包括:与客户端所递交表单的表单项名称对应的业务对象属性、预设间隔符以及针对业务对象属性的操作符、名值对连接符、以及与表单项输入值对应的由用户输入的目标属性或数值。
其中,所述名值对连接符为在所述表单格式下用于连接所述表单项名称以及所述表单项输入值的连接符,典型的,所述名值对连接符具体为“=”。
在本实施例的一个优选的实施方式中,服务器端的开发人员针对不同的业务对象以及所应用的标准访问方法定义不同的URI地址,业务对象属性与针对对象属性的操作符构成的操作命令作为URI的参数(GET或POST),一个基本的HTTP GET命令形式是数据访问请求为http://.../{业务对象名称}/{标准命令}?{业务对象属性}${操作}={目标属性或数值}&…。320、通过后台基础框架服务,将所述数据访问请求转化为与所述表单项名称以及与所述表单项输入值分别对应的二元组数据。
330、在与所述表单项名称对应的第一数据中识别所述预设间隔符。
340、根据所述预设间隔符在所述第一数据中的位置,解析出所述业务对象属性以及所述操作符。
在一个具体的例子中,如果客户端发送的数据访问请求中包括“name$like=张三”形式的数据,后台基础服务框架会自动将该数据转化为(name$like,张三)二元组,之后通过在name$like中识别“$”,可以最终解析出(name,like,张三),进而简单的获取到对象属性、操作符和目标属性或数值。
需要再次强调的是:与现有的开发方法相比,本发明实施例仅仅增加了解析name$like的部分的工作,在不改变传统开发方法和降低传统开发的能力的前提下,加强了前后台的接口规范,实现对服务器端代码的复用。对于特殊的需要定制实现的程序逻辑,可以不解析name$like而直接视其为一个标准的变量,使用开发语言(典型的,java或javascript语言)实现私有定制程序逻辑。
350、基于所解析出的业务对象属性、操作符和目标属性或数值,按照与所述设定数据访问接口对应的业务对象访问方法,执行相应数据访问操作。
360、将访问结果返回给所述客户端。
本实施例的技术方案通过基于设定数据访问接口接收客户端发送的预设表单格式的数据访问请求从所接收的数据访问请求中识别所述预设间隔符,根据所述操作符所在的位置,识别所述名值对连接符,根据所述名值对连接符所在的位置,解析出所述目标属性或数值的技术手段,可以实现基于通用性的数据解析方法获取上述参数,并根据接收上述参数的标准化的数据访问接口,生成对应的访问结果的技术效果。
特别的,客户端的开发人员需要临时修改或者调试客户端程序代码时,如果客户端软件无法打开,该开发人员需要手动在原生浏览器中输入与数据访问请求对应的HTTP GET命令,而表单形式的数据访问请求对格式要求较严格,直接输入不便,通过使用本实施例的方法,客户端开发人员可以简单直接的基于业务对象属性、操作符和目标属性或数值构造HTTP GET命令并发送给服务器,大大方便了开发人员编程以及调试的便利性。
第三实施例
图4是本发明第三实施例的一种数据访问方法的流程图。本实施例以第一实施例为基础进行优化,在本实施例中,将所述数据访问请求优化为JSON对象格式的数据。
相应的,本实施例的方法具体包括:
410、基于设定数据访问接口接收客户端发送的JSON对象格式的数据访问请求。
在本实施例中,所述数据访问请求为JSON对象格式的数据,所述JSON对象通过表单格式的数据封装生成。
其中,所述JSON对象的名称对应于所述表单格式的数据中的表单项名称,所述JSON对象的值对对应于所述表单格式的数据中的表单项输入值,所述名值对连接符为在所述JSON对象格式下用于连接所述JSON对象的名称以及所述JSON对象的值对的连接符,所述名值对连接符具体为“:”。
相应的,所述数据访问请求包括:与客户端所递交表单的表单项名称对应的业务对象属性、预设间隔符以及针对业务对象属性的操作符、名值对连接符、以及与表单项输入值对应的由用户输入的目标属性或数值;
420、从所接收的数据访问请求中解析出业务对象属性、操作符和目标属性或数值。
如前所述,在现有的公共框架服务中,可以自动解析出JSON对象,本实施例的方法主要通过识别预设间隔符的方式,解析出所述业务对象属性以及所述操作符。
430、基于所解析出的业务对象属性、操作符和目标属性或数值,按照与所述设定数据访问接口对应的业务对象访问方法,执行相应数据访问操作。
440、将JSON对象形式的访问结果返回给所述客户端。
本实施例的技术方案,通过基于设定数据访问接口接收客户端发送的JSON对象格式的数据访问请求并根据识别出的预设间隔符的位置,从所接收的数据访问请求中解析出业务对象属性、操作符和目标属性或数值的技术手段,可以实现基于通用性的数据解析方法获取上述参数,并根据接收上述参数的标准化的数据访问接口,生成对应的访问结果的 技术效果,优化现有的基于数据库的数据访问系统的建立流程,大大减少了数据访问系统开发人员的工作量。
第四实施例
图5为本发明第四实施例提供的一种数据访问方法的流程图,本实施例的方法可以由数据访问装置来执行,该装置可通过硬件和/或软件的方式实现,并一般可集成于客户端中,且本实施的方法一般可适用于客户端向服务器发送数据访问请求,接收所述服务器返回的访问结果的情形。本实施例的方法具体包括:
510、向服务器的设定数据访问接口发送数据访问请求。
在本实施例中,所述数据访问请求包括:与所递交表单的表单项名称对应的业务对象属性、预设间隔符以及针对业务对象属性的操作符、名值对连接符、以及与表单项输入值对应的由用户输入的目标属性或数值。
在本实施例中,客户端通过将所述递交表单的name属性(也即表单项名称)配置为业务对象属性、预设间隔符以及针对业务对象属性的操作符,并将与所递交表单的表单项输入值对应的由用户输入的目标属性或数值作为所述表单的value属性,即可生成所述的数据访问请求。
在本实施例中,通过将所递交表单的action属性配置为与服务器的设定数据访问接口对应的URI地址,即可实现向服务器的设定数据访问接口发送数据访问请求。
优选的,所述数据访问请求中包括的针对业务对象属性的操作符以及与服务器的设定数据访问接口对应的URI地址为所述服务器端提供的标准操作符集以及标准业务对象操作方法集中的元素,以使服务器可以采用通用性的数据解析方法来获取上述参数,并根据接收上述参数的标准化的数据访问接口,生成对应的访问结果的技术效果
520、接收所述服务器返回的与所述数据访问请求对应的数据访问结果。
其中,所述数据访问结果是所述服务器根据基于所解析出的业务对象属性、操作符和目标属性或数值,按照与所述设定数据访问接口对应的业务对象访问方法,执行相应数据访问操作而访问获得的。
本发明实施例通过控制客户端将所递交表单中的业务对象属性、针对业务对象属性的操作符以及目标属性或数值以名值对的形式发送至服务器,服务器通过识别连接上述参数的特定间隔符以解析上述参数的技术手段,优化了现有的基于数据库的数据访问系统的建立流程,大大减少了数据访问系统开发人员的工作量。
在上述各实施例的基础上,向服务器的设定数据访问接口发送数据访问请求可以包括:
根据用户发送的表单提交请求,生成所述数据访问请求;
根据与所递交表单的action属性对应的标准URI地址,确定所述服务器中响应所述数据访问请求的数据访问接口;其中,所述标准URI地址对应于相应业务对象以及标准访问方法集中的标准访问方法;
向与所述标准URI对应的所述设定数据访问接口发送所述数据访问请求。
在上述各实施例的基础上,向服务器的设定数据访问接口发送数据访问请求还可以包括:
根据用户发送的表单提交请求,获取表单格式的递交数据;
将所述表单格式的递交数据封装为JSON对象,并将所述JSON对象作为所述数据访问请求;
根据与所递交表单的action属性对应的标准URI地址,确定所述服务器中响应所述数据访问请求的数据访问接口;其中,所述标准URI地址对应于相应业务对象以及标准访问方法集中的标准访问方法;
向与所述标准URI对应的所述设定数据访问接口发送所述数据访问请求。
在图6a中示出了基于本发明实施例的一种后台服务器的实现框架图,结合图6a,对用于实施本发明实施例的客户端以及服务器交互性的完成的一个典型的数据访问过程进行描述如下:
前端(或者说客户端)数据录入:WEB端或移动App端通过数据表单录入要处理的数据,输入完成后提交给与后台服务器对应的URI地址,每个URI地址对应一个业务对象访问方法。WEB表单基本设计方法是把表单项名称设置为{业务对象属性}${操作符号}的形式,表单项输入值由表单的value属性获得。
因此,WEB表单提交动作就自动构成一系列基本操作命令三元组{业务对象属性}${操作符号}={目标属性或数值}到后台服务器中相应的URI地址。如果前端使用javascript或App构造json对象提交到后端服务,仍然可以使用本发明的三元组表示法,这一切得益于{业务对象属性}${操作符号}是一个合法的javascript和Java变量名。
后台服务(或者说服务器)处理:后台服务器接收到前端传递过来的标准化格式参数后,解析操作命令,访问及操作对应的后台数据。基本规则是业务对象属性对应数据库对象的字段,针对业务对象属性的操作符指定相应字段的操作方法,逻辑操作符查询定位数据,设置操作符更新数据,以及一些通用访问处理操作符,如分页、排序、分组聚合计算等。后台服务最终通过访问数据库处理完成相应请求后返回相应的请求结果以及请求状态,若有错误发生返回错误码及对应的错误信息,返回结果通常以Json对象格式表示。
前端处理结果展示:前端接收后台服务返回的结果,首先解析是否有错误发生,若有错误则提示用户进行错误处理,若没有错误则显示返回信息供用户下一步处理。
以一个通过姓名和性别查询人员的WEB页面为例。设置WEB表单姓名输入框<input>标签name属性为name$like(对名称属性进行模糊查询),性别下拉框<select>标签name属性为gender$eq(对性别属性判等查询)。控制分页每页100显示第1页,可以增加隐藏<hidden>标签name属性为$pageSize和value属性为100,增加隐藏<hidden>标签name属性为$pageNo和value属性为1。
当用户没有输入任何内容时候,查询所有人员记录,增加隐藏<hidden>标签name属性为$ignoreEmpty和value属性为true。WEB表单的action属性设置为对应的通用查询服务接口“http://…/person/list”。
这样当用户提交数据访问请求后,对应后台服务器方法解析传入参数,执行相应数据访问操作,返回数据访问结果,WEB页面展示结果内容。由于后台服务不再需要人工开发,前后端接口也不需双方商量确认,服务接口非常具有弹性能适用绝大部分场景,例如增加身高的区间查询条件只是增加两个name属性为height$gt和height$lt的两个<input>标签即可,完全不需要修改后台服务器中的代码内容。
基于上述实例的分析,在图6b是现有技术与本发明实施例中的数据访问系统的搭建流程对比图,通过对比可知,本发明实施例的方法对于一般性互联网环境下后台数据服务访问(如移动销售系统、工单管理系统等),可以使用工具直接生成后台服务器代码。主要原因针对一般性互联网环境下后台数据服务访问来说,客户端需要的业务对象访问方法以及针对业务对象属性的操作方法比较相似,通过编写一套统一的后台服务器代码的方式,即可满足不同客户端的使用需求,也即实现了后台服务器代码的复用。
如图6b所示,现有技术需要人工编码实现后台服务,本发明实施例的方法直接使用工具生成,对于工具代码生成不能满足的功能,可以通过人工扩展或重新开发完成。发明人通过研究测试发现:工具生成的统一的通用后台服务代码,建立在精心设计统一的操作符号和操作方法之上,具有非常好的灵活性和可靠性,且经过了严密的功能及性能测试,足以满足信息操作类管理系统70%以上需求,信息检索95%以上需求,大幅提高研发效率和产品质量,整体数据访问类应用系统研发效率提升50%左右。在大大节约人力成本的基础上,有效提升了系统研发效率。
第五实施例
在图7中示出了本发明第五实施例的一种数据访问装置的结构图,所述数据访问装置配置于服务器中,如图7所示,所述装置包括:访问请求接收模块71、访问请求解析模块72、访问操作执行模块73以及访问结果返回模块74。其中:
访问请求接收模块71,用于基于设定数据访问接口接收客户端发送的数据访问请求,所述数据访问请求包括:与客户端所递交表单的表单项名称对应的业务对象属性、预设间隔符以及针对业务对象属性的操作符、名值对连接符、以及与表单项输入值对应的由用户输入的目标属性或数值;
访问请求解析模块72,用于从所接收的数据访问请求中解析出业务对象属性、操作符和目标属性或数值;
访问操作执行模块73,用于基于所解析出的业务对象属性、操作符和目标属性或数值,按照与所述设定数据访问接口对应的业务对象访问方法,执行相应数据访问操作;以及
访问结果返回模块74,用于将访问结果返回给所述客户端。
本发明实施例通过控制客户端将所递交表单中的业务对象属性、针对业务对象属性的操作符以及目标属性或数值以名值对的形式发送至服务器,服务器通过识别连接上述参数的特定间隔符以解析上述参数的技术手段,可以实现基于通用性的数据解析方法获取上述参数,并根据接收上述参数的标准化的数据访问接口,生成对应的访问结果的技术效果,优化现有的基于数据库的数据访问系统的建立流程,大大减少了数据访问系统开发人员的工作量。
在上述各实施例的基础上,所述数据访问请求可以为预设表单格式的数据,其中,所述名值对连接符为在所述表单格式下用于连接所述表单项名称以及所述表单项输入值的连接符。
在上述各实施例的基础上,所述数据访问请求可以为JSON对象格式的数据,其中,所述JSON对象通过表单格式的数据封装生成;
所述JSON对象的名称对应于所述表单格式的数据中的表单项名称,所述JSON对象的值对对应于所述表单格式的数据中的表单项输入值,所述名值对连接符为在所述JSON对象格式下用于连接所述JSON对象的名称以及所述JSON对象的值对的连接符。
在上述各实施例的基础上,所述预设间隔符可以为$、$$或_。
本发明实施例所提供的数据访问装置可用于执行本发明实施例一至实施例三提供的数据访问方法,具备相应的功能模块,实现相同的有益效果。
第六实施例
在图8中示出了本发明第六实施例的一种数据访问装置的结构图,所述数据访问装置配置于客户端中,如图8所示,所述装置包括:访问 请求发送模块81以及返回结果接收模块82。其中:
访问请求发送模块81,用于向服务器的设定数据访问接口发送数据访问请求,其中,所述数据访问请求包括:与所递交表单的表单项名称对应的业务对象属性、预设间隔符以及针对业务对象属性的操作符、名值对连接符、以及与表单项输入值对应的由用户输入的目标属性或数值;
返回结果接收模块82,用于接收所述服务器返回的与所述数据访问请求对应的数据访问结果;
其中,所述数据访问结果是所述服务器根据基于所解析出的业务对象属性、操作符和目标属性或数值,按照与所述设定数据访问接口对应的业务对象访问方法,执行相应数据访问操作而访问获得的。
本发明实施例通过控制客户端将所递交表单中的业务对象属性、针对业务对象属性的操作符以及目标属性或数值以名值对的形式发送至服务器,服务器通过识别连接上述参数的特定间隔符以解析上述参数的技术手段,优化了现有的基于数据库的数据访问系统的建立流程,大大减少了数据访问系统开发人员的工作量。
本发明实施例所提供的数据访问装置可用于执行本发明实施例四提供的数据访问方法,具备相应的功能模块,实现相同的有益效果。
显然,本领域技术人员应该明白,上述的本发明的各模块或各步骤可以通过如上所述的服务器以及客户端来配合实施。可选地,本发明实施例可以用计算机装置可执行的程序来实现,从而可以将它们存储在存储装置中由处理器来执行,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等;或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬 件和软件的结合。
图9示出了适于用来实现本申请实施例的终端设备或服务器的计算机系统的结构示意图。
如图9所示,计算机系统900包括中央处理单元(CPU)901,其可以根据存储在只读存储器(ROM)902中的程序或者从存储部分908加载到随机访问存储器(RAM)903中的程序而执行各种适当的动作和处理。在RAM 903中,还存储有系统900操作所需的各种程序和数据。CPU901、ROM 902以及RAM903通过总线904彼此相连。输入/输出(I/O)接口905也连接至总线904。
以下部件连接至I/O接口905:包括键盘、鼠标等的输入部分906;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分907;包括硬盘等的存储部分908;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分909。通信部分909经由诸如因特网的网络执行通信处理。驱动器910也根据需要连接至I/O接口905。可拆卸介质911,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器910上,以便于从其上读出的计算机程序根据需要被安装入存储部分908。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括有形地包含在机器可读介质上的计算机程序,所述计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分909从网络上被下载和安装,和/或从可拆卸介质911被安装。
附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部 分,所述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
作为另一方面,本申请还提供了一种非易失性计算机存储介质,该非易失性计算机存储介质可以是上述实施例中所述装置中所包含的非易失性计算机存储介质;也可以是单独存在,未装配入终端中的非易失性计算机存储介质。上述非易失性计算机存储介质存储有一个或者多个程序,当所述一个或者多个程序被一个设备执行时,使得所述设备:基于设定数据访问接口接收客户端发送的数据访问请求,所述数据访问请求包括:与客户端所递交表单的表单项名称对应的业务对象属性、预设间隔符以及针对业务对象属性的操作符、名值对连接符、以及与表单项输入值对应的由用户输入的目标属性或数值;从所接收的数据访问请求中解析出业务对象属性、操作符和目标属性或数值;基于所解析出的业务对象属性、操作符和目标属性或数值,按照与所述设定数据访问接口对应的业务对象访问方法,执行相应数据访问操作;以及将访问结果返回给所述客户端。或者,上述非易失性计算机存储介质存储有一个或者多个程序,当所述一个或者多个程序被一个设备执行时,使得所述设备:向服务器的设定数据访问接口发送数据访问请求,其中,所述数据访问请求包括:与所递交表单的表单项名称对应的业务对象属性、预设间隔符以及针对业务对象属性的操作符、名值对连接符、以及与表单项输入值对应的由用户输入的目标属性或数值;接收所述服务器返回的与所述 数据访问请求对应的数据访问结果;其中,所述数据访问结果是所述服务器根据基于所解析出的业务对象属性、操作符和目标属性或数值,按照与所述设定数据访问接口对应的业务对象访问方法,执行相应数据访问操作而访问获得的。
以上所述仅为本发明的优选实施例,并不用于限制本发明,对于本领域技术人员而言,本发明可以有各种改动和变化。凡在本发明的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (19)

  1. 一种数据访问方法,其特征在于,包括:
    基于设定数据访问接口接收客户端发送的数据访问请求,所述数据访问请求包括:与客户端所递交表单的表单项名称对应的业务对象属性、预设间隔符以及针对业务对象属性的操作符、名值对连接符、以及与表单项输入值对应的由用户输入的目标属性或数值;
    从所接收的数据访问请求中解析出业务对象属性、操作符和目标属性或数值;
    基于所解析出的业务对象属性、操作符和目标属性或数值,按照与所述设定数据访问接口对应的业务对象访问方法,执行相应数据访问操作;以及
    将访问结果返回给所述客户端。
  2. 根据权利要求1所述的方法,其特征在于,所述数据访问请求为预设表单格式的数据,其中,所述名值对连接符为在所述表单格式下用于连接所述表单项名称以及所述表单项输入值的连接符。
  3. 根据权利要求1所述的方法,其特征在于,所述数据访问请求为JSON对象格式的数据,其中,所述JSON对象通过表单格式的数据封装生成;
    所述JSON对象的名称对应于所述表单格式的数据中的表单项名称,所述JSON对象的值对对应于所述表单格式的数据中的表单项输入值,所述名值对连接符为在所述JSON对象格式下用于连接所述JSON对象的 名称以及所述JSON对象的值对的连接符。
  4. 根据权利要求1所述的方法,其特征在于,所述预设间隔符为$、$$或_。
  5. 根据权利要求2或3所述的方法,其特征在于,从所接收的数据访问请求中解析出业务对象属性、操作符和目标属性或数值包括:
    通过后台基础框架服务,将所述数据访问请求转化为与所述表单项名称以及与所述表单项输入值分别对应的二元组数据;
    在与所述表单项名称对应的第一数据中识别所述预设间隔符;
    根据所述预设间隔符在所述第一数据中的位置,解析出所述业务对象属性以及所述操作符。
  6. 根据权利要求1所述的方法,其特征在于,所述设定数据访问接口通过
    Restful Web Service技术实现。
  7. 根据权利要求1所述的方法,其特征在于,所述访问结果采用JSON格式。
  8. 根据权利要求2或3所述的方法,其特征在于,所述数据访问接口由与客户端所递交表单的action属性对应的标准URI地址确定,所述标准URI地址对应于相应业务对象以及标准访问方法集中的标准访问方 法。
  9. 一种数据访问方法,其特征在于,包括:
    向服务器的设定数据访问接口发送数据访问请求,其中,所述数据访问请求包括:与所递交表单的表单项名称对应的业务对象属性、预设间隔符以及针对业务对象属性的操作符、名值对连接符、以及与表单项输入值对应的由用户输入的目标属性或数值;
    接收所述服务器返回的与所述数据访问请求对应的数据访问结果;
    其中,所述数据访问结果是所述服务器根据基于所解析出的业务对象属性、操作符和目标属性或数值,按照与所述设定数据访问接口对应的业务对象访问方法,执行相应数据访问操作而访问获得的。
  10. 根据权利要求9所述的方法,其特征在于,向服务器的设定数据访问接口发送数据访问请求包括:
    根据用户发送的表单提交请求,生成所述数据访问请求;
    根据与所递交表单的action属性对应的标准URI地址,确定所述服务器中响应所述数据访问请求的数据访问接口;其中,所述标准URI地址对应于相应业务对象以及标准访问方法集中的标准访问方法;
    向与所述标准URI对应的所述设定数据访问接口发送所述数据访问请求。
  11. 根据权利要求9所述的方法,其特征在于,向服务器的设定数据访问接口发送数据访问请求包括:
    根据用户发送的表单提交请求,获取表单格式的递交数据;
    将所述表单格式的递交数据封装为JSON对象,并将所述JSON对象作为所述数据访问请求;
    根据与所递交表单的action属性对应的标准URI地址,确定所述服务器中响应所述数据访问请求的数据访问接口;其中,所述标准URI地址对应于相应业务对象以及标准访问方法集中的标准访问方法;
    向与所述标准URI对应的所述设定数据访问接口发送所述数据访问请求。
  12. 一种数据访问装置,其特征在于,包括:
    访问请求接收模块,用于基于设定数据访问接口接收客户端发送的数据访问请求,所述数据访问请求包括:与客户端所递交表单的表单项名称对应的业务对象属性、预设间隔符以及针对业务对象属性的操作符、名值对连接符、以及与表单项输入值对应的由用户输入的目标属性或数值;
    访问请求解析模块,用于从所接收的数据访问请求中解析出业务对象属性、操作符和目标属性或数值;
    访问操作执行模块,用于基于所解析出的业务对象属性、操作符和目标属性或数值,按照与所述设定数据访问接口对应的业务对象访问方法,执行相应数据访问操作;以及
    访问结果返回模块,用于将访问结果返回给所述客户端。
  13. 根据权利要求12所述的装置,其特征在于,所述数据访问请求 为预设表单格式的数据,其中,所述名值对连接符为在所述表单格式下用于连接所述表单项名称以及所述表单项输入值的连接符。
  14. 根据权利要求12所述的装置,其特征在于,所述数据访问请求为JSON对象格式的数据,其中,所述JSON对象通过表单格式的数据封装生成;
    所述JSON对象的名称对应于所述表单格式的数据中的表单项名称,所述JSON对象的值对对应于所述表单格式的数据中的表单项输入值,所述名值对连接符为在所述JSON对象格式下用于连接所述JSON对象的名称以及所述JSON对象的值对的连接符。
  15. 一种数据访问装置,其特征在于,包括:
    访问请求发送模块,用于向服务器的设定数据访问接口发送数据访问请求,其中,所述数据访问请求包括:与所递交表单的表单项名称对应的业务对象属性、预设间隔符以及针对业务对象属性的操作符、名值对连接符、以及与表单项输入值对应的由用户输入的目标属性或数值;
    返回结果接收模块,用于接收所述服务器返回的与所述数据访问请求对应的数据访问结果;
    其中,所述数据访问结果是所述服务器根据基于所解析出的业务对象属性、操作符和目标属性或数值,按照与所述数据访问接口对应的业务对象访问方法,执行相应数据访问操作而访问获得的。
  16. 一种设备,包括:
    处理器;和
    存储器,
    所述存储器中存储有能够被所述处理器执行的计算机可读指令,在所述计算机可读指令被执行时,所述处理器执行数据访问方法,所述方法包括:
    基于设定数据访问接口接收客户端发送的数据访问请求,所述数据访问请求包括:与客户端所递交表单的表单项名称对应的业务对象属性、预设间隔符以及针对业务对象属性的操作符、名值对连接符、以及与表单项输入值对应的由用户输入的目标属性或数值;
    从所接收的数据访问请求中解析出业务对象属性、操作符和目标属性或数值;
    基于所解析出的业务对象属性、操作符和目标属性或数值,按照与所述设定数据访问接口对应的业务对象访问方法,执行相应数据访问操作;以及
    将访问结果返回给所述客户端。
  17. 一种非易失性计算机存储介质,所述计算机存储介质存储有能够被处理器执行的计算机可读指令,当所述计算机可读指令被处理器执行时,所述处理器执行数据访问方法,所述方法包括:
    基于设定数据访问接口接收客户端发送的数据访问请求,所述数据访问请求包括:与客户端所递交表单的表单项名称对应的业务对象属性、预设间隔符以及针对业务对象属性的操作符、名值对连接符、以及与表单项输入值对应的由用户输入的目标属性或数值;
    从所接收的数据访问请求中解析出业务对象属性、操作符和目标属性或数值;
    基于所解析出的业务对象属性、操作符和目标属性或数值,按照与所述设定数据访问接口对应的业务对象访问方法,执行相应数据访问操作;以及
    将访问结果返回给所述客户端。
  18. 一种设备,包括:
    处理器;和
    存储器,
    所述存储器中存储有能够被所述处理器执行的计算机可读指令,在所述计算机可读指令被执行时,所述处理器执行数据访问方法,所述方法包括:
    向服务器的设定数据访问接口发送数据访问请求,其中,所述数据访问请求包括:与所递交表单的表单项名称对应的业务对象属性、预设间隔符以及针对业务对象属性的操作符、名值对连接符、以及与表单项输入值对应的由用户输入的目标属性或数值;
    接收所述服务器返回的与所述数据访问请求对应的数据访问结果;
    其中,所述数据访问结果是所述服务器根据基于所解析出的业务对象属性、操作符和目标属性或数值,按照与所述设定数据访问接口对应的业务对象访问方法,执行相应数据访问操作而访问获得的。
  19. 一种非易失性计算机存储介质,所述计算机存储介质存储有能 够被处理器执行的计算机可读指令,当所述计算机可读指令被处理器执行时,所述处理器执行数据访问方法,所述方法包括:
    向服务器的设定数据访问接口发送数据访问请求,其中,所述数据访问请求包括:与所递交表单的表单项名称对应的业务对象属性、预设间隔符以及针对业务对象属性的操作符、名值对连接符、以及与表单项输入值对应的由用户输入的目标属性或数值;
    接收所述服务器返回的与所述数据访问请求对应的数据访问结果;
    其中,所述数据访问结果是所述服务器根据基于所解析出的业务对象属性、操作符和目标属性或数值,按照与所述设定数据访问接口对应的业务对象访问方法,执行相应数据访问操作而访问获得的。
PCT/CN2016/087452 2016-03-16 2016-06-28 数据访问方法和装置 WO2017156916A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610151390.1 2016-03-16
CN201610151390.1A CN106341444B (zh) 2016-03-16 2016-03-16 数据访问方法和装置

Publications (1)

Publication Number Publication Date
WO2017156916A1 true WO2017156916A1 (zh) 2017-09-21

Family

ID=57826304

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/087452 WO2017156916A1 (zh) 2016-03-16 2016-06-28 数据访问方法和装置

Country Status (2)

Country Link
CN (1) CN106341444B (zh)
WO (1) WO2017156916A1 (zh)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108595625A (zh) * 2018-04-23 2018-09-28 平安科技(深圳)有限公司 Bi工具的运维方法、装置、计算机装置及存储介质
CN109635015A (zh) * 2018-09-30 2019-04-16 阿里巴巴集团控股有限公司 属性数据使用对象的确定方法、装置和服务器
CN110865845A (zh) * 2019-10-28 2020-03-06 福建天泉教育科技有限公司 提高接口访问效率的方法、存储介质
CN113726781A (zh) * 2021-08-31 2021-11-30 平安养老保险股份有限公司 报文信息处理方法、装置、计算机设备及存储介质
CN113760251A (zh) * 2020-11-09 2021-12-07 北京沃东天骏信息技术有限公司 一种基于Vue的表单开发方法和装置
CN114201156A (zh) * 2021-12-10 2022-03-18 北京百度网讯科技有限公司 接入方法、装置、电子设备及计算机存储介质
CN115495398A (zh) * 2022-09-28 2022-12-20 北京亚控科技发展有限公司 接口资源操作方法、装置、电子设备、存储介质及产品
CN117032710A (zh) * 2023-10-08 2023-11-10 思创数码科技股份有限公司 一种流程表单组合拆分方法及系统

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107015802A (zh) * 2017-03-17 2017-08-04 广东蜂助手网络技术股份有限公司 一种通用基础存储框架及存储方法
CN109698842A (zh) * 2017-10-20 2019-04-30 阿里巴巴集团控股有限公司 一种提供数据服务的方法和装置
CN107798098A (zh) * 2017-10-27 2018-03-13 链家网(北京)科技有限公司 一种实现动态接口字段的方法及装置
CN110928867B (zh) * 2018-08-31 2022-09-20 杭州海康威视数字技术股份有限公司 一种数据融合的方法及装置
CN111488371A (zh) * 2020-04-07 2020-08-04 中国人民财产保险股份有限公司 一种数据查询方法和装置

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102968454A (zh) * 2012-10-26 2013-03-13 北京百度网讯科技有限公司 一种用于获取推广对象搜索结果的方法和设备
CN103064876A (zh) * 2012-10-30 2013-04-24 中国标准化研究院 面向地理信息应用的空间数据服务化获取方法

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101355448B (zh) * 2008-09-03 2012-01-11 中兴通讯股份有限公司 上载比较方法和装置
US20100198844A1 (en) * 2009-01-30 2010-08-05 Thales-Raytheon Systems Company, LLC Automatic Code Generation
CN103117872A (zh) * 2012-12-31 2013-05-22 广东东研网络科技股份有限公司 一种提高snmp数据传输效率的方法
US9367289B2 (en) * 2013-03-15 2016-06-14 International Business Machines Corporation Method and apparatus for enabling agile development of services in cloud computing and traditional environments
CN103593403B (zh) * 2013-10-16 2017-12-29 东软集团股份有限公司 一种流程表中业务数据关联方法及系统
CN103677810B (zh) * 2013-11-21 2018-06-01 金蝶软件(中国)有限公司 业务移动应用系统及其应用方法
CN103747097B (zh) * 2014-01-22 2016-08-24 电子科技大学 移动终端http请求聚合压缩的系统及方法
CN104217140B (zh) * 2014-08-29 2017-03-15 北京奇虎科技有限公司 一种应用程序的加固方法和装置

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102968454A (zh) * 2012-10-26 2013-03-13 北京百度网讯科技有限公司 一种用于获取推广对象搜索结果的方法和设备
CN103064876A (zh) * 2012-10-30 2013-04-24 中国标准化研究院 面向地理信息应用的空间数据服务化获取方法

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
LI, YIMIN ET AL.: "A Query Rewriting Technology over Large Scale Deep Web", INFORMATION SCIENCE, vol. 32, no. 1, 31 January 2014 (2014-01-31), pages 3.1 - 3.4, ISSN: 1007-7634 *
LI, YIMIN: "A Query Rewriting Technology over Large Scale Deep Web", INFORMATION SCIENCE, vol. 32, no. 1, 31 January 2014 (2014-01-31), ISSN: 1007-7634 *

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108595625A (zh) * 2018-04-23 2018-09-28 平安科技(深圳)有限公司 Bi工具的运维方法、装置、计算机装置及存储介质
CN109635015A (zh) * 2018-09-30 2019-04-16 阿里巴巴集团控股有限公司 属性数据使用对象的确定方法、装置和服务器
CN110865845A (zh) * 2019-10-28 2020-03-06 福建天泉教育科技有限公司 提高接口访问效率的方法、存储介质
CN113760251A (zh) * 2020-11-09 2021-12-07 北京沃东天骏信息技术有限公司 一种基于Vue的表单开发方法和装置
CN113760251B (zh) * 2020-11-09 2024-05-17 北京沃东天骏信息技术有限公司 一种基于Vue的表单开发方法和装置
CN113726781B (zh) * 2021-08-31 2023-05-16 平安养老保险股份有限公司 报文信息处理方法、装置、计算机设备及存储介质
CN113726781A (zh) * 2021-08-31 2021-11-30 平安养老保险股份有限公司 报文信息处理方法、装置、计算机设备及存储介质
CN114201156B (zh) * 2021-12-10 2022-08-05 北京百度网讯科技有限公司 接入方法、装置、电子设备及计算机存储介质
CN114201156A (zh) * 2021-12-10 2022-03-18 北京百度网讯科技有限公司 接入方法、装置、电子设备及计算机存储介质
CN115495398A (zh) * 2022-09-28 2022-12-20 北京亚控科技发展有限公司 接口资源操作方法、装置、电子设备、存储介质及产品
CN115495398B (zh) * 2022-09-28 2023-06-30 北京亚控科技发展有限公司 接口资源操作方法、装置、电子设备、存储介质
CN117032710A (zh) * 2023-10-08 2023-11-10 思创数码科技股份有限公司 一种流程表单组合拆分方法及系统
CN117032710B (zh) * 2023-10-08 2024-01-19 思创数码科技股份有限公司 一种流程表单组合拆分方法及系统

Also Published As

Publication number Publication date
CN106341444A (zh) 2017-01-18
CN106341444B (zh) 2018-02-13

Similar Documents

Publication Publication Date Title
WO2017156916A1 (zh) 数据访问方法和装置
AU2021212135B2 (en) Building and managing data-processing attributes for modelled data sources
US20210248143A1 (en) Automatically executing graphql queries on databases
US8321450B2 (en) Standardized database connectivity support for an event processing server in an embedded context
US8387076B2 (en) Standardized database connectivity support for an event processing server
US8346747B2 (en) Extending database tables in a multi-tenant environment
US11327964B2 (en) Integration query builder framework
US9967370B2 (en) OData enabled mobile software applications
US8645502B2 (en) Dynamic interface to read database through remote procedure call
US9330140B1 (en) Transient virtual single tenant queries in a multi-tenant shared database system
US11689626B2 (en) Transport channel via web socket for ODATA
US20180307692A1 (en) Software application interface for mediating access to services of a centralized data store
US11263542B2 (en) Technologies for auto discover and connect to a rest interface
WO2024001493A1 (zh) 一种可视化的数据分析方法及设备
CN110109983B (zh) 一种操作Redis数据库的方法和装置
CN114090162A (zh) 一种多租户系统的前端界面展示方法及相关装置
US20180121259A1 (en) Method and system for data instance-based automatic message map construction
US12019647B2 (en) Accessing application services from forms
CN115145652A (zh) 一种数据处理任务的创建方法、装置、设备及介质
US20220229841A1 (en) Database streaming for automated processes
CN113760949B (zh) 数据查询的方法和装置
WO2023230797A1 (zh) 一种跨系统测试方法及装置
CN118210491A (zh) 一种基于PaaS平台的动态报表生成方法及装置
CN115203027A (zh) 基于数据集成模型的测试方法及装置
CN116456021A (zh) 页面数据请求方法、装置、电子设备及可读存储介质

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16894078

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16894078

Country of ref document: EP

Kind code of ref document: A1