WO2016011883A1 - 数据资源的获取方法、装置和系统 - Google Patents

数据资源的获取方法、装置和系统 Download PDF

Info

Publication number
WO2016011883A1
WO2016011883A1 PCT/CN2015/083248 CN2015083248W WO2016011883A1 WO 2016011883 A1 WO2016011883 A1 WO 2016011883A1 CN 2015083248 W CN2015083248 W CN 2015083248W WO 2016011883 A1 WO2016011883 A1 WO 2016011883A1
Authority
WO
WIPO (PCT)
Prior art keywords
server
cache
path
query
service request
Prior art date
Application number
PCT/CN2015/083248
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 WO2016011883A1 publication Critical patent/WO2016011883A1/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

Definitions

  • the present invention relates to the field of computer Internet, and in particular to a method, device and system for acquiring data resources.
  • the prior art provides a centralized management of data to process the service request of the front-end client, and obtains corresponding resources.
  • This centralized control of data can bring the advantages of data sharing and cost reduction of data management, but at the same time, it also brings The negative impact of huge data requests and query single points.
  • the embodiment of the invention provides a method, a device and a system for acquiring a data resource, so as to at least solve the technical problem that the prior art cannot flexibly control the request mode of the resource according to the requirements of the client.
  • a method for obtaining a data resource including: acquiring pre-configured query path information and cache configuration information, where the query path information includes: a distributed cache path for accessing the distributed cache server and a remote access path for accessing the remote server; after receiving the service request, selecting to access the distributed cache server or the remote server by querying the path information, and querying the resource corresponding to the service request according to the cache configuration information; wherein, the distributed resource In the case that the cache server fails to obtain the resource, the call to the remote access path is switched to access the remote server to obtain the resource.
  • a data resource obtaining apparatus including: an obtaining module, configured to acquire pre-configured query path information and cache configuration information, where the query path information includes: a distributed cache path of the cache server and a remote access path for accessing the remote server; the access processing module is configured to select to access the distributed cache server or the remote server by querying the path information after receiving the service request, and query according to the cache configuration information Obtain the resource corresponding to the service request; switch module, use In the case that the resource acquisition from the distributed cache server fails, the remote access path is selected to be switched to access the remote server to acquire the resource.
  • a data resource obtaining system including: a distributed cache server; a remote server; a configuration server, which stores pre-configured query path information and cache configuration information; a client, and The configuration server establishes a communication relationship, and is configured to obtain pre-configured query path information and cache configuration information from the configuration server, where the query path information includes: a distributed cache path for accessing the distributed cache server and a remote access path for accessing the remote server;
  • the client selects to access the distributed cache server or the remote server by querying the path information, and queries the resource corresponding to the service request according to the cache configuration information, where the resource acquisition fails from the distributed cache server.
  • the pre-configured query path information and the cache configuration information are obtained, where the query path information includes: a distributed cache path for accessing the distributed cache server and a remote access path for accessing the remote server; After the service request, the access routing server information is selected to access the distributed cache server or the remote server, and the resource corresponding to the service request is obtained according to the cache configuration information; wherein, when the resource is failed to be obtained from the distributed cache server, the remote access is selected. The path is switched to access the remote server to obtain the resource.
  • the configurable modeling idea is provided by selecting the access path of the resource, and the dynamics of the computer client are implemented based on the pre-configured query path information and the cache configuration information.
  • the access control is compared with the data centralized management method provided by the prior art.
  • the configurable resource selection scheme is based on the essence of the replicable data, and the client for obtaining the data resource is deployed to the application end of the service request. Based on Description information, access to resources such that the path can be switched according to requirements, thereby solving the technical problems of the prior art can not request a manner flexibly control resources according to the needs of the client.
  • FIG. 1 is a block diagram showing the hardware structure of a computer terminal for acquiring a running data resource according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a method for acquiring a data resource according to Embodiment 1 of the present invention
  • FIG. 3 is a schematic diagram of an application structure of a method for acquiring a data resource according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of relationship between cache configuration information and resources according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of an apparatus for acquiring a data resource according to Embodiment 2 of the present disclosure
  • FIG. 6 is a schematic structural diagram of an apparatus for acquiring an optional data resource according to Embodiment 2 of the present disclosure
  • FIG. 7a and 7b are schematic structural diagrams of another optional data resource obtaining apparatus according to Embodiment 2 of the present embodiment.
  • FIG. 8 is a schematic structural diagram of a data resource acquiring system according to Embodiment 3 of the present law.
  • Optimal resources Under the premise of obtaining the required resources and satisfying the normal operation of the system, the system considers the optimal resources based on response time and system cost.
  • MQL Model Query Language, a model query language that describes a key element of a model query and a configuration of a schema that describes the basic syntax and format of the configuration.
  • FIG. 1 is a hardware structural block diagram of a computer terminal for acquiring a running data resource according to an embodiment of the present invention.
  • computer terminal 10 may include one or more (only one shown) processor 102 (processor 102 may include, but is not limited to, a microprocessor MCU) Or a processing device such as a programmable logic device FPGA, a memory 104 for storing data, and a transmission device 106 for communication functions.
  • processor 102 may include, but is not limited to, a microprocessor MCU) Or a processing device such as a programmable logic device FPGA, a memory 104 for storing data, and a transmission device 106 for communication functions.
  • FIG. 1 is merely illustrative and does not limit the structure of the above electronic device.
  • computer terminal 10 may also include more or fewer components than those shown in FIG. 1, or have a different configuration than that shown in FIG.
  • the memory 104 can be used to store software programs and modules of the application software, such as program instructions/modules corresponding to the method for acquiring data resources in the embodiment of the present invention, and the processor 102 executes by executing the software programs and modules stored in the memory 104.
  • Various functional applications and data processing that is, a method of processing the above search results.
  • Memory 104 may include high speed random access memory, and may also include non-volatile memory such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory.
  • memory 104 may further include memory remotely located relative to processor 102, which may be connected to mobile terminal 10 over a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • Transmission device 106 is for receiving or transmitting data via a network.
  • the above-described network specific example may include a wireless network provided by a communication provider of the mobile terminal 10.
  • the transmission device 106 includes a Network Interface Controller (NIC) that can be connected to other network devices through a base station to communicate with the Internet.
  • the transmission device 106 can be a Radio Frequency (RF) module for communicating with the Internet wirelessly.
  • NIC Network Interface Controller
  • RF Radio Frequency
  • FIG. 2 is a flowchart of a method for acquiring a data resource according to Embodiment 1 of the present invention.
  • the method for obtaining the data resource may be implemented as follows:
  • Step S20 Obtain pre-configured query path information and cache configuration information, where the query path information includes: a distributed cache path for accessing the distributed cache server and a remote access path for accessing the remote server.
  • step S20 of the present application can be applied to the search function of the computer terminal.
  • the configuration information required by the configuration server can be pulled to the client, and the configuration information includes at least the query.
  • Path information that describes the server terminal address that the computer client will access.
  • Step S22 After receiving the service request, select the distributed cache server or the remote server by querying the path information, and query the resource corresponding to the service request according to the cache configuration information, where the resource failure is obtained from the distributed cache server. Next, choose to invoke the remote access path to switch to access the remote server to get the resources.
  • step S22 of the present application provides a method for selectively accessing a distributed cache server or a remote server according to the already configured query path information, thereby obtaining a current resource corresponding to the service request, and selecting to access the distributed cache server in the current process.
  • the resource data as an example, if the cached resource data fails to be obtained from the current distributed cache server, the remote access path from the remote server is selected to query and obtain the corresponding resource data.
  • the query path information may be pre-configured to directly select a remote access address to access the remote server, thereby acquiring resources, that is,
  • the above steps also provide an application function that can directly access the remote server.
  • the configuration information can be adjusted to adjust the query path information to a distributed cache path.
  • the resource in the foregoing steps of the present application may refer to a data node that acquires a resource when the service system on the computer client completes the data service query request, that is, the current service request may be from the distributed cache server or the remote server.
  • the data content obtained in the device may refer to a data node that acquires a resource when the service system on the computer client completes the data service query request, that is, the current service request may be from the distributed cache server or the remote server.
  • the solution provided in the foregoing Embodiment 1 of the present application mainly provides a configurable modeling idea for the selection manner of the access path of the resource, and implements the computer client based on the pre-configured query path information and the cache configuration information.
  • Dynamic access control comparing the data centralized management method provided by the prior art, the configurable resource selection scheme is based on the essence of the replicable data, and the client for acquiring the data resource is deployed to the application end of the service request.
  • the path for obtaining resources can be switched according to requirements, thereby solving the technical problem that the prior art cannot flexibly control the request mode of the resource according to the requirements of the client, and achieve an optimal balance of cost, performance, or risk. .
  • the function of configuring the query path information and the cache configuration information is to offload the processing of a part of the service request query to the cache server, thereby alleviating the burden on the remote server and speeding up the efficiency of the client acquiring the resource.
  • the idea can also be applied to other client dynamic runtime control design.
  • the resource that the login user needs to obtain belongs to the data with low update rate (for example, basic information of the registered user: mobile phone number, address, account number, etc.)
  • these resources with low update rate can be deployed in distributed.
  • the query path information is pre-configured to select a distributed cache path, so that the client can obtain the basic information of the user when receiving the service request, and then obtain the information from the distributed cache. If the distributed cache server fails or other faults prevent the resource from being successfully acquired, switch to the remote access path to obtain the resource from the remote access server, so that the path for obtaining the resource can be switched according to requirements. Thereby achieving an optimal balance of cost, performance or risk.
  • the optimal resources are not static, but vary with the business scenario, for example, personalized information of the user. It is always changing.
  • the optimal resource is the data itself. Because the data is copied to the cache, the maintenance cost of data consistency will increase, and the cache hit rate is low. It is suitable for obtaining directly from the remote server, but an activity. At the same time, because the same data request is too much, it will cause data single point.
  • the query mode By switching the query mode, the purpose of load transfer and cost optimization can be achieved, and the query path can be dynamically switched, and the most resources can be achieved without publishing. The purpose of the choice. At present, the product has been widely used in Alipay's data query technology. Through the configured resource selection scheme, the query path can be dynamically switched to achieve the purpose of dynamically switching resource dependencies under different capacity requirements and risk control. .
  • step S22 the step of accessing the distributed cache server or the remote server by using the query path information, and performing the step of obtaining the resource corresponding to the service request according to the cache configuration information may be performed in step S22.
  • the first mode of operation when the priority of the remote access path is higher than the distributed cache path, directly access the remote server through the remote access path to obtain the resource corresponding to the service request.
  • the step of directly accessing the remote server by using the remote access path to obtain the resource corresponding to the service request may include the following implementation manners:
  • Step S221 sending a service request to the remote server according to the remote access path.
  • the remote server acquires the corresponding model configuration information and the query statement from the configuration server according to the service request, where the model configuration information includes: a domain model for characterizing the resource type corresponding to the service request, and a feature type corresponding to the resource type The data model of the resource information table.
  • Step S225 the remote server accesses the database according to the query statement and the model configuration information, and obtains the resource corresponding to the service request.
  • the model configuration information in the above steps of the present application is a content for describing a model description configuration, wherein a "domain model” and an underlying "data” may be described by a common language or manner (such as xml).
  • the data model refers to storing and acquiring data from a persistent or cache device, and the physical model is designed for storage and query requirements, and the domain model is designed for business needs.
  • a domain model corresponding to a customer information may include a sub-model: customer basic information, mobile phone letter Information, address information, etc.
  • the data model corresponding to the domain model may be: a tiled customer information table, a mobile phone information table, an address information table, and the like.
  • the above data model may also be a client model, a bank card model, etc., at this time, whether the client model supports a cache acquisition model, which is preset to the configuration server according to the path of the data storage when the data service is externally provided. In the middle, the configuration can be modified as the storage path changes, thereby supporting the selection of optimal resources.
  • the second mode of operation is: when the priority of the distributed cache path is higher than the remote access path, the distributed cache server is preferentially accessed through the distributed cache path to obtain the resource corresponding to the service request, and the method of extracting the distributed cache path fails. Then, switch to the remote access path to access the distributed cache server to obtain the resource corresponding to the service request.
  • the second operation mode provides a mechanism for realizing the acquisition of the resource path by the client based on the dynamic configuration mode, and uniformly abstracts and models the resource switching configuration of the data acquisition, and describes and protects the configuration design manner.
  • the above solution can implement the maintenance resource selection path and maintain the resources in a unified manner by pre-configuring the query path information on the configuration server.
  • the configuration information can be described in the xml language, and the configuration file is integrated into the system of the configuration server, and the configuration information is obtained by the client reading and pulling the file on the configuration server, and switching the different configurations through the switch design. .
  • the remote server (Query_Server, relative to the server of the business data, will acquire the data through a network call, called the remote server), will select the database to obtain the data, and reduce the domain model and data model in order to normalize the query process. And the conversion process of the data storage device adaptation (the configuration server interacts with the search server, after being acquired once, it is cached in the remote server memory to avoid multiple acquisitions), and the data is completed by obtaining the "model description configuration" from the configuration server. Obtain.
  • the query path information and the cache configuration information are configured in the configuration server.
  • the cached configuration keyword is used to cache the cached object keyword in the query identifier in the service request.
  • generating a query keyword corresponding to the service request wherein the cache server queries the resource corresponding to the service request according to the query keyword query.
  • the function of the cache configuration information in the above solution is: in the query path information, if the distributed cache path is selected, that is, the current cache query mode, the resource is selected to access the distributed cache service. Obtained by the server, the cache configuration information is mainly used to encapsulate parameters carried in the service request, so that the client can flexibly obtain data from the "distributed resource" without requiring the client to understand the data acquisition data logic in the distributed cache. .
  • the cache configuration information may include: a cache prefix and a cache name.
  • the current service request the input query identifier is the user ID identifier: 00001.
  • the cached object key wrapper needs to be performed on the user ID identifier, and the packaging process is: from the cache.
  • the cache prefix and the cache name are obtained in the configuration information, and the obtained query keyword key can be USERID-0001.
  • the input query identifier is the bank card ID identifier: 00001.
  • the cache card key package needs to be packaged for the bank card ID identifier, and the packaging process is performed.
  • the assembled query keyword key can be BANKCARDID-0001.
  • the client needs to obtain a data model and obtain a query type MQL (Model Query Language) of the resource type of the data model.
  • MQL Model Query Language
  • This description is similar to the description of SQL.
  • step S22 before the step S22 is performed to select a distributed cache server or a remote server by using the query path information, and the resource corresponding to the service request is obtained according to the cache configuration information, the following steps may be performed:
  • Step S211 obtaining cache configuration information from the configuration server.
  • Step S213 Obtain a resource corresponding to the cache configuration information by accessing the database.
  • Step S215 and assembling the cache configuration information and its corresponding resources into a client model.
  • Step S217 saving the client server to the distributed cache server.
  • the foregoing steps S211 to S217 of the present application implement a process of performing cache re-establishment in a cache server, that is, a process of implementing data cache re-establishment in a distributed cache server.
  • the distributed cache server of the present invention can obtain the cached data that needs to be cached by using the key->value mode, that is, the data held in the relational database DB in the form of a data table is converted into a key->value mode and saved in the cache server.
  • the data of the relational database has a one-to-one correspondence with the cached data.
  • the cache configuration information is obtained first, and the query keyword key in the data save format conforming to the distributed cache is obtained according to the cache configuration information (for example, the query keyword key in FIG. 4 may be a cache prefix client ID), and then according to the The resource corresponding to the query keyword key is obtained in the database DB.
  • the resource may include any one or more of the following types of data: customer basic information, mobile phone information, and address information.
  • the number of types of resources in the query process is the same as the number of interactions between the remote server and the database DB, that is, if the three types of resources of the above-mentioned customer basic information, mobile phone information, and address information are to be obtained, the database DB needs to be interacted with. 3 times. Finally, the client model is assembled according to the cache configuration information and the corresponding resources.
  • the resource can be obtained from the database DB through the remote server and assembled into a client model, and placed in the cache server, so that the service request can be directly cached.
  • the resource data is obtained in the server, so that the subsequent query path is optimal.
  • step A when the query system of the client is started, the required resource configuration information may be pulled from the configuration server to the client, so that the client can load the corresponding resource configuration information, where the resource configuration information includes the preset query path information. And cache configuration information.
  • the foregoing query path information is a distributed cache path.
  • the query path is determined to preferentially use the distributed cache path, it is determined that the client is in a "cache query" mode, and then accessing the distributed cache server to obtain resources is selected.
  • the cache configuration information is used to encapsulate parameters carried in the service request, so that the client can flexibly obtain data from the “distributed resource” without requiring the client to understand the data acquisition data logic in the distributed cache.
  • Step B After the client establishes a communication relationship with the distributed cache server according to the distributed cache path, the resource is obtained from the distributed cache server according to a Model Query Language (MQL).
  • MQL Model Query Language
  • model query language MQL is similar to the description of SQL, and the foregoing resource configuration information can be described by the following description: acquiring the data model + obtaining the resource type of the data model.
  • Step C If the cached resource fails to be obtained from the distributed cache server, the remote server may be accessed by extracting the remote access path to obtain the corresponding resource. This step is implemented. When the cached data is unavailable, the remote server is directly selected to obtain the resource. When the cache is available, the configured resource configuration information is adjusted.
  • the system directly skips step B and directly accesses the remote server by extracting the access path in step C. Then obtain the corresponding resources.
  • Step D in order to normalize the query process of the remote server to obtain resources from the database, reduce the conversion process of the domain model, the data model, and the data storage device adaptation, and the remote server obtains corresponding model configuration information from the configuration server according to the service request.
  • the query statement includes: a domain model for characterizing a resource type corresponding to the service request, and a data model for characterizing the resource information table corresponding to the resource type.
  • step E the remote server queries the database to obtain the corresponding resource saved in the data table format according to the model configuration information and the query statement obtained from the configuration server.
  • the query path information of the client is pre-configured from the configuration server, so that the client can select a distributed cache server or a remote server to acquire resources according to requirements. That is, the dynamic access control of the computer client is implemented based on the pre-configured query path information and the cache configuration information, so that the path for obtaining the resource can be switched according to requirements, thereby solving the problem that the prior art cannot flexibly control the resource according to the requirements of the client.
  • the remote server pair can be implemented by the following steps:
  • Step F The remote server obtains the cache configuration information from the configuration server, and obtains the resource corresponding to the cache configuration information from the access database through the SQL query statement.
  • the function of obtaining cache configuration information in this step is to provide configuration information of the cache reconstruction.
  • Step G After the cache configuration information and the corresponding resources are assembled into a client model, the client model is sent to the cache server for caching, so that the persistent storage configuration is obtained according to the MQL, and the cache reconstruction is performed.
  • the data instance needs to be described in a unified language, so that when the configuration takes effect, the data can be reversed through a unified process rather than a branch, without requiring secondary development.
  • the unified language can refer to the xml description and metadata description.
  • the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
  • an apparatus embodiment for implementing the foregoing method embodiments is also provided.
  • the apparatus provided by the foregoing embodiment of the present application may be run on a computer terminal.
  • FIG. 5 is a schematic structural diagram of an apparatus for acquiring a data resource according to Embodiment 2 of the present embodiment. As shown in FIG. 5, the device includes: an obtaining module 50, an access processing module 52, and a switching module 54.
  • the obtaining module 50 is configured to obtain pre-configured query path information and cache configuration information, where the query path information includes: a distributed cache path for accessing the distributed cache server and a remote access path for accessing the remote server; and the access processing module 52.
  • the query path information includes: a distributed cache path for accessing the distributed cache server and a remote access path for accessing the remote server; and the access processing module 52.
  • the switching module 54 is configured to be in the slave distributed cache server. In the case that the resource fails, choose to invoke the remote access path to switch to access the remote server to obtain the resource.
  • the solution provided in the first embodiment of the present application provides a configurable modeling idea for the selection manner of the access path of the resource, and implements dynamic access control of the computer client based on the pre-configured query path information and the cache configuration information.
  • the configurable resource selection scheme is based on the essence of the replicable data, and the client for acquiring the data resource is deployed to the application end of the service request, based on the configuration information.
  • the description enables the path to obtain resources to be switched according to requirements, thereby solving the technical problem that the prior art cannot flexibly control the request mode of resources according to the requirements of the client, and achieve an optimal balance of cost, performance or risk.
  • the resource that the login user needs to obtain belongs to the data with low update rate (for example, basic information of the registered user: mobile phone number, address, account number, etc.)
  • these resources with low update rate can be deployed in distributed.
  • the query path information is pre-configured to select a distributed cache path, so that the client can obtain the basic information of the user when receiving the service request, and then obtain the information from the distributed cache. If the distributed cache server fails or other faults result in the failure to obtain resources successfully, switch to the remote access path to obtain resources from the remote access server, so that the path for obtaining resources can be switched according to requirements, thereby achieving cost, The optimal balance of performance or risk.
  • the optimal resources are not static, but vary with the business scenario, for example, personalized information of the user. It is always changing.
  • the optimal resource is the data itself. Because the data is copied to the cache, the maintenance cost of data consistency will increase, and the cache hit rate is low. It is suitable for obtaining directly from the remote server, but an activity. At the same time, because the same data request is too much, it will cause data single point.
  • the query mode By switching the query mode, the purpose of load transfer and cost optimization can be achieved, and the query path can be dynamically switched, and the most resources can be achieved without publishing. The purpose of the choice. At present, the product has been widely used in Alipay's data query technology. Through the configured resource selection scheme, the query path can be dynamically switched to achieve the purpose of dynamically switching resource dependencies under different capacity requirements and risk control. .
  • the foregoing obtaining module 50, the access processing module 52, and the switching module 54 correspond to steps S20 to S22 in the first embodiment, and the three modules are the same as the examples and application scenarios implemented by the corresponding steps, but It is not limited to the contents disclosed in the above embodiment 1. It should be noted that the above module can be operated as part of the device in the computer terminal 10 provided in the first embodiment.
  • the device may further include: a configuration module 511 and a generation module 513.
  • the configuration module 511 is configured to configure the query path information and the cache configuration information in the configuration server.
  • the generating module 513 is configured to: query the query in the service request by using the cache configuration information when the query path information is a distributed cache path.
  • the identifier is cached by the cached object, and the query keyword corresponding to the service request is generated, wherein the cache server obtains the resource corresponding to the service request according to the query keyword query.
  • the foregoing configuration module 511 and the generation module 513 correspond to the steps S221 to S225 in the first embodiment.
  • the two modules are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the above embodiments.
  • the computer terminal 10 provided in the first embodiment.
  • the access processing module 52 may include: a remote access module 521, or a distributed cache access module 523.
  • the remote access module 521 is configured to directly access the remote server through the remote access path to obtain the resource corresponding to the service request, if the priority of the remote access path is higher than the distributed cache path.
  • the distributed cache access module 523 is configured to: when the priority of the distributed cache path is higher than the remote access path, preferentially access the distributed cache server through the distributed cache path to obtain the resource corresponding to the service request, and extract the distributed cache path. In case of failure, switch to the remote access path to access the distributed cache server to obtain the resource corresponding to the service request.
  • the remote access module 521 or the distributed cache access module 523 corresponds to the two operation mode steps in the first embodiment, and the two modules are the same as the examples and application scenarios implemented by the corresponding steps, but It is not limited to the contents disclosed in the above embodiment 1. It should be noted that the above module can be operated as part of the device in the computer terminal 10 provided in the first embodiment.
  • An embodiment of the present invention may provide a data resource acquisition system, where the data resource acquisition system may include a plurality of major devices that interact with each other.
  • FIG. 8 is a schematic structural diagram of a data resource acquiring system according to Embodiment 3 of the present law.
  • the data resource acquisition system may include a client 80, a distributed cache server 82, a remote server 84, and a configuration server 86.
  • the configuration server 86 stores the pre-configured query path information and the cache configuration information.
  • the client 80 establishes a communication relationship with the configuration server, and is configured to obtain pre-configured query path information and cache configuration information from the configuration server, where the query path information includes a distributed cache path for accessing the distributed cache server 82 and a remote access path for accessing the remote server 84; wherein, after receiving the service request, the client selects to access the distributed cache server or the remote server by querying the path information, The resource corresponding to the service request is obtained according to the cache configuration information. In the case that the resource is failed to be obtained from the distributed cache server, the remote access path is selected to be switched to access the remote server to obtain the resource.
  • the configuration information required by the configuration server may be pulled from the configuration server to the client, and the configuration information may at least include query path information, where the query path information describes that the computer client is to be accessed. Server terminal address.
  • the analysis shows that the system solution provides a method for accessing the distributed cache server or the remote server according to the already configured query path information, thereby obtaining the current resource corresponding to the service request, and selecting to access the distributed cache server in the current process. For example, to obtain the resource data, if the cached resource data fails to be obtained from the current distributed cache server, the remote access path from the remote server is selected to query the corresponding resource data.
  • the query path information may be pre-configured to directly select a remote access address to access the remote server, thereby obtaining resources, that is, the foregoing steps are also provided directly Accessing the application function of the remote server, when the cache data provided by the distributed cache server is available, the configuration information can be adjusted to adjust the query path information to a distributed cache path.
  • the solution provided in the foregoing Embodiment 3 of the present application mainly provides a configurable modeling idea for the selection manner of the access path of the resource, and implements the computer client based on the pre-configured query path information and the cache configuration information.
  • Dynamic access control comparing the data centralized management method provided by the prior art, the configurable resource selection scheme is based on the essence of the replicable data, and the client for acquiring the data resource is deployed to the application end of the service request.
  • the path for obtaining resources can be switched according to requirements, thereby solving the technical problem that the prior art cannot flexibly control the request mode of the resource according to the requirements of the client, and achieve an optimal balance of cost, performance, or risk. .
  • the function of configuring the query path information and the cache configuration information is to offload the processing of a part of the service request query to the cache server, thereby alleviating the burden on the remote server and speeding up the efficiency of the client acquiring the resource.
  • the idea can also be applied to other client dynamic runtime control design.
  • the configuration server 86 includes: a configuration processor 861 configured to configure query path information and cache configuration information;
  • the client 80 includes: a client processor 801, configured to cache a cached object keyword by querying the query identifier in the service request by using the cache configuration information to generate a query corresponding to the service request, where the query path information is a distributed cache path.
  • the keyword wherein the cache server queries the resource corresponding to the service request according to the query keyword query.
  • the client may directly access the remote server to obtain the resource corresponding to the service request, and the solution may be implemented by the following steps:
  • a service request is sent to the remote server based on the remote access path.
  • the remote server obtains the corresponding model configuration information and the query statement from the configuration server according to the service request, where the model configuration information includes: a domain model used to represent the resource type corresponding to the service request, and a resource used to represent the resource type The data model of the information table.
  • the remote server accesses the database according to the query statement and the model configuration information, and obtains the resource corresponding to the service request.
  • the model configuration information in the above solution of the present application is a content for describing a model description configuration, wherein a "domain model” and an underlying "data” may be described by a common language or manner (such as xml).
  • the data model refers to storing and acquiring data from a persistent or cache device, and the physical model is designed for storage and query requirements, and the domain model is designed for business needs.
  • the domain model corresponding to a certain customer information may include a sub-model: customer basic information, mobile phone information, address information, etc.
  • the data model corresponding to the domain model may be: a tiled customer information table, a mobile phone information table, Address information table, etc.
  • the above data model may also be a client model, a bank card model, etc., at this time, whether the client model supports a cache acquisition model, which is preset to the configuration server according to the path of the data storage when the data service is externally provided. In the middle, the configuration can be modified as the storage path changes, thereby supporting the selection of optimal resources.
  • the remote server in the foregoing embodiment of the present application may further provide a function of buffering data reconstruction of the distributed cache server, and the remote server may include: a cache reconstruction processor, configured to obtain cache configuration information from the configuration server, and pass the The database is accessed to obtain the resource corresponding to the cache configuration information, and after the cache configuration information and the corresponding resource are assembled into the client model, the client server is saved to the distributed cache server.
  • a cache reconstruction processor configured to obtain cache configuration information from the configuration server, and pass the The database is accessed to obtain the resource corresponding to the cache configuration information, and after the cache configuration information and the corresponding resource are assembled into the client model, the client server is saved to the distributed cache server.
  • the function of buffered data reconstruction provided by the remote server implements a process of cache re-establishment in the cache server, that is, how to complete the cache re-establishment of the data in the remote server in the distributed cache server.
  • the distributed cache server of the present invention can obtain the cached data that needs to be cached by using the key->value mode, that is, the data held in the relational database DB in the form of a data table is converted into a key->value mode and saved in the cache server.
  • the data of the relational database has a one-to-one correspondence with the cached data.
  • the cache configuration information is obtained first, and the query keyword key in the data save format conforming to the distributed cache is obtained according to the cache configuration information (for example, the query keyword key in FIG. 4 may be a cache prefix client ID), and then according to the The resource corresponding to the query keyword key is obtained in the database DB.
  • the resource may include any one or more of the following types of data: customer basic information, mobile phone.
  • the number of types of resources in the query process is the same as the number of interactions between the remote server and the database DB, that is, if the three types of resources of the above-mentioned customer basic information, mobile phone information, and address information are to be obtained, You need to interact with the database DB 3 times.
  • the client model is assembled according to the cache configuration information and the corresponding resources.
  • the resource can be obtained from the database DB through the remote server and assembled into a client model, and placed in the cache server, so that the service request can be directly cached.
  • the resource data is obtained in the server, so that the subsequent query path is optimal.
  • the disclosed client may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of a unit is only a logical function division.
  • multiple units or components may be combined or may be integrated into Another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, unit or module, and may be electrical or otherwise.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and the like. .

Landscapes

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

Abstract

本发明公开了一种数据资源的获取方法、装置和系统。其中,该方法包括:获取预先配置的查询路径信息和缓存配置信息,查询路径信息包括:用于访问分布式缓存服务器的分布缓存路径和用于访问远程服务器的远程访问路径;在接收到业务请求之后,通过查询路径信息选择访问分布式缓存服务器或远程服务器,并根据缓存配置信息查询得到业务请求对应的资源;其中,在从分布式缓存服务器获取资源失败的情况下,选择调用远程访问路径切换为访问远程服务器,来获取资源。本发明解决了现有技术无法根据客户端的需求来灵活控制资源的请求方式的技术问题。

Description

数据资源的获取方法、装置和系统 技术领域
本发明涉及计算机互联网领域,具体而言,涉及一种数据资源的获取方法、装置和系统。
背景技术
现有技术通过提供数据集中式管控来处理前端客户端的业务请求,得到对应的资源,这种数据集中式管控能够带来数据共享、下调数据管理成本的优点,但是与此同时,也带来了巨量数据请求和查询单点的负面影响。
基于上述问题,可以通过第三方客户端部署到应用服务器上,或者制定统一的交互协议,减少应用服务器提供服务的成本,让资源直达请求方,是目前降低可复制型数据请求的最常用的方式,但是如何准确的描述获取资源的路径,使得请求方式可动态变换切换,使得客户端请求资源方式做到可控制,暂时无系统的方案进行系统阐述。
针对上述现有技术无法根据客户端的需求来灵活控制资源的请求方式的问题,目前尚未提出有效的解决方案。
发明内容
本发明实施例提供了一种数据资源的获取方法、装置和系统,以至少解决现有技术无法根据客户端的需求来灵活控制资源的请求方式的技术问题。
根据本发明实施例的一个方面,提供了一种数据资源的获取方法,包括:获取预先配置的查询路径信息和缓存配置信息,查询路径信息包括:用于访问分布式缓存服务器的分布缓存路径和用于访问远程服务器的远程访问路径;在接收到业务请求之后,通过查询路径信息选择访问分布式缓存服务器或远程服务器,并根据缓存配置信息查询得到业务请求对应的资源;其中,在从分布式缓存服务器获取资源失败的情况下,选择调用远程访问路径切换为访问远程服务器,来获取资源。
根据本发明实施例的另一方面,还提供了一种数据资源的获取装置,包括:获取模块,用于获取预先配置的查询路径信息和缓存配置信息,查询路径信息包括:用于访问分布式缓存服务器的分布缓存路径和用于访问远程服务器的远程访问路径;访问处理模块,用于在接收到业务请求之后,通过查询路径信息选择访问分布式缓存服务器或远程服务器,并根据缓存配置信息查询得到业务请求对应的资源;切换模块,用 于在从分布式缓存服务器获取资源失败的情况下,选择调用远程访问路径切换为访问远程服务器,来获取资源。
根据本发明实施例的另一方面,还提供了一种数据资源的获取系统,包括:分布式缓存服务器;远程服务器;配置服务器,保存预先配置的查询路径信息和缓存配置信息;客户端,与配置服务器建立通信关系,用于从配置服务器获取预先配置的查询路径信息和缓存配置信息,查询路径信息包括:用于访问分布式缓存服务器的分布缓存路径和用于访问远程服务器的远程访问路径;其中,客户端在接收到业务请求之后,通过查询路径信息选择访问分布式缓存服务器或远程服务器,并根据缓存配置信息查询得到业务请求对应的资源,其中,在从分布式缓存服务器获取资源失败的情况下,选择调用远程访问路径切换为访问远程服务器,来获取资源。
在本发明实施例中,采用获取预先配置的查询路径信息和缓存配置信息,查询路径信息包括:用于访问分布式缓存服务器的分布缓存路径和用于访问远程服务器的远程访问路径;在接收到业务请求之后,通过查询路径信息选择访问分布式缓存服务器或远程服务器,并根据缓存配置信息查询得到业务请求对应的资源;其中,在从分布式缓存服务器获取资源失败的情况下,选择调用远程访问路径切换为访问远程服务器,来获取资源的方式,通过针对资源的访问路径的选择方式提供一种可配置化的建模思路,基于预先配置的查询路径信息和缓存配置信息,实现计算机客户端的动态访问控制,比较现有技术提供的数据集中式管控方法,这种可配置化的选择资源的方案基于可复制类数据的本质,将用于获取数据资源的客户端部署到业务请求的应用端,基于配置信息的描述,使得获取资源的路径可以根据需求进行切换,进而解决了现有技术无法根据客户端的需求来灵活控制资源的请求方式的技术问题。
附图说明
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1是本发明实施例的一种运行数据资源的获取方法的计算机终端的硬件结构框图;
图2是根据本发明实施例一的数据资源的获取方法的流程图;
图3是根据本发明实施例一提供的一种数据资源的获取方法的应用结构示意图;
图4是根据本发明实施例的一种缓存配置信息与资源的关系结构示意图;
图5是根据本法实施例二的数据资源的获取装置的结构示意图;
图6是根据本法实施例二的一种可选的数据资源的获取装置的结构示意图;
图7a和7b是根据本法实施例二的另外一种可选的数据资源的获取装置的结构示意图;以及
图8是根据本法实施例三的数据资源的获取系统的结构示意图。
具体实施方式
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
下面就对本申请涉及到的名词进行解释:
最优资源:系统在获取所需资源时,满足系统其业务场景正常运行的前提下,响应时间、系统成本综合考虑下最优的资源。
MQL:Model Query Language,模型查询语言,用来描述模型查询的关键要素及模式的一种配置,该语言描述了配置的基本语法和格式。
实施例1
本申请实施例一所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在计算机终端上为例,图1是本发明实施例的一种运行数据资源的获取方法的计算机终端的硬件结构框图。如图1所示,计算机终端10可以包括一个或多个(图中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU 或可编程逻辑器件FPGA等的处理装置)、用于存储数据的存储器104、以及用于通信功能的传输装置106。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述电子装置的结构造成限定。例如,计算机终端10还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。
存储器104可用于存储应用软件的软件程序以及模块,如本发明实施例中的数据资源的获取方法对应的程序指令/模块,处理器102通过运行存储在存储器104内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的搜索结果的处理方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至移动终端10。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
传输装置106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括移动终端10的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Control ler,NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。
在上述运行环境下,本申请提供了如图2所示的数据资源的获取方法。图2是根据本发明实施例一的数据资源的获取方法的流程图。
如图2所示,该数据资源的获取方法可以如下实施步骤:
步骤S20,获取预先配置的查询路径信息和缓存配置信息,查询路径信息包括:用于访问分布式缓存服务器的分布缓存路径和用于访问远程服务器的远程访问路径。
本申请上述步骤S20可以应用在计算机终端的搜索功能中,结合图3可知,在计算机客户端的搜索系统启动时,可以从配置服务器将需要的配置信息拉取到客户端,该配置信息至少包括查询路径信息,该查询路径信息描述了计算机客户端将要访问的服务器终端地址。
步骤S22,在接收到业务请求之后,通过查询路径信息选择访问分布式缓存服务器或远程服务器,并根据缓存配置信息查询得到业务请求对应的资源,其中,在从分布式缓存服务器获取资源失败的情况下,选择调用远程访问路径切换为访问远程服务器,来获取资源。
本申请上述步骤S22提供了一种可以根据已经配置好的查询路径信息来选择访问分布式缓存服务器或远程服务器,从而获取该业务请求对应的当前资源,以当前流程中选择访问分布式缓存服务器来获取资源数据为例,从当前的分布式缓存服务器获取缓存的资源数据失败的情况下,才选择从远程服务器的远程访问路径来查询得到对应的资源数据。此处需要说明的是,一种可选方案中,在分布式缓存服务器提供的缓存数据不可用的情况下,可以预先配置查询路径信息直接选择远程访问地址来访问远程服务器,从而获取资源,即上述步骤也提供了可以直接访问远程服务器的应用功能,在分布式缓存服务器提供的缓存数据可用时,可以调整配置信息,使得查询路径信息调整为分布式缓存路径。
此处还需要说明的是,本申请上述步骤中的资源可以指计算机客户端上的业务系统完成数据业务查询请求时,获取资源的数据节点,即当前业务请求可以从分布式缓存服务器或远程服务器的设备中获取到的数据内容。
由此可知,本申请上述实施例一提供的方案,主要针对资源的访问路径的选择方式提供一种可配置化的建模思路,基于预先配置的查询路径信息和缓存配置信息,实现计算机客户端的动态访问控制,比较现有技术提供的数据集中式管控方法,这种可配置化的选择资源的方案基于可复制类数据的本质,将用于获取数据资源的客户端部署到业务请求的应用端,基于配置信息的描述,使得获取资源的路径可以根据需求进行切换,从而解决了现有技术无法根据客户端的需求来灵活控制资源的请求方式的技术问题,达到成本、性能或风险的最优平衡。
比较现有的数据集中式架构部署,在用户对应用客户端的访问量和查询量剧增的情况下(例如在电子商务进行促销活动期间,应用端的访问量和查询量会在单位时间内剧增),如果每个用户发出业务请求之后,客户端都从远程访问远程服务器来获取资源,则会造成的当业务请求增加时服务器大规模的部署的成本优化问题,本申请上述实施例提供的一种配置查询路径信息和缓存配置信息的功能,使得将一部分业务请求查询的处理过程分流至缓存服务器,以减缓远程服务器的负担,同时加快了客户端获取资源的效率。同时该思路同样可以适用于其他客户端动态运行时控制设计。
例如,针对客户端的登录用户需要获取的资源属于更新率很低的数据时(例如,注册用户的基本信息:手机号、地址、账号等),就可以将这些更新率低的资源部署在分布式缓存服务器中,并预先配置查询路径信息为选择分布缓存路径,这样客户端在接收到业务请求获取用户的基本信息时,就可以从分布式缓存中获取。如果分布式缓存服务器发生故障或其他故障,导致无法成功获取资源,则切换至选择远程访问路径来从远程访问服务器中获取资源,从而实现了获取资源的路径可以根据需求进行切换, 从而达到成本、性能或风险的最优平衡。
由此可知,为了更好的实现对部署在客户端的管控,实现最优资源的切换,最优资源并不是一成不变的,而是随着业务场景的变化而变化的,例如,用户的个性化信息是随时变化的,此时最优资源即数据本身,因为对数据采用复制的到缓存的方式,会增加数据一致性的维护成本,缓存命中率低下,适合直接从远程服务器获取,但是某个活动的时,由于同一份数据请求过多,会造成数据单点,通过对查询模式进行切换,能够做到负载转移和成本优化的目的,动态的切换查询路径,无需发布,即可达到最有资源选择的目的。目前该产品已在支付宝公司的数据查询技术中广泛使用,通过配置化的资源选择方案,可以动态的切换查询路径,达到在不同的容量要求、风险控制的情况下,动态的切换资源依赖的目的。
基于上述描述,进一步分析可知,本申请上述实施例中,步骤S22执行的通过查询路径信息访问分布式缓存服务器或远程服务器,并根据所述缓存配置信息查询得到获取业务请求对应的资源的步骤可以包括如下任意一种运行方式:
第一种运行方式:在远程访问路径的优先级高于分布缓存路径的情况下,直接选择通过远程访问路径访问远程服务器,获取业务请求对应的资源。
优选地,上述第一种运行方式提供的直接选择通过远程访问路径访问远程服务器,获取业务请求对应的资源的步骤,可以包括如下实施方案:
步骤S221,依据远程访问路径发送业务请求至远程服务器。
步骤S223,远程服务器根据业务请求从配置服务器中获取对应的模型配置信息和查询语句,其中,模型配置信息包括:用于表征业务请求对应的资源类型的领域模型,以及用于表征资源类型对应的资源信息表的数据模型。
步骤S225,远程服务器根据查询语句和模型配置信息访问数据库,获取业务请求对应的资源。
本申请上述步骤中的模型配置信息是一种用于描述模型描述配置的内容,其中,可以通过一种公共的语言或方式(如xml)来描述一个包含了“领域模型”以及和底层“数据模型”的内容及他们之间的映射关系,从而使得数据转换、底层不同数据库的适配来说能够使用一致的流程来处理。其中,数据模型是指从持久化或缓存设备中存储和获取数据,物理模型的针对存储和查询需求而设计,领域模型是针对业务需求而设计的内容。
例如,某一个客户信息对应的领域模型可以包含子模型:客户基本信息、手机信 息、地址信息等,此时,该领域模型对应的数据模型可以为:平铺的客户信息表、手机信息表、地址信息表等。根据应用场景的不同,上述数据模型还可以是客户模型、银行卡模型等等,此时客户模型是否支持缓存获取模型,这些是在数据服务对外提供时,根据数据存储的路径预先设置到配置服务器中的,也可以随着存储路径的变化,修改配置,从而支持最优资源的选择。
第二种运行方式:在分布缓存路径的优先级高于远程访问路径的情况下,优先选择通过分布缓存路径访问分布式缓存服务器,来获取业务请求对应的资源,在提取分布缓存路径失败的情况下,切换至选择远程访问路径访问分布式缓存服务器,来获取业务请求对应的资源。
上述第二种运行方式提供了基于动态配置的方式实现客户端获取资源路径的切换,对数据获取的资源切换配置进行了统一抽象和建模,对配置的设计方式进行描述和保护。
结合图3可知,上述方案可以通过在配置服务器上预先配置查询路径信息的方式,来实现维护资源选取路径,对资源做统一维护。
可以采用xml语言对配置信息进行描述,并将配置文件集成在配置服务器的系统中,通过客户端读取和拉取配置服务器上文件的方式来获取配置信息,并通过开关设计来切换不同的配置。
远程服务器(Query_Server,相对业务数据的服务器来说,会通过一次网络调用,称之为远程服务器)获取数据,会选择数据库来获取数据,为了使得查询过程归一化,而减少领域模型、数据模型以及数据存储设备适配的转换过程(配置服务器与搜索服务器交互目的,获取一次后,会缓存在远程服务器内存中,避免多次获取),通过从配置服务器获取“模型描述配置”,完成数据的获取。
此处需要说明的是,本申请提供的一种可选实施例中,在执行步骤S22实现的通过查询路径信息选择访问分布式缓存服务器或远程服务器之前,还可以执行如下方案:
结合图3可知,在配置服务器中配置查询路径信息和缓存配置信息,其中,在查询路径信息为分布式缓存路径的情况下,通过缓存配置信息对业务请求中的查询标识进行缓存对象关键词包装,生成业务请求对应的查询关键词,其中,缓存服务器根据查询关键词查询得到业务请求对应的资源。
上述方案中的缓存配置信息的作用是:在查询路径信息中,如果配置的是选择分布式缓存路径时,即当前是“缓存查询”模式,则资源是通过选择访问分布式缓存服 务器而获取到的,该缓存配置信息主要用来包装业务请求中携带的参数,使得客户端可以灵活的从“分布式资源”中获取数据,无需客户端理解分布式缓存中数据获取数据逻辑。其中,缓存配置信息可以包括:缓存前缀和缓存名称。
例如,当前业务请求,输入的查询标识为用户ID标识:00001,在选择分布式缓存服务器根据该用户ID获取用户数据时,需要对该用户ID标识进行缓存对象key包装,包装过程为:从缓存配置信息中获取缓存前缀和缓存名称,组装得到的查询关键词key可以为USERID-0001。
另外,当前业务请求,输入的查询标识为银行卡ID标识:00001,在选择分布式缓存服务器根据该银行卡ID获取银行卡数据时,需要对该银行卡ID标识进行缓存对象key包装,包装过程为:从缓存配置信息中获取缓存前缀和缓存名称,组装得到的查询关键词key可以为BANKCARDID-0001。
此处需要说明的是,结合图3可知,本申请上述方案提供的查询过程中,客户端需要获取数据模型以及获取该数据模型的资源类型的查询语句MQL(Model Query Language,模型查询语言),这种描述类似SQL的描述,例如,该配置的模型查询语句为:Select UserId,Name From Customer ID UserId=’111’Mode Cache,该配置描述了获取数据、数据模型及获取数据模型的模式,其中,“Select”、“From”、“ID”和“Mode”为配置关键字。
优选地,本申请上述实施例中,在执行步骤S22通过查询路径信息选择访问分布式缓存服务器或远程服务器,并根据缓存配置信息查询得到该业务请求对应的资源之前,还可以执行如下步骤:
步骤S211,从配置服务器获取缓存配置信息。
步骤S213,通过访问数据库获取到缓存配置信息对应的资源。
步骤S215,并将缓存配置信息及其对应的资源组装成客户模型。
步骤S217,将客户服务器保存至分布式缓存服务器。
如图3可知,本申请上述步骤S211至步骤S217实现了一种在缓存服务器中进行缓存重建的过程,即实现如何将远程服务器中的数据在分布式缓存服务器中完成缓存重建的过程。本发明的分布式缓存服务器可以通过key->value的模式来获取需要进行缓存的缓存数据,即将关系数据库DB中以数据表形式保持的数据转换成key->value的模式在缓存服务器中进行保存,关系数据库的数据与缓存数据具有一一对应的关联关系。
上述方案通过,先获取缓存配置信息,根据缓存配置信息得到符合分布式缓存的数据保存格式中的查询关键字key(例如图4中该查询关键字key可以是缓存前缀客户ID),然后根据从数据库DB中获取该查询关键字key对应的资源,如图4所示的示例可知,该资源的可以包括以下任意一种或多种各类型的数据:客户基本信息、手机信息、地址信息,此处需要说明的,查询过程中资源的类型的数量与远程服务器与数据库DB交互的次数相同,即如果要获取上述客户基本信息、手机信息、地址信息三种类型的资源,则需要与数据库DB交互3次。最后根据缓存配置信息和对应的资源组装成一个客户模型。
由此,在当分布式缓存服务器中不存在数据时的应用场景中,可以通过远程服务器从数据库DB中获取到资源并组装成客户模型,放置到缓存服务器中,从而使得业务请求能直接从缓存服务器中获取到资源数据,使得后续的查询路径最优。
下面就结合图3,以在电子商务领域提供的查询搜索功能为例,在默认优先访问分布式缓存服务器的情况下,对本申请提供的方案进行详细描述:
步骤A,在客户端的查询系统启动时,可以从配置服务器中将需要的资源配置信息拉取到客户端,使得客户端可以加载对应的资源配置信息,该资源配置信息包括预先设置的查询路径信息和缓存配置信息。
此处需要说明的是,上述查询路径信息为分布缓存路径,在查询路径确定为优先使用分布缓存路径时,则确定客户端处于“缓存查询”模式,此时选择访问分布式缓存服务器来获取资源,上述缓存配置信息用于包装业务请求中携带的参数,使得客户端可以灵活的从“分布式资源”中获取数据,无需客户端理解分布式缓存中数据获取数据逻辑。
步骤B,在客户端根据分布缓存路径与分布式缓存服务器建立通信关系之后,根据模型查询语言(Model Query Language,简称为MQL)来从分布式缓存服务器中获取资源。
此处需要说明的是,上述模型查询语言MQL的描述类似SQL的描述,可以通过如下描述方式来描述上述资源配置信息:获取数据模型+获取数据模型的资源类型。
步骤C,如果在从上述分布式缓存服务器获取缓存的资源失败的情况下,可以通过提取远程访问路径来访问远程服务器,进而获取到对应的资源。该步骤实现了,在缓存数据不可用的情况下,直接选择远程服务器获取资源,当缓存可用时,则会调整配置的资源配置信息。
此处需要说明的是,在本申请客户端拉取到的查询路径信息默认为远程访问路径的情况下,则系统直接跳过步骤B,直接通过步骤C中提取程访问路径来访问远程服务器,进而获取到对应的资源。
步骤D,为了使得远程服务器从数据库获取资源的查询过程归一化,减少领域模型、数据模型以及数据存储设备适配的转换过程,远程服务器根据业务请求从配置服务器中获取对应的模型配置信息和查询语句,其中,模型配置信息包括:用于表征业务请求对应的资源类型的领域模型,以及用于表征资源类型对应的资源信息表的数据模型。
步骤E,远程服务器根据从配置服务器中获取到的模型配置信息和查询语句,从数据库中查询得到对应的以数据表格式保存的资源。
本申请上述步骤A至步骤E,实现了从配置服务器中预先配置客户端的查询路径信息,使得客户端可以根据需求选择分布式缓存服务器或远程服务器获取资源。即基于预先配置的查询路径信息和缓存配置信息,实现计算机客户端的动态访问控制,使得获取资源的路径可以根据需求进行切换,从而解决了现有技术无法根据客户端的需求来灵活控制资源的请求方式的技术问题,达到成本、性能或风险的最优平衡。
此处还需要说明的是,在上述步骤A至步骤E的执行过程中,如果分布式缓存服务器无法提供相应的资源,客户端切换至从远程服务器获取资源之后,可以通过如下步骤实现远程服务器对分布式缓存服务器的缓存数据重建过程:
步骤F,远程服务器从配置服务器中获取缓存配置信息,并通过SQL查询语句从访问数据库中获取到缓存配置信息对应的资源。该步骤中获取缓存配置信息的作用是为了提供缓存重建的配置信息。
步骤G,在将缓存配置信息及其对应的资源组装成客户模型之后,将该客户模型发送给缓存服务器进行缓存,从而实现根据MQL获取持久化存储配置,进行缓存重建。
上述过程中,数据实例需要用统一的语言进行描述,从而使得配置生效时,能通过统一的流程而非分支的方式来进行数据的扭转,而无需进行二次开发,此处需要说明的是,统一语言可以参照xml描述、元数据描述方式。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块 并不一定是本发明所必须的。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。
实施例2
根据本发明实施例,还提供了一种用于实施上述方法实施例的装置实施例,本申请上述实施例所提供的装置可以在计算机终端上运行。
图5是根据本法实施例二的数据资源的获取装置的结构示意图。如图5所示,该装置包括:获取模块50、访问处理模块52、切换模块54。
其中,获取模块50,用于获取预先配置的查询路径信息和缓存配置信息,查询路径信息包括:用于访问分布式缓存服务器的分布缓存路径和用于访问远程服务器的远程访问路径;访问处理模块52,用于在接收到业务请求之后,通过查询路径信息选择访问分布式缓存服务器或远程服务器,并根据缓存配置信息查询得到业务请求对应的资源;切换模块54,用于在从分布式缓存服务器获取资源失败的情况下,选择调用远程访问路径切换为访问远程服务器,来获取资源。
本申请上述实施例一提供的方案,主要针对资源的访问路径的选择方式提供一种可配置化的建模思路,基于预先配置的查询路径信息和缓存配置信息,实现计算机客户端的动态访问控制,比较现有技术提供的数据集中式管控方法,这种可配置化的选择资源的方案基于可复制类数据的本质,将用于获取数据资源的客户端部署到业务请求的应用端,基于配置信息的描述,使得获取资源的路径可以根据需求进行切换,从而解决了现有技术无法根据客户端的需求来灵活控制资源的请求方式的技术问题,达到成本、性能或风险的最优平衡。
比较现有的数据集中式架构部署,在用户对应用客户端的访问量和查询量剧增的情况下(例如在电子商务进行促销活动期间,应用端的访问量和查询量会在单位时间内剧增),如果每个用户发出业务请求之后,客户端都从远程访问远程服务器来获取资源,则会造成的当业务请求增加时服务器大规模的部署的成本优化问题,本申请上述实施例提供的一种配置查询路径信息和缓存配置信息的功能,使得将一部分业务请求 查询的处理过程分流至缓存服务器,以减缓远程服务器的负担,同时加快了客户端获取资源的效率。同时该思路同样可以适用于其他客户端动态运行时控制设计。
例如,针对客户端的登录用户需要获取的资源属于更新率很低的数据时(例如,注册用户的基本信息:手机号、地址、账号等),就可以将这些更新率低的资源部署在分布式缓存服务器中,并预先配置查询路径信息为选择分布缓存路径,这样客户端在接收到业务请求获取用户的基本信息时,就可以从分布式缓存中获取。如果分布式缓存服务器发生故障或其他故障,导致无法成功获取资源,则切换至选择远程访问路径来从远程访问服务器中获取资源,从而实现了获取资源的路径可以根据需求进行切换,从而达到成本、性能或风险的最优平衡。
由此可知,为了更好的实现对部署在客户端的管控,实现最优资源的切换,最优资源并不是一成不变的,而是随着业务场景的变化而变化的,例如,用户的个性化信息是随时变化的,此时最优资源即数据本身,因为对数据采用复制的到缓存的方式,会增加数据一致性的维护成本,缓存命中率低下,适合直接从远程服务器获取,但是某个活动的时,由于同一份数据请求过多,会造成数据单点,通过对查询模式进行切换,能够做到负载转移和成本优化的目的,动态的切换查询路径,无需发布,即可达到最有资源选择的目的。目前该产品已在支付宝公司的数据查询技术中广泛使用,通过配置化的资源选择方案,可以动态的切换查询路径,达到在不同的容量要求、风险控制的情况下,动态的切换资源依赖的目的。
此处需要说明的是,上述获取模块50、访问处理模块52、切换模块54对应于实施例一中的步骤S20至步骤S22,三个模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的计算机终端10中。
优选地,如图6所示,本申请上述实施例中,在执行访问处理模块52之前,装置还可以包括:配置模块511、生成模块513。
其中,配置模块511,用于在配置服务器中配置查询路径信息和缓存配置信息;生成模块513,用于在查询路径信息为分布式缓存路径的情况下,通过缓存配置信息对业务请求中的查询标识进行缓存对象关键词包装,生成业务请求对应的查询关键词,其中,缓存服务器根据查询关键词查询得到业务请求对应的资源。
此处需要说明的是,上述配置模块511、生成模块513对应于实施例一中的步骤S221至步骤S225,二个模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实 施例一提供的计算机终端10中。
优选地,如图7a和图7b所示,本申请上述实施例中,访问处理模块52可以包括:远程访问模块521,或者分布式缓存访问模块523。
其中,远程访问模块521,用于在远程访问路径的优先级高于分布缓存路径的情况下,直接选择通过远程访问路径访问远程服务器,获取业务请求对应的资源。
分布式缓存访问模块523,用于在分布缓存路径的优先级高于远程访问路径的情况下,优先选择通过分布缓存路径访问分布式缓存服务器,来获取业务请求对应的资源,在提取分布缓存路径失败的情况下,切换至选择远程访问路径访问分布式缓存服务器,来获取业务请求对应的资源。
此处需要说明的是,上述远程访问模块521,或者分布式缓存访问模块523对应于实施例一中的两种运行方式步骤,二个模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的计算机终端10中。
实施例3
本发明的实施例可以提供一种数据资源的获取系统,该数据资源的获取系统可以是包括多个相互交互的重大设备。
图8是根据本法实施例三的数据资源的获取系统的结构示意图。如图8所示,该数据资源的获取系统可以包括:客户端80、分布式缓存服务器82、远程服务器84、配置服务器86。
其中,配置服务器86,保存预先配置的查询路径信息和缓存配置信息;客户端80,与配置服务器建立通信关系,用于从配置服务器获取预先配置的查询路径信息和缓存配置信息,查询路径信息包括:用于访问分布式缓存服务器82的分布缓存路径和用于访问远程服务器84的远程访问路径;其中,客户端在接收到业务请求之后,通过查询路径信息选择访问分布式缓存服务器或远程服务器,并根据缓存配置信息查询得到业务请求对应的资源,其中,在从分布式缓存服务器获取资源失败的情况下,选择调用远程访问路径切换为访问远程服务器,来获取资源。
上述实施例中,在计算机客户端的搜索系统启动时,可以从配置服务器将需要的配置信息拉取到客户端,该配置信息至少可以包括查询路径信息,该查询路径信息描述了计算机客户端将要访问的服务器终端地址。
分析可知,上述系统方案提供了一种可以根据已经配置好的查询路径信息来选择访问分布式缓存服务器或远程服务器,从而获取该业务请求对应的当前资源,以当前流程中选择访问分布式缓存服务器来获取资源数据为例,从当前的分布式缓存服务器获取缓存的资源数据失败的情况下,才选择从远程服务器的远程访问路径来查询得到对应的资源数据。一种可选方案中,在分布式缓存服务器提供的缓存数据不可用的情况下,可以预先配置查询路径信息直接选择远程访问地址来访问远程服务器,从而获取资源,即上述步骤也提供了可以直接访问远程服务器的应用功能,在分布式缓存服务器提供的缓存数据可用时,可以调整配置信息,使得查询路径信息调整为分布式缓存路径。
由此可知,本申请上述实施例三提供的方案,主要针对资源的访问路径的选择方式提供一种可配置化的建模思路,基于预先配置的查询路径信息和缓存配置信息,实现计算机客户端的动态访问控制,比较现有技术提供的数据集中式管控方法,这种可配置化的选择资源的方案基于可复制类数据的本质,将用于获取数据资源的客户端部署到业务请求的应用端,基于配置信息的描述,使得获取资源的路径可以根据需求进行切换,从而解决了现有技术无法根据客户端的需求来灵活控制资源的请求方式的技术问题,达到成本、性能或风险的最优平衡。
比较现有的数据集中式架构部署,在用户对应用客户端的访问量和查询量剧增的情况下(例如在电子商务进行促销活动期间,应用端的访问量和查询量会在单位时间内剧增),如果每个用户发出业务请求之后,客户端都从远程访问远程服务器来获取资源,则会造成的当业务请求增加时服务器大规模的部署的成本优化问题,本申请上述实施例提供的一种配置查询路径信息和缓存配置信息的功能,使得将一部分业务请求查询的处理过程分流至缓存服务器,以减缓远程服务器的负担,同时加快了客户端获取资源的效率。同时该思路同样可以适用于其他客户端动态运行时控制设计。
优选地,上述配置服务器86包括:配置处理器861,用于配置查询路径信息和缓存配置信息;
客户端80包括:客户端处理器801,用于在查询路径信息为分布式缓存路径的情况下,通过缓存配置信息对业务请求中的查询标识进行缓存对象关键词包装,生成业务请求对应的查询关键词,其中,缓存服务器根据查询关键词查询得到业务请求对应的资源。
在本申请提供的一种可选实施例中,客户端可以直接选择通过远程访问路径访问远程服务器,获取业务请求对应的资源,该方案可以通过如下步骤实现:
首先,依据远程访问路径发送业务请求至远程服务器。
然后,远程服务器根据业务请求从配置服务器中获取对应的模型配置信息和查询语句,其中,模型配置信息包括:用于表征业务请求对应的资源类型的领域模型,以及用于表征资源类型对应的资源信息表的数据模型。
最后,远程服务器根据查询语句和模型配置信息访问数据库,获取业务请求对应的资源。
本申请上述方案中的模型配置信息是一种用于描述模型描述配置的内容,其中,可以通过一种公共的语言或方式(如xml)来描述一个包含了“领域模型”以及和底层“数据模型”的内容及他们之间的映射关系,从而使得数据转换、底层不同数据库的适配来说能够使用一致的流程来处理。其中,数据模型是指从持久化或缓存设备中存储和获取数据,物理模型的针对存储和查询需求而设计,领域模型是针对业务需求而设计的内容。
例如,某一个客户信息对应的领域模型可以包含子模型:客户基本信息、手机信息、地址信息等,此时,该领域模型对应的数据模型可以为:平铺的客户信息表、手机信息表、地址信息表等。根据应用场景的不同,上述数据模型还可以是客户模型、银行卡模型等等,此时客户模型是否支持缓存获取模型,这些是在数据服务对外提供时,根据数据存储的路径预先设置到配置服务器中的,也可以随着存储路径的变化,修改配置,从而支持最优资源的选择。
优选地,本申请上述实施例中的远程服务器还可以提供对分布式缓存服务器进行缓冲数据重建的功能,该远程服务器可以包括:缓存重建处理器,用于从配置服务器获取缓存配置信息,并通过访问数据库获取到缓存配置信息对应的资源,在将缓存配置信息及其对应的资源组装成客户模型之后,将客户服务器保存至分布式缓存服务器。
远程服务器提供的缓冲数据重建的功能,实现了一种在缓存服务器中进行缓存重建的过程,即实现如何将远程服务器中的数据在分布式缓存服务器中完成缓存重建的过程。本发明的分布式缓存服务器可以通过key->value的模式来获取需要进行缓存的缓存数据,即将关系数据库DB中以数据表形式保持的数据转换成key->value的模式在缓存服务器中进行保存,关系数据库的数据与缓存数据具有一一对应的关联关系。
上述方案通过,先获取缓存配置信息,根据缓存配置信息得到符合分布式缓存的数据保存格式中的查询关键字key(例如图4中该查询关键字key可以是缓存前缀客户ID),然后根据从数据库DB中获取该查询关键字key对应的资源,如图4所示的示例可知,该资源的可以包括以下任意一种或多种各类型的数据:客户基本信息、手机 信息、地址信息,此处需要说明的,查询过程中资源的类型的数量与远程服务器与数据库DB交互的次数相同,即如果要获取上述客户基本信息、手机信息、地址信息三种类型的资源,则需要与数据库DB交互3次。最后根据缓存配置信息和对应的资源组装成一个客户模型。
由此,在当分布式缓存服务器中不存在数据时的应用场景中,可以通过远程服务器从数据库DB中获取到资源并组装成客户模型,放置到缓存服务器中,从而使得业务请求能直接从缓存服务器中获取到资源数据,使得后续的查询路径最优。
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。
在本发明的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的客户端,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。

Claims (12)

  1. 一种数据资源的获取方法,其特征在于,包括:
    获取预先配置的查询路径信息和缓存配置信息,所述查询路径信息包括:用于访问分布式缓存服务器的分布缓存路径和用于访问远程服务器的远程访问路径;
    在接收到业务请求之后,通过所述查询路径信息选择访问所述分布式缓存服务器或所述远程服务器,并根据所述缓存配置信息查询得到所述业务请求对应的资源;
    其中,在从所述分布式缓存服务器获取所述资源失败的情况下,选择调用所述远程访问路径切换为访问所述远程服务器,来获取所述资源。
  2. 根据权利要求1所述的方法,其特征在于,在通过所述查询路径信息选择访问所述分布式缓存服务器或所述远程服务器之前,所述方法还包括:
    在配置服务器中配置所述查询路径信息和所述缓存配置信息,其中,在所述查询路径信息为所述分布式缓存路径的情况下,通过所述缓存配置信息对所述业务请求中的查询标识进行缓存对象关键词包装,生成所述业务请求对应的查询关键词,其中,所述缓存服务器根据所述查询关键词查询得到所述业务请求对应的资源。
  3. 根据权利要求2所述的方法,其特征在于,通过所述查询路径信息选择访问所述分布式缓存服务器或所述远程服务器,并根据所述缓存配置信息查询得到获取所述业务请求对应的资源的步骤包括如下任意一种运行方式:
    在所述远程访问路径的优先级高于所述分布缓存路径的情况下,直接选择通过所述远程访问路径访问所述远程服务器,获取所述业务请求对应的资源;或者
    在所述分布缓存路径的优先级高于所述远程访问路径的情况下,优先选择通过所述分布缓存路径访问所述分布式缓存服务器,来获取所述业务请求对应的资源,在提取所述分布缓存路径失败的情况下,切换至选择所述远程访问路径访问所述分布式缓存服务器,来获取所述业务请求对应的资源。
  4. 根据权利要求3所述的方法,其特征在于,直接选择通过所述远程访问路径访问所述远程服务器,获取所述业务请求对应的资源的步骤包括:
    依据所述远程访问路径发送所述业务请求至所述远程服务器;
    所述远程服务器根据所述业务请求从所述配置服务器中获取对应的模型配置信息和查询语句,其中,所述模型配置信息包括:用于表征所述业务请求对应的资源类型的领域模型,以及用于表征所述资源类型对应的资源信息表的数据模型;
    所述远程服务器根据所述查询语句和所述模型配置信息访问数据库,获取所述业务请求对应的所述资源。
  5. 根据权利要求2或3所述的方法,其特征在于,在通过所述查询路径信息选择访问所述分布式缓存服务器或所述远程服务器,并根据所述缓存配置信息查询得到所述业务请求对应的资源之前,所述方法还包括:
    从所述配置服务器获取所述缓存配置信息;
    通过访问数据库获取到所述缓存配置信息对应的资源;
    并将所述缓存配置信息及其对应的资源组装成客户模型;
    将所述客户服务器保存至所述分布式缓存服务器。
  6. 一种数据资源的获取装置,其特征在于,包括:
    获取模块,用于获取预先配置的查询路径信息和缓存配置信息,所述查询路径信息包括:用于访问分布式缓存服务器的分布缓存路径和用于访问远程服务器的远程访问路径;
    访问处理模块,用于在接收到业务请求之后,通过所述查询路径信息选择访问所述分布式缓存服务器或所述远程服务器,并根据所述缓存配置信息查询得到所述业务请求对应的资源;
    切换模块,用于在从所述分布式缓存服务器获取所述资源失败的情况下,选择调用所述远程访问路径切换为访问所述远程服务器,来获取所述资源。
  7. 根据权利要求6所述的装置,其特征在于,所述装置还包括:
    配置模块,用于在配置服务器中配置所述查询路径信息和所述缓存配置信息;
    生成模块,用于在所述查询路径信息为所述分布式缓存路径的情况下,通过所述缓存配置信息对所述业务请求中的查询标识进行缓存对象关键词包装,生成所述业务请求对应的查询关键词,其中,所述缓存服务器根据所述查询关键词查询得到所述业务请求对应的资源。
  8. 根据权利要求7所述的装置,其特征在于,所述访问处理模块:
    远程访问模块,用于在所述远程访问路径的优先级高于所述分布缓存路径的情况下,直接选择通过所述远程访问路径访问所述远程服务器,获取所述业务请求对应的资源;或者
    分布式缓存访问模块,用于在所述分布缓存路径的优先级高于所述远程访问路径的情况下,优先选择通过所述分布缓存路径访问所述分布式缓存服务器,来获取所述业务请求对应的资源,在提取所述分布缓存路径失败的情况下,切换至选择所述远程访问路径访问所述分布式缓存服务器,来获取所述业务请求对应的资源。
  9. 一种数据资源的获取系统,其特征在于,包括:
    分布式缓存服务器;
    远程服务器;
    配置服务器,保存预先配置的查询路径信息和缓存配置信息;
    客户端,与所述配置服务器建立通信关系,用于从所述配置服务器获取预先配置的查询路径信息和缓存配置信息,所述查询路径信息包括:用于访问分布式缓存服务器的分布缓存路径和用于访问远程服务器的远程访问路径;
    其中,所述客户端在接收到业务请求之后,通过所述查询路径信息选择访问所述分布式缓存服务器或所述远程服务器,并根据所述缓存配置信息查询得到所述业务请求对应的资源,其中,在从所述分布式缓存服务器获取所述资源失败的情况下,选择调用所述远程访问路径切换为访问所述远程服务器,来获取所述资源。
  10. 根据权利要求9所述的系统,其特征在于,
    所述配置服务器包括:配置处理器,用于配置所述查询路径信息和所述缓存配置信息;
    所述客户端包括:客户端处理器,用于在所述查询路径信息为所述分布式缓存路径的情况下,通过所述缓存配置信息对所述业务请求中的查询标识进行缓存对象关键词包装,生成所述业务请求对应的查询关键词,其中,所述缓存服务器根据所述查询关键词查询得到所述业务请求对应的资源。
  11. 根据权利要求10所述的系统,其特征在于,直接选择通过所述远程访问路径访问所述远程服务器,获取所述业务请求对应的资源的步骤包括:
    依据所述远程访问路径发送所述业务请求至所述远程服务器;
    所述远程服务器根据所述业务请求从所述配置服务器中获取对应的模型配置信息和查询语句,其中,所述模型配置信息包括:用于表征所述业务请求对应的资源类型的领域模型,以及用于表征所述资源类型对应的资源信息表的数据模型;
    所述远程服务器根据所述查询语句和所述模型配置信息访问数据库,获取所述业务请求对应的所述资源。
  12. 根据权利要求10所述的系统,其特征在于,所述远程服务器包括:
    缓存重建处理器,用于从所述配置服务器获取所述缓存配置信息,并通过访问数据库获取到所述缓存配置信息对应的资源,在将所述缓存配置信息及其对应的资源组装成客户模型之后,将所述客户服务器保存至所述分布式缓存服务器。
PCT/CN2015/083248 2014-07-24 2015-07-03 数据资源的获取方法、装置和系统 WO2016011883A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410355937.0A CN105338026B (zh) 2014-07-24 2014-07-24 数据资源的获取方法、装置和系统
CN201410355937.0 2014-07-24

Publications (1)

Publication Number Publication Date
WO2016011883A1 true WO2016011883A1 (zh) 2016-01-28

Family

ID=55162495

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/083248 WO2016011883A1 (zh) 2014-07-24 2015-07-03 数据资源的获取方法、装置和系统

Country Status (3)

Country Link
CN (1) CN105338026B (zh)
HK (1) HK1218358A1 (zh)
WO (1) WO2016011883A1 (zh)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109583676A (zh) * 2018-09-11 2019-04-05 阿里巴巴集团控股有限公司 分布式系统中采集业务流程数据的方法、系统及其服务器
CN111176715A (zh) * 2019-12-16 2020-05-19 青岛聚看云科技有限公司 一种信息调用方法及服务器
CN112487326A (zh) * 2020-11-27 2021-03-12 杭州安恒信息技术股份有限公司 数据缓存方法、系统、存储介质及设备
CN112948666A (zh) * 2021-01-28 2021-06-11 浪潮云信息技术股份公司 一种将库表数据发布为api服务的实现方法
CN113568891A (zh) * 2021-08-05 2021-10-29 深圳墨世科技有限公司 分布式id生成方法、装置、服务器和可读存储介质
CN113656772A (zh) * 2021-07-26 2021-11-16 北京达佳互联信息技术有限公司 信息处理方法、装置、电子设备及存储介质
CN113760346A (zh) * 2020-08-25 2021-12-07 北京沃东天骏信息技术有限公司 信息管理方法和装置
CN115525686A (zh) * 2022-10-10 2022-12-27 中电金信软件有限公司 一种映射配置数据的缓存方法及装置

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106790458B (zh) * 2016-12-08 2021-05-18 Tcl科技集团股份有限公司 一种跨局域网的Memcache数据共享方法及系统
CN108255533B (zh) * 2016-12-28 2021-12-17 平安科技(深圳)有限公司 系统配置更改方法及装置
CN107729148A (zh) * 2017-10-13 2018-02-23 郑州云海信息技术有限公司 一种资源调用方法及装置
CN109784963A (zh) * 2017-11-14 2019-05-21 阿里巴巴集团控股有限公司 一种资源管理系统、方法、服务器及计算机存储介质
CN108153803B (zh) * 2017-11-17 2021-04-02 北京奇艺世纪科技有限公司 一种数据获取方法、装置及电子设备
CN109933413A (zh) * 2017-12-15 2019-06-25 北京嘀嘀无限科技发展有限公司 业务实现方法及装置、电子设备、存储介质
CN108777718B (zh) * 2018-06-22 2021-03-23 创新先进技术有限公司 一种业务系统通过客户端访问读多写少系统的方法和装置
CN108924210A (zh) * 2018-06-27 2018-11-30 杭州贝店科技有限公司 业务请求处理方法、装置、服务器及存储介质
CN110784498B (zh) * 2018-07-31 2022-05-27 阿里巴巴集团控股有限公司 一种个性化数据容灾方法及装置
CN110769072A (zh) * 2019-10-31 2020-02-07 北京达佳互联信息技术有限公司 一种多媒体资源获取方法、装置和存储介质
CN111125170A (zh) * 2019-12-22 2020-05-08 浪潮电子信息产业股份有限公司 一种微服务的跨服务数据获取方法、装置及微服务设备
CN111552666B (zh) * 2020-03-23 2021-02-26 苏州沁游网络科技有限公司 一种资源获取方法、装置、设备及存储介质
CN111475534B (zh) * 2020-05-12 2023-04-14 北京爱笔科技有限公司 一种数据查询方法及相关设备
CN112052264B (zh) * 2020-08-05 2021-08-10 北京五八信息技术有限公司 业务数据查询方法、装置、电子设备及可读存储介质
CN113868100A (zh) * 2021-10-27 2021-12-31 北京值得买科技股份有限公司 一种电商领域数据的自动化调度采集系统
CN115718767A (zh) * 2022-11-26 2023-02-28 河南大学 一种面向大数据平台的远程缓存替换方法及装置
CN116389593B (zh) * 2023-04-17 2024-01-23 阿里巴巴(中国)有限公司 资源的配置方法、系统和电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101764824A (zh) * 2010-01-28 2010-06-30 深圳市同洲电子股份有限公司 一种分布式缓存控制方法、装置及系统
CN102244685A (zh) * 2011-08-11 2011-11-16 中国科学院软件研究所 一种支持负载均衡的分布式缓存动态伸缩方法及系统
CN102289508A (zh) * 2011-08-31 2011-12-21 上海西本网络科技有限公司 分布式缓存阵列及其数据查询方法
WO2012171345A1 (zh) * 2011-06-13 2012-12-20 中兴通讯股份有限公司 临时故障时的数据修复方法及分布式缓存系统

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2513503A1 (en) * 2003-01-17 2004-08-12 Tacit Networks, Inc. Method and system for use of storage caching with a distributed file system
CN100585662C (zh) * 2003-06-20 2010-01-27 汤姆森普罗梅特里克公司 利用高速缓存和可高速缓存对象扩展测试驱动应用程序的功能的基于计算机测试的系统和方法
US8151323B2 (en) * 2006-04-12 2012-04-03 Citrix Systems, Inc. Systems and methods for providing levels of access and action control via an SSL VPN appliance
CN101316226B (zh) * 2007-06-01 2011-11-02 阿里巴巴集团控股有限公司 一种获取资源的方法、装置及系统
CN101854378B (zh) * 2010-02-26 2013-02-13 深圳市龙视传媒有限公司 一种数据操作方法和数据操作设备
CN103020115A (zh) * 2012-11-13 2013-04-03 深圳市同洲电子股份有限公司 一种数据缓存的方法、缓存服务器及系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101764824A (zh) * 2010-01-28 2010-06-30 深圳市同洲电子股份有限公司 一种分布式缓存控制方法、装置及系统
WO2012171345A1 (zh) * 2011-06-13 2012-12-20 中兴通讯股份有限公司 临时故障时的数据修复方法及分布式缓存系统
CN102244685A (zh) * 2011-08-11 2011-11-16 中国科学院软件研究所 一种支持负载均衡的分布式缓存动态伸缩方法及系统
CN102289508A (zh) * 2011-08-31 2011-12-21 上海西本网络科技有限公司 分布式缓存阵列及其数据查询方法

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109583676A (zh) * 2018-09-11 2019-04-05 阿里巴巴集团控股有限公司 分布式系统中采集业务流程数据的方法、系统及其服务器
CN111176715A (zh) * 2019-12-16 2020-05-19 青岛聚看云科技有限公司 一种信息调用方法及服务器
CN113760346A (zh) * 2020-08-25 2021-12-07 北京沃东天骏信息技术有限公司 信息管理方法和装置
CN112487326A (zh) * 2020-11-27 2021-03-12 杭州安恒信息技术股份有限公司 数据缓存方法、系统、存储介质及设备
CN112487326B (zh) * 2020-11-27 2024-03-19 杭州安恒信息技术股份有限公司 数据缓存方法、系统、存储介质及设备
CN112948666A (zh) * 2021-01-28 2021-06-11 浪潮云信息技术股份公司 一种将库表数据发布为api服务的实现方法
CN113656772A (zh) * 2021-07-26 2021-11-16 北京达佳互联信息技术有限公司 信息处理方法、装置、电子设备及存储介质
CN113568891A (zh) * 2021-08-05 2021-10-29 深圳墨世科技有限公司 分布式id生成方法、装置、服务器和可读存储介质
CN113568891B (zh) * 2021-08-05 2024-02-20 深圳墨世科技有限公司 分布式id生成方法、装置、服务器和可读存储介质
CN115525686A (zh) * 2022-10-10 2022-12-27 中电金信软件有限公司 一种映射配置数据的缓存方法及装置

Also Published As

Publication number Publication date
CN105338026A (zh) 2016-02-17
CN105338026B (zh) 2018-10-09
HK1218358A1 (zh) 2017-02-10

Similar Documents

Publication Publication Date Title
WO2016011883A1 (zh) 数据资源的获取方法、装置和系统
US9672053B2 (en) Service request processing
US11012892B2 (en) Resource obtaining method, apparatus, and system
CN107590001B (zh) 负载均衡方法及装置、存储介质、电子设备
JP7014887B2 (ja) Pduタイプ設定方法、ueポリシー設定方法、および関連エンティティ
RU2673403C2 (ru) Способ доступа к веб-узлам, устройство и система веб-узла
US20240031309A1 (en) Data Processing Method, Apparatus, Device and Storage Medium
US20200322867A1 (en) Data Routing Method and Terminal
US10069928B1 (en) Translating requests/responses between communication channels having different protocols
EP3800918B1 (en) Communication method and apparatus
US9432484B1 (en) CIM-based data storage management system having a restful front-end
US20210026692A1 (en) Systems and methods providing serverless dns integration
CN109792596B (zh) 用于通信网络中统一数据管理的系统和方法
CN113596110A (zh) 一种面向异构云的云原生微服务平台
EP2778968A1 (en) Mobile telecommunication device remote access to cloud-based or virtualized database systems
US9952888B2 (en) Method and system to dynamically instantiate virtual repository for any services
CN107210924A (zh) 用于配置通信系统的方法和设备
CN106790601A (zh) 服务地址的读取装置、系统和方法
WO2024104073A1 (zh) 一种元数据访问方法、装置和存储介质
CN107169047A (zh) 一种实现数据缓存的方法及装置
WO2017000616A1 (zh) 访问云数据的方法及装置、存储介质
CN112637126B (zh) 一种服务注册方法及Pod
US20220300503A1 (en) Querying distributed databases
CN108365976B (zh) 网络服务的优化方法及装置
CN113918129A (zh) 前后端分离的接口请求处理方法和装置

Legal Events

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

Ref document number: 15823963

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15823963

Country of ref document: EP

Kind code of ref document: A1