[go: up one dir, main page]

CN112948443A - Parameter using method, device, equipment and medium - Google Patents

Parameter using method, device, equipment and medium Download PDF

Info

Publication number
CN112948443A
CN112948443A CN202110351669.5A CN202110351669A CN112948443A CN 112948443 A CN112948443 A CN 112948443A CN 202110351669 A CN202110351669 A CN 202110351669A CN 112948443 A CN112948443 A CN 112948443A
Authority
CN
China
Prior art keywords
parameter
target
cache
server
cache server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110351669.5A
Other languages
Chinese (zh)
Inventor
冯烨辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
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 China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202110351669.5A priority Critical patent/CN112948443A/en
Publication of CN112948443A publication Critical patent/CN112948443A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0656Data buffering arrangements
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5055Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering software capabilities, i.e. software resources associated or available to the machine

Landscapes

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

Abstract

本发明实施例公开了一种参数使用方法、装置、设备及介质,涉及自动程序设计技术领域。该方法应用于参数使用方,包括:在执行目标操作的过程中,向参数缓存服务器发送参数加载请求;获取所述参数缓存服务器根据所述参数加载请求反馈的目标参数,并根据所述目标参数继续执行所述目标操作;其中,所述参数缓存服务器中的所述目标参数是在参数提供方的数据库服务器中加载的。上述技术方案减轻了参数使用方对参数提供方应用程序服务器和数据库服务器的访问压力。

Figure 202110351669

The embodiments of the present invention disclose a method, device, device and medium for using parameters, which relate to the technical field of automatic program design. The method is applied to a parameter user, and includes: in the process of performing a target operation, sending a parameter loading request to a parameter cache server; Continue to execute the target operation; wherein, the target parameter in the parameter cache server is loaded in the database server of the parameter provider. The above technical solution relieves the access pressure of the parameter user to the application server and the database server of the parameter provider.

Figure 202110351669

Description

参数使用方法、装置、设备及介质Parameter use method, device, equipment and medium

技术领域technical field

本发明实施例涉及自动程序设计技术领域,尤其涉及一种参数使用方法、装置、设备及介质。Embodiments of the present invention relate to the technical field of automatic program design, and in particular, to a method, apparatus, device, and medium for using parameters.

背景技术Background technique

随着利率市场化进程加速推进,“金融脱媒”加剧,金融新生业态在互联网技术的催生下快速迭代,在金融科技业务场景下,访问量经常会面临十倍、百倍的上涨,当数据库服务器面临大规模数据访问时,磁盘I/O(输入/输出)往往成为性能瓶颈。在分布式场景存在高并发、高可扩展性和高可用性的需求下,如何减轻参数使用方对参数提供方应用程序服务器和数据库服务器的访问压力,是亟待解决的问题。With the accelerated process of interest rate liberalization and the intensification of "financial disintermediation", the new financial business forms are rapidly iterated under the birth of Internet technology. In the financial technology business scenario, the number of visits often faces a ten-fold or a hundred-fold increase. When the database server When faced with large-scale data access, disk I/O (input/output) often becomes a performance bottleneck. Under the requirements of high concurrency, high scalability and high availability in distributed scenarios, how to reduce the access pressure of parameter users to the application server and database server of parameter providers is an urgent problem to be solved.

发明内容SUMMARY OF THE INVENTION

本发明实施例提供一种参数使用方法、装置、设备及介质,以减轻参数使用方对参数提供方应用程序服务器和数据库服务器的访问压力。Embodiments of the present invention provide a method, apparatus, device, and medium for using parameters, so as to reduce the access pressure of the parameter user to the application server and database server of the parameter provider.

第一方面,本发明实施例提供了一种参数使用方法,应用于参数使用方,包括:In a first aspect, an embodiment of the present invention provides a method for using parameters, which is applied to a parameter user, including:

在执行目标操作的过程中,向参数缓存服务器发送参数加载请求;In the process of executing the target operation, send a parameter loading request to the parameter cache server;

获取所述参数缓存服务器根据所述参数加载请求反馈的目标参数,并根据所述目标参数继续执行所述目标操作;其中,所述参数缓存服务器中的所述目标参数是在参数提供方的数据库服务器中加载的。Acquire the target parameter fed back by the parameter cache server according to the parameter loading request, and continue to perform the target operation according to the target parameter; wherein, the target parameter in the parameter cache server is in the database of the parameter provider loaded on the server.

第二方面,本发明实施例提供了一种参数使用方法,应用于参数缓存服务器,包括:In a second aspect, an embodiment of the present invention provides a method for using parameters, which is applied to a parameter cache server, including:

接收参数使用方在执行目标操作的过程中发送的参数加载请求;Receive the parameter loading request sent by the parameter user during the execution of the target operation;

响应于所述参数加载请求,为所述参数使用方提供在参数提供方的数据库服务器中加载的目标参数,以使所述参数提供方根据所述目标参数继续执行所述目标操作。In response to the parameter loading request, the parameter consumer is provided with the target parameter loaded in the database server of the parameter provider, so that the parameter provider continues to perform the target operation according to the target parameter.

第三方面,本发明实施例还提供了一种参数使用装置,应用于参数使用方,包括:In a third aspect, an embodiment of the present invention also provides a parameter using device, which is applied to a parameter user, including:

参数加载请求发送模块,用于在执行目标操作的过程中,向参数缓存服务器发送参数加载请求;The parameter loading request sending module is used to send a parameter loading request to the parameter cache server in the process of executing the target operation;

参数加载使用模块,用于获取所述参数缓存服务器根据所述参数加载请求反馈的目标参数,并根据所述目标参数继续执行所述目标操作;其中,所述参数缓存服务器中的所述目标参数是在参数提供方的数据库服务器中加载的。A parameter loading and use module, configured to obtain the target parameter fed back by the parameter cache server according to the parameter loading request, and continue to perform the target operation according to the target parameter; wherein, the target parameter in the parameter cache server is loaded in the parameter provider's database server.

第四方面,本发明实施例还提供了一种参数使用装置,应用于参数缓存服务器,包括:In a fourth aspect, an embodiment of the present invention further provides a parameter use device, which is applied to a parameter cache server, including:

参数加载请求接收模块,用于接收参数使用方在执行目标操作的过程中发送的参数加载请求;The parameter loading request receiving module is used to receive the parameter loading request sent by the parameter user in the process of executing the target operation;

参数提供模块,用于响应于所述参数加载请求,为所述参数使用方提供在参数提供方的数据库服务器中加载的目标参数,以使所述参数提供方根据所述目标参数继续执行所述目标操作。A parameter providing module, configured to, in response to the parameter loading request, provide the parameter consumer with the target parameter loaded in the database server of the parameter provider, so that the parameter provider continues to execute the parameter according to the target parameter target action.

第五方面,本发明实施例还提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如本发明任意实施例所述的应用于参数使用方的参数使用方法。In a fifth aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored in the memory and running on the processor, the processor implementing the program as described in the present invention when the processor executes the program The parameter usage method described in any embodiment is applied to the parameter user.

第六方面,本发明实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如本发明任意实施例所述的应用于参数使用方的参数使用方法。In a sixth aspect, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, implements the parameter applied to the parameter user according to any embodiment of the present invention Instructions.

第七方面,本发明实施例还提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如本发明任意实施例所述的应用于参数缓存服务器的参数使用方法。In a seventh aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored in the memory and running on the processor, the processor implementing the program as described in the present invention when the processor executes the program The parameter usage method described in any embodiment is applied to the parameter cache server.

第八方面,本发明实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如本发明任意实施例所述的应用于参数缓存服务器的参数使用方法。In an eighth aspect, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, implements the parameters applied to the parameter cache server according to any embodiment of the present invention Instructions.

本发明实施例提供的技术方案,参数缓存服务器在参数提供方的数据库服务器中加载目标参数,在参数使用方执行目标操作需要获取目标参数时,在参数缓存服务器中加载目标参数以执行所述目标操作,以此减轻了参数使用方对参数提供方应用程序服务器和数据库服务器的访问压力,提升了系统整体的可用性和可靠性。In the technical solution provided by the embodiment of the present invention, the parameter cache server loads the target parameters in the database server of the parameter provider, and when the parameter user performs the target operation and needs to obtain the target parameters, the parameter cache server loads the target parameters to execute the target parameters. operation, thereby reducing the access pressure of the parameter user to the application server and database server of the parameter provider, and improving the overall availability and reliability of the system.

附图说明Description of drawings

图1是本发明实施例一中的一种参数使用方法的流程图;1 is a flowchart of a method for using parameters in Embodiment 1 of the present invention;

图2是本发明实施例二中的一种参数使用方法的流程图;Fig. 2 is the flow chart of a kind of parameter using method in the second embodiment of the present invention;

图3是本发明实施例三中的一种参数使用方法所适用的多级缓存机制启动加载的流程示意图;3 is a schematic flowchart of a multi-level cache mechanism to start loading to which a method for using parameters in Embodiment 3 of the present invention is applied;

图4是本发明实施例四中的一种参数使用装置的结构示意图;4 is a schematic structural diagram of a parameter using device in Embodiment 4 of the present invention;

图5是本发明实施例五中的一种参数使用装置的结构示意图;5 is a schematic structural diagram of a parameter using device in Embodiment 5 of the present invention;

图6是本发明实施例六中的一种计算机设备的硬件结构示意图。FIG. 6 is a schematic diagram of a hardware structure of a computer device in Embodiment 6 of the present invention.

具体实施方式Detailed ways

下面结合附图和实施例对本发明作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本发明,而非对本发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部结构。The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention. In addition, it should be noted that, for the convenience of description, the drawings only show some but not all structures related to the present invention.

在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各项操作(或步骤)描述成顺序的处理,但是其中的许多操作可以被并行地、并发地或者同时实施。此外,各项操作的顺序可以被重新安排。当其操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。Before discussing the exemplary embodiments in greater detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart depicts various operations (or steps) as a sequential process, many of the operations may be performed in parallel, concurrently, or concurrently. Additionally, the order of operations can be rearranged. The process may be terminated when its operation is complete, but may also have additional steps not included in the figures. The processes may correspond to methods, functions, procedures, subroutines, subroutines, and the like.

实施例一Example 1

图1是本发明实施例一提供的一种参数使用方法的流程图,可适用于对参数进行多级缓存的情况,该方法可以由本发明实施例提供的应用于参数使用方的参数使用装置来执行,该装置可采用软件和/或硬件的方式实现,并一般可集成在计算机设备中。1 is a flowchart of a method for using parameters provided in Embodiment 1 of the present invention, which is applicable to the case of performing multi-level caching of parameters. For implementation, the apparatus can be implemented in software and/or hardware, and can generally be integrated in computer equipment.

参数,也叫参变量,是一个变量。对指定应用而言,它可以是赋予的常数值;在泛指时,它可以是一种变量,用来控制随其变化而变化的其他的量(或事件)。A parameter, also called a parameter variable, is a variable. For a given application, it can be an assigned constant value; in general, it can be a variable that controls other quantities (or events) that change with it.

参数使用方指的是使用参数的一方,参数提供方指的是提供参数的一方,二者均是应用层概念。The parameter user refers to the party that uses the parameter, and the parameter provider refers to the party that provides the parameter. Both are application layer concepts.

如图1所示,本实施例提供的参数使用方法,应用于参数使用方,具体包括:As shown in FIG. 1 , the parameter usage method provided in this embodiment is applied to the parameter user, and specifically includes:

S110、在执行目标操作的过程中,向参数缓存服务器发送参数加载请求。S110. In the process of executing the target operation, send a parameter loading request to the parameter cache server.

目标操作,指的是任意一种操作,具体可以是任意一种程序。以金融业务为例,目标操作可以是转账操作、取款操作等。The target operation refers to any kind of operation, which can be any kind of program. Taking financial business as an example, the target operation can be transfer operation, withdrawal operation, etc.

参数缓存服务器,指的是用于对参数进行缓存的服务器,例如可以是基于Redis的参数缓存服务器或者是基于cache的参数缓存服务器。The parameter cache server refers to a server for caching parameters, for example, a Redis-based parameter cache server or a cache-based parameter cache server.

在参数使用方执行目标操作的过程中,如果需要读取目标参数(目标操作过程中涉及的任意一种参数),则可以向参数缓存服务器发送参数加载请求,以在参数缓存服务器中获取所述目标参数。其中,参数加载请求中携带需要读取的目标参数的唯一标识信息。可选的,目标参数可以是使用频率较高的参数。In the process of the parameter user performing the target operation, if the target parameter (any parameter involved in the target operation process) needs to be read, a parameter loading request can be sent to the parameter cache server to obtain the parameter cache server. target parameter. The parameter loading request carries the unique identification information of the target parameter that needs to be read. Optionally, the target parameter may be a parameter that is frequently used.

可选的,在向参数缓存服务器发送参数加载请求之前,还包括:在配置中心读取参数缓存配置信息;相应的,向参数缓存服务器发送参数加载请求,可以具体为:根据所述参数缓存配置信息向所述参数缓存服务器发送参数加载请求。Optionally, before sending the parameter loading request to the parameter cache server, it further includes: reading the parameter cache configuration information in the configuration center; correspondingly, sending the parameter loading request to the parameter cache server, which may be specifically: according to the parameter cache configuration The information sends a parameter loading request to the parameter cache server.

配置中心,用于存储与参数使用方法相关的配置信息,例如可以是服务器的IP地址信息、端口信息、相关服务的url等。可选的,配置中心存储的配置信息可以包括参数缓存配置信息、参数存储配置信息等。其中,参数缓存配置信息可以用于访问数缓存服务器以在所述参数缓存服务器中获取相关的参数值;参数存储配置信息可以用于访问参数提供方的数据库服务器以将相应的参数进行缓存。其中,通过配置中心的操作界面可以对配置中心的配置信息新增和/或修改操作。The configuration center is used to store the configuration information related to the parameter usage method, such as the IP address information of the server, the port information, the url of the related service, and so on. Optionally, the configuration information stored in the configuration center may include parameter cache configuration information, parameter storage configuration information, and the like. The parameter cache configuration information can be used to access the data cache server to obtain relevant parameter values in the parameter cache server; the parameter storage configuration information can be used to access the database server of the parameter provider to cache the corresponding parameters. The configuration information of the configuration center can be added and/or modified through the operation interface of the configuration center.

在配置中心启动后,参数使用方在配置中心读取参数缓存配置信息。在需要访问参数缓存服务器获取目标参数时,根据读取到的参数缓存配置信息访问参数缓存服务器,并向参数缓存服务器发送参数加载请求。After the configuration center is started, the parameter user reads the parameter cache configuration information in the configuration center. When the parameter cache server needs to be accessed to obtain the target parameters, the parameter cache server is accessed according to the read parameter cache configuration information, and a parameter loading request is sent to the parameter cache server.

S120、获取参数缓存服务器根据参数加载请求反馈的目标参数,并根据目标参数继续执行所述目标操作;其中,所述参数缓存服务器中的目标参数是在参数提供方的数据库服务器中加载的。S120: Acquire the target parameters fed back by the parameter cache server according to the parameter loading request, and continue to perform the target operation according to the target parameters; wherein, the target parameters in the parameter cache server are loaded in the database server of the parameter provider.

参数缓存服务器在参数提供方的数据库服务器中预先加载目标参数,在接收到参数使用方发送的参数加载请求时,解析参数加载请求确定待反馈的目标参数,并将本地缓存的目标参数反馈给参数使用方。进而,在参数使用方获取到参数缓存服务器反馈的目标参数之后,即可以根据所述目标参数继续执行所述目标操作。The parameter cache server pre-loads the target parameters in the database server of the parameter provider. When receiving the parameter loading request sent by the parameter user, it parses the parameter loading request to determine the target parameters to be fed back, and feeds back the locally cached target parameters to the parameters. user. Furthermore, after the parameter user obtains the target parameter fed back by the parameter cache server, the target operation can be continued according to the target parameter.

在此过程中,参数使用方与参数提供方之间没有信息交互,而是与参数缓存服务器进行信息交互,以此减轻了对参数提供方的应用程序服务器和数据库服务器的访问压力。尤其是大量参数使用方对应于同一个参数提供方时,设置参数缓存服务器为参数使用方提供参数,能够极大地减轻对参数提供方应用程序服务器和数据库服务器的访问压力。In this process, there is no information exchange between the parameter consumer and the parameter provider, but information exchange with the parameter cache server, thereby reducing the access pressure to the parameter provider's application server and database server. Especially when a large number of parameter consumers correspond to the same parameter provider, setting the parameter cache server to provide parameters for the parameter consumers can greatly reduce the access pressure to the application server and database server of the parameter provider.

可选的,参数缓存服务器为分布式缓存服务器,支持弹性扩展,进而可以通过动态增加或减少节点数量来应对变化的数据访问负载,利用参数就近访问的原则,也能间接提升系统的整体吞吐量,能够满足高并发、高扩展、高可用的需求。Optionally, the parameter cache server is a distributed cache server, which supports elastic expansion, and can then dynamically increase or decrease the number of nodes to cope with the changing data access load. By using the principle of parameter proximity access, the overall throughput of the system can also be indirectly improved. , which can meet the requirements of high concurrency, high expansion, and high availability.

可选的,参数缓存服务器在为参数使用方提供在参数提供方的数据库服务器中加载的目标参数之前,在配置中心读取参数存储配置信息,并根据所述参数存储配置信息访问所述参数提供方的数据库服务器加载所述目标参数。Optionally, before providing the parameter user with the target parameters loaded in the database server of the parameter provider, the parameter cache server reads the parameter storage configuration information in the configuration center, and accesses the parameter provider according to the parameter storage configuration information. The party's database server loads the target parameters.

在配置中心启动后,参数缓存服务器在配置中心读取参数存储配置信息。在需要访问参数提供方的数据库服务器加载目标参数时,根据读取到的参数存储配置信息访问参数提供方的数据库服务器,在所述数据库服务器中加载所述目标参数。After the configuration center is started, the parameter cache server reads the parameter storage configuration information in the configuration center. When the database server that needs to access the parameter provider loads the target parameters, the database server of the parameter provider is accessed according to the read parameter storage configuration information, and the target parameters are loaded in the database server.

作为一种可选的实施方式,在获取所述参数缓存服务器根据所述参数加载请求反馈的目标参数之后,还包括:如果所述目标参数满足预设条件,则将所述目标参数存入本地缓存。As an optional implementation manner, after acquiring the target parameter fed back by the parameter cache server according to the parameter loading request, the method further includes: if the target parameter satisfies a preset condition, storing the target parameter in a local cache.

参数使用方在获取到目标参数之后,判断所述目标参数是否满足预设条件,若是,将所述目标参数进行本地缓存,若否,则不做处理。其中,预设条件指的是适宜本地缓存的条件,例如可以是参数值是常数值且参数使用频率大于预设阈值。After acquiring the target parameter, the parameter user determines whether the target parameter satisfies the preset condition, and if so, caches the target parameter locally, and if not, does not process the target parameter. The preset condition refers to a condition suitable for local caching, for example, the parameter value may be a constant value and the parameter usage frequency is greater than the preset threshold value.

作为一种可选的实施方式,向参数缓存服务器发送参数加载请求,可以具体为:向所述参数缓存服务器的参数访问接口发送参数加载请求;相应的,获取所述参数缓存服务器反馈的目标参数,可以具体为:如果通过所述参数访问接口根据所述参数加载请求反馈的参数加载响应指示所述参数缓存服务器未存储所述目标参数,则等待所述参数缓存服务器在所述参数提供方的数据库服务器中加载所述目标参数之后通过所述参数访问接口再次反馈参数加载响应;获取通过所述参数访问接口再次反馈的参数加载响应中携带的所述目标参数。As an optional implementation manner, sending a parameter loading request to a parameter caching server may specifically include: sending a parameter loading request to a parameter access interface of the parameter caching server; correspondingly, acquiring the target parameters fed back by the parameter caching server can be specifically as follows: if the parameter loading response fed back by the parameter access interface according to the parameter loading request indicates that the parameter cache server does not store the target parameter, wait for the parameter cache server After the target parameter is loaded in the database server, the parameter loading response is fed back again through the parameter access interface; the target parameter carried in the parameter loading response fed back again through the parameter access interface is acquired.

在本实施方式中,参数缓存服务器提供通用的参数访问接口,对于所有的参数使用方都是透明的,用于接收参数使用方发送的参数加载请求,并对参数加载请求进行响应。In this embodiment, the parameter cache server provides a general parameter access interface, which is transparent to all parameter users, and is used to receive a parameter loading request sent by the parameter user, and respond to the parameter loading request.

参数使用方向参数缓存服务器的参数访问接口发送参数加载请求,参数缓存服务器的参数访问接口接收到参数加载请求之后,解析参数加载请求,获取与参数加载请求匹配的目标参数,生成携带目标参数的参数加载响应反馈给参数使用方。The parameter uses the parameter access interface of the parameter cache server to send a parameter load request. After the parameter access interface of the parameter cache server receives the parameter load request, it parses the parameter load request, obtains the target parameters that match the parameter load request, and generates parameters that carry the target parameters. The loading response is fed back to the parameter consumer.

在对参数加载请求解析之后,参数缓存服务器如果在本地缓存中查找不到与参数加载请求匹配的目标参数,则可以首先向参数使用方反馈用于指示参数缓存服务器未存储所述目标参数的参数加载响应,以指示参数使用方等待其去参数提供方的数据库服务器中加载,同时访问参数提供方的数据库服务器执行对所述目标参数的加载操作,并在加载完成后生成携带目标参数的参数加载响应反馈给参数使用方。After parsing the parameter loading request, if the parameter caching server cannot find a target parameter matching the parameter loading request in the local cache, it may first feed back the parameter used to indicate that the parameter caching server does not store the target parameter to the parameter user Loading response to instruct the parameter user to wait for it to be loaded from the database server of the parameter provider, and at the same time access the database server of the parameter provider to perform the loading operation on the target parameter, and generate a parameter load carrying the target parameter after the loading is completed The response is fed back to the parameter consumer.

参数使用方在接收到参数缓存服务器反馈的参数加载响应之后,如果所述参数加载响应指示参数缓存服务器未存储所述目标参数,则可以进行等待参数缓存服务器再次发送携带目标参数的参数加载响应。After receiving the parameter loading response fed back by the parameter caching server, if the parameter loading response indicates that the parameter caching server does not store the target parameters, the parameter user can wait for the parameter caching server to send the parameter loading response carrying the target parameters again.

可选的,所述参数访问接口支持键值对(Key-Value)操作。Optionally, the parameter access interface supports a key-value pair (Key-Value) operation.

在参数加载请求中,可以携带待加载的参数的Key值,参数缓存服务器通过参数访问接口对接收到的参数加载请求进行解析,得到携带待加载的参数的Key值,进而根据该Key值在本地缓存中查询对应的Value值,或者根据该Key值在参数提供方的数据库服务器中查询对应的Value值加载到本地缓存中,进而可以根据该Value值生成参数加载响应反馈给参数使用方。In the parameter loading request, the key value of the parameter to be loaded can be carried. The parameter cache server parses the received parameter loading request through the parameter access interface, obtains the key value carrying the parameter to be loaded, and then according to the key value locally The corresponding Value value is queried in the cache, or the corresponding Value value is queried in the database server of the parameter provider according to the Key value and loaded into the local cache, and then the parameter loading response can be generated according to the Value value and fed back to the parameter user.

其中,参数缓存服务器中的缓存记录可以通过参数访问接口进行相应处理的。可选的,响应于缓存记录处理请求,参数缓存服务器通过参数访问接口执行与所述缓存记录处理请求匹配的操作;所述缓存记录处理请求至少包括:缓存记录新增请求、缓存记录删除请求、缓存记录更新请求,缓存记录查询请求。The cache records in the parameter cache server can be processed correspondingly through the parameter access interface. Optionally, in response to a cache record processing request, the parameter cache server performs an operation matching the cache record processing request through a parameter access interface; the cache record processing request includes at least: a cache record addition request, a cache record deletion request, Cache record update request, cache record query request.

参数缓存服务器在响应缓存记录新增请求时,可以每次新增一条缓存记录,也可以批量新增多条缓存记录,并统计缓存记录新增数量。其中,具体可以根据目标参数的Key值和Value值进行缓存记录新增处理。可选的,在新增缓存记录时,还可以携带新增参数的失效时间(单位可以是毫秒级)。如果参数缓存服务器中已存在与缓存记录新增请求匹配的缓存记录,则可以对已有缓存记录进行覆盖处理。When the parameter cache server responds to a request for adding a cache record, it can add one cache record at a time, or it can add multiple cache records in batches, and count the number of new cache records. Specifically, the cache record addition process may be performed according to the Key value and the Value value of the target parameter. Optionally, when adding a cache record, the expiration time of the newly added parameter may also be carried (the unit may be milliseconds). If a cache record matching the request for adding a cache record already exists in the parameter cache server, the existing cache record can be overwritten.

参数缓存服务器在响应缓存记录删除请求时,可以每次删除一条缓存记录,也可以批量删除多条缓存记录,并统计缓存记录删除数量。其中,具体可以根据目标参数的Key值进行缓存记录删除处理。When the parameter cache server responds to a cache record deletion request, it can delete one cache record at a time, or delete multiple cache records in batches, and count the number of cache records deleted. Specifically, the cache record deletion process may be performed according to the Key value of the target parameter.

参数缓存服务器在响应缓存记录更新请求时,可以是参数Key值相同的情况下,新增Value值或者使用Value更新值替换Value源值。在参数Key值相同的情况下新增Value值的情形下,如果参数缓存服务器中已存在与缓存记录更新请求中Key值及新增Value值匹配的缓存记录,则可以忽略缓存记录更新请求。在参数Key值相同的情况下使用Value更新值替换Value源值的情形下,如果参数缓存服务器中不存在与缓存记录更新请求中Key值匹配的缓存记录,则可以忽略缓存记录更新请求。在参数Key值相同的情况下使用Value更新值替换Value源值的情形下,缓存记录更新请求中还可以携带Value源值,只有在参数缓存服务器中存在与Key值及Value源值匹配的缓存记录时,才使用相应的Value更新值对Value源值进行替换。When the parameter cache server responds to the cache record update request, it may add a Value value or replace the Value source value with the Value update value when the parameter Key value is the same. In the case of adding a Value value while the parameter Key value is the same, if a cache record matching the Key value and the new Value value in the cache record update request already exists in the parameter cache server, the cache record update request can be ignored. In the case where the value of the parameter key is the same as the value of the value source, if there is no cache record matching the key value in the cache record update request in the parameter cache server, the cache record update request can be ignored. In the case of replacing the Value source value with the Value update value when the parameter Key value is the same, the cache record update request can also carry the Value source value, only if there is a cache record matching the Key value and the Value source value in the parameter cache server When the corresponding Value update value is used to replace the Value source value.

参数缓存服务器在响应缓存记录查询请求时,可以每次查询一条缓存记录,也可以批量查询多条缓存记录,具体可以根据目标参数的Key值进行缓存记录查询处理。其中,缓存记录查询请求可以是根据参数缓存服务器接收到参数加载请求生成的。When the parameter cache server responds to a cache record query request, it can query one cache record at a time, or query multiple cache records in batches. Specifically, the cache record query processing can be performed according to the key value of the target parameter. The cache record query request may be generated according to the parameter loading request received by the parameter cache server.

另外,参数缓存服务器通过参数访问接口还可以实现所有缓存记录的清空处理,以及将正在队列中等待的缓存记录处理请求提交到数据持久层。In addition, the parameter cache server can also realize the clearing process of all cache records through the parameter access interface, and submit the cache record processing request waiting in the queue to the data persistence layer.

在一种可选的实施方式中,参数缓存服务器响应于参数更新请求,将所述参数缓存服务器中与所述参数更新请求匹配的缓存数据淘汰;在将与所述参数更新请求匹配的更新参数写入所述参数提供方的数据库服务器中之后,在所述参数提供方的数据库服务器中加载所述更新参数。In an optional implementation manner, the parameter cache server, in response to the parameter update request, eliminates the cached data in the parameter cache server that matches the parameter update request; After being written in the database server of the parameter provider, the update parameter is loaded in the database server of the parameter provider.

在进行参数更新时,采用先淘汰缓存再写数据库的方式。其中,参数缓存服务器在接收到参数更新请求时,首先将与所述参数更新请求中携带的待更新参数匹配的缓存数据淘汰,然后等待参数提供方的数据库服务器执行与参数更新请求匹配的参数更新操作,待存在参数使用方在参数缓存服务器中加载该参数时再将参数提供方的数据库服务器中对应的更新参数加载到本地缓存。When updating parameters, the cache is eliminated first and then the database is written. Wherein, when the parameter cache server receives the parameter update request, it first eliminates the cached data matching the parameters to be updated carried in the parameter update request, and then waits for the database server of the parameter provider to execute the parameter update matching the parameter update request. Operation, when the parameter user loads the parameter in the parameter cache server, the corresponding update parameter in the database server of the parameter provider is loaded into the local cache.

在本实施方式中,采用先淘汰缓存再写数据库的方式,不会导致参数缓存服务器和数据库不一致的问题。In this embodiment, the method of first eliminating the cache and then writing the database will not cause the problem of inconsistency between the parameter cache server and the database.

本发明实施例提供的技术方案,参数缓存服务器在参数提供方的数据库服务器中加载目标参数,在参数使用方执行目标操作需要获取目标参数时,在参数缓存服务器中加载目标参数以执行所述目标操作,以此减轻了参数使用方对参数提供方应用程序服务器和数据库服务器的访问压力,提升了系统整体的可用性和可靠性。In the technical solution provided by the embodiment of the present invention, the parameter cache server loads the target parameters in the database server of the parameter provider, and when the parameter user performs the target operation and needs to obtain the target parameters, the parameter cache server loads the target parameters to execute the target parameters. operation, thereby reducing the access pressure of the parameter user to the application server and database server of the parameter provider, and improving the overall availability and reliability of the system.

实施例二Embodiment 2

图2是本发明实施例二提供的一种参数使用方法的流程图,可适用于对参数进行多级缓存的情况,该方法可以由本发明实施例提供的应用于参数缓存服务器的参数使用装置来执行,该装置可采用软件和/或硬件的方式实现,并一般可集成在计算机设备中。2 is a flowchart of a method for using parameters provided in Embodiment 2 of the present invention, which is applicable to the case of performing multi-level caching of parameters. For implementation, the apparatus can be implemented in software and/or hardware, and can generally be integrated in computer equipment.

如图2所示,本实施例提供的参数使用方法,应用于参数缓存服务器,具体包括:As shown in FIG. 2 , the parameter usage method provided in this embodiment is applied to the parameter cache server, and specifically includes:

S210、接收参数使用方在执行目标操作的过程中发送的参数加载请求。S210. Receive a parameter loading request sent by the parameter user in the process of executing the target operation.

其中,参数缓存服务器,指的是用于对参数进行缓存的服务器,例如可以是基于Redis的参数缓存服务器或者是基于Cache的参数缓存服务器。The parameter cache server refers to a server for caching parameters, for example, a Redis-based parameter cache server or a Cache-based parameter cache server.

可选的,所述参数缓存服务器为分布式缓存服务器,支持弹性扩展,进而可以通过动态增加或减少节点数量来应对变化的数据访问负载。Optionally, the parameter cache server is a distributed cache server, which supports elastic expansion, and can further cope with the changing data access load by dynamically increasing or decreasing the number of nodes.

可选的,参数使用方在向参数缓存服务器发送参数加载请求之前,在配置中心读取参数缓存配置信息,并根据所述参数缓存配置信息向所述参数缓存服务器发送参数加载请求。Optionally, before sending the parameter loading request to the parameter caching server, the parameter user reads the parameter caching configuration information in the configuration center, and sends the parameter loading request to the parameter caching server according to the parameter caching configuration information.

S220、响应于所述参数加载请求,为所述参数使用方提供在参数提供方的数据库服务器中加载的目标参数,以使所述参数提供方根据所述目标参数继续执行所述目标操作。S220. In response to the parameter loading request, provide the parameter consumer with the target parameter loaded in the database server of the parameter provider, so that the parameter provider continues to perform the target operation according to the target parameter.

可选的,在为参数使用方提供在参数提供方的数据库服务器中加载的目标参数之前,还包括:在配置中心读取参数存储配置信息;根据所述参数存储配置信息访问所述参数提供方的数据库服务器加载所述目标参数。Optionally, before providing the parameter user with the target parameters loaded in the database server of the parameter provider, the method further includes: reading parameter storage configuration information in a configuration center; accessing the parameter provider according to the parameter storage configuration information. The database server loads the target parameters.

可选的,在参数使用方获取所述参数缓存服务器根据所述参数加载请求反馈的目标参数之后,如果所述目标参数满足预设条件,则可以将所述目标参数存入本地缓存。Optionally, after the parameter user obtains the target parameter fed back by the parameter cache server according to the parameter loading request, if the target parameter satisfies a preset condition, the target parameter may be stored in the local cache.

作为一种可选的实施方式,接收参数使用方在执行目标操作的过程中发送的参数加载请求,可以具体为:通过参数访问接口接收所述参数使用方在执行目标操作的过程中发送的参数加载请求;相应的,响应于所述参数加载请求,为所述参数使用方提供在参数提供方的数据库服务器中加载的目标参数,也可以具体为:如果确定所述参数缓存服务器未存储所述目标参数,则通过所述参数访问接口向所述参数使用方反馈指示所述参数缓存服务器未存储所述目标参数的参数加载响应,并执行在所述参数提供方的数据库服务器中加载所述目标参数的操作;在完成所述目标参数加载之后,通过所述参数访问接口向所述参数使用方再次反馈携带所述目标参数的参数加载响应。As an optional implementation manner, receiving the parameter loading request sent by the parameter user during the execution of the target operation may specifically include: receiving the parameters sent by the parameter user during the execution of the target operation through the parameter access interface Loading request; correspondingly, in response to the parameter loading request, provide the parameter user with the target parameter loaded in the database server of the parameter provider, which may also be specifically: if it is determined that the parameter cache server does not store the parameter target parameter, then feed back to the parameter user through the parameter access interface a parameter loading response indicating that the parameter cache server does not store the target parameter, and execute loading the target in the database server of the parameter provider parameter operation; after completing the loading of the target parameter, the parameter loading response carrying the target parameter is fed back to the parameter user again through the parameter access interface.

在本实施方式中,参数缓存服务器提供通用的参数访问接口,对于所有的参数使用方都是透明的,用于接收参数使用方发送的参数加载请求,并对参数加载请求进行响应。In this embodiment, the parameter cache server provides a general parameter access interface, which is transparent to all parameter users, and is used to receive a parameter loading request sent by the parameter user, and respond to the parameter loading request.

可选的,所述参数访问接口支持键值对操作。Optionally, the parameter access interface supports key-value pair operations.

在参数加载请求中,可以携带待加载的参数的Key值,参数缓存服务器通过参数访问接口对接收到的参数加载请求进行解析,得到携带待加载的参数的Key值,进而根据该Key值在本地缓存中查询对应的Value值,或者根据该Key值在参数提供方的数据库服务器中查询对应的Value值加载到本地缓存中,进而可以根据该Value值生成参数加载响应反馈给参数使用方。In the parameter loading request, the key value of the parameter to be loaded can be carried. The parameter cache server parses the received parameter loading request through the parameter access interface, obtains the key value carrying the parameter to be loaded, and then according to the key value locally The corresponding Value value is queried in the cache, or the corresponding Value value is queried in the database server of the parameter provider according to the Key value and loaded into the local cache, and then the parameter loading response can be generated according to the Value value and fed back to the parameter user.

可选的,参数缓存服务器响应于缓存记录处理请求,通过参数访问接口执行与所述缓存记录处理请求匹配的操作;所述缓存记录处理请求至少包括:缓存记录新增请求、缓存记录删除请求、缓存记录更新请求,缓存记录查询请求。Optionally, the parameter cache server, in response to the cache record processing request, executes an operation matching the cache record processing request through the parameter access interface; the cache record processing request at least includes: a cache record addition request, a cache record deletion request, Cache record update request, cache record query request.

可选的,参数缓存服务器响应于参数更新请求,将所述参数缓存服务器中与所述参数更新请求匹配的缓存数据淘汰;在将与所述参数更新请求匹配的更新参数写入所述参数提供方的数据库服务器中之后,在所述参数提供方的数据库服务器中加载所述更新参数。Optionally, the parameter cache server, in response to the parameter update request, eliminates the cached data matching the parameter update request in the parameter cache server; After that, the updated parameters are loaded in the database server of the parameter provider.

本实施例未尽详细解释之处请参见前述实施例,在此不再赘述。For details that are not explained in this embodiment, please refer to the foregoing embodiments, which will not be repeated here.

本发明实施例提供的技术方案,参数缓存服务器在参数提供方的数据库服务器中加载目标参数,在参数使用方执行目标操作需要获取目标参数时,在参数缓存服务器中加载目标参数以执行所述目标操作,以此减轻了参数使用方对参数提供方应用程序服务器和数据库服务器的访问压力,提升了系统整体的可用性和可靠性。In the technical solution provided by the embodiment of the present invention, the parameter cache server loads the target parameters in the database server of the parameter provider, and when the parameter user performs the target operation and needs to obtain the target parameters, the parameter cache server loads the target parameters to execute the target parameters. operation, thereby reducing the access pressure of the parameter user to the application server and database server of the parameter provider, and improving the overall availability and reliability of the system.

实施例三Embodiment 3

图3是本发明实施例三中的一种参数使用方法所适用的多级缓存机制启动加载的流程示意图。本实施例在前述实施例基础上提供一种具体的实施方式。FIG. 3 is a schematic flowchart of a multi-level cache mechanism to start loading to which a method for using parameters according to Embodiment 3 of the present invention is applied. This embodiment provides a specific implementation manner on the basis of the foregoing embodiment.

参照图3,本实施例提供的参数多级缓存机制通过参数使用方和参数提供方共同实现,缓存涉及参数使用方本地缓存、分布式缓存、参数提供方本地缓存和参数提供方数据库等多级缓存。其中,分布式缓存提供通用的处理模式和参数访问接口,使参数使用方无需关心具体的实现逻辑,在降低应用复杂度的同时,也减轻了参数使用方对参数提供方应用程序服务器和数据库服务器的访问压力,从而提升了系统整体的可用性和可靠性。Referring to FIG. 3 , the parameter multi-level caching mechanism provided by this embodiment is jointly implemented by the parameter user and the parameter provider, and the caching involves multiple levels such as the parameter user’s local cache, distributed cache, parameter provider’s local cache, and parameter provider’s database. cache. Among them, the distributed cache provides a general processing mode and parameter access interface, so that the parameter user does not need to care about the specific implementation logic. While reducing the application complexity, it also relieves the parameter user from the parameter provider application server and database server. access pressure, thereby improving the overall availability and reliability of the system.

如图3所示,本实施例提供的参数使用方法所适用的多级缓存机制启动加载的流程包括:As shown in FIG. 3 , the process of starting the loading of the multi-level cache mechanism to which the parameter usage method provided in this embodiment is applicable includes:

S310、参数提供方数据库服务器启动。S310, the parameter provider database server is started.

S320、配置中心启动。S320, the configuration center is started.

S330、分布式缓存服务器启动,并读取配置中心。S330, the distributed cache server is started, and the configuration center is read.

S340、分布式缓存服务器在参数提供方数据库服务器中加载参数。S340. The distributed cache server loads the parameters in the parameter provider database server.

S350、参数提供方应用服务器启动,并读取配置中心。S350, the parameter provider application server starts, and reads the configuration center.

S360、参数提供方应用服务器在参数提供方数据库服务器中加载参数。S360. The parameter provider application server loads the parameters in the parameter provider database server.

其中,针对参数提供方,将常用的参数加载到本地缓存中,也可以减少对参数提供方数据库服务器的访问压力。Among them, for the parameter provider, loading commonly used parameters into the local cache can also reduce the access pressure on the database server of the parameter provider.

S370、参数使用方应用服务器启动,并读取配置中心。S370, the parameter user application server is started, and the configuration center is read.

S380、参数使用方应用服务器在分布式缓存服务器加载参数。S380. The parameter user application server loads the parameter on the distributed cache server.

其中,参数使用方应用服务器的参数加载来源是分布式缓存服务器,分布式缓存服务器的参数加载来源是参数提供方数据库服务器,参数提供方数据库服务器的参数加载来源是其他模块,如Web管理端的批量导入或者单条维护。配置中心中存储参数缓存配置信息,可以包括参数缓存配置信息、参数存储配置信息等,不存储任何参数取值。Among them, the parameter loading source of the parameter user application server is the distributed cache server, the parameter loading source of the distributed cache server is the parameter provider database server, and the parameter loading source of the parameter provider database server is other modules, such as the batch of web management Import or single maintenance. The parameter cache configuration information is stored in the configuration center, which may include parameter cache configuration information, parameter storage configuration information, etc., and does not store any parameter values.

分布式缓存服务器,提供通用的参数访问接口,是独立于任何分布式缓存服务器产品的接口,对于所有的参数使用方都是透明的,用于接收参数使用方发送的参数加载请求,并对参数加载请求进行响应。其中,基于通用的参数访问接口开发的缓存操作应用可以在支持的分布式缓存服务器之间平滑切换。The distributed cache server provides a general parameter access interface. It is an interface independent of any distributed cache server product. It is transparent to all parameter users. Load request in response. Among them, the cache operation application developed based on the general parameter access interface can be smoothly switched between the supported distributed cache servers.

可选的,所述参数访问接口支持键值对(Key-Value)操作。其中,参数访问接口可以进行统一封装,支持多种缓存记录处理操作,包括缓存记录新增处理操作、缓存记录删除处理操作、缓存记录更新处理操作、缓存记录查询处理操作、缓存记录清空处理操作等。Optionally, the parameter access interface supports a key-value pair (Key-Value) operation. Among them, the parameter access interface can be uniformly encapsulated and supports various cache record processing operations, including cache record addition processing operations, cache record deletion processing operations, cache record update processing operations, cache record query processing operations, and cache record clearing processing operations, etc. .

本实施例未尽详细解释之处请参见前述实施例,在此不再赘述。For details that are not explained in this embodiment, please refer to the foregoing embodiments, which will not be repeated here.

本实施例提供的技术方案,设计了分布式核心的参数多级缓存机制,为应用层(参数使用方和参数提供方)提供统一的缓存访问接口及通信协议,使得应用层无需关心具体的实现逻辑,在降低应用复杂度的同时,也减轻了参数使用方对参数提供方应用服务器和数据库服务器的访问压力,提升了系统整体的可用性和可靠性,也为分布式核心在金融行业的落地打下了坚实的基础,不再需要依赖第三方产品,完全自主可控。In the technical solution provided by this embodiment, a distributed core parameter multi-level caching mechanism is designed to provide a unified cache access interface and communication protocol for the application layer (parameter user and parameter provider), so that the application layer does not need to care about the specific implementation Logic not only reduces the application complexity, but also reduces the access pressure of parameter users to the application server and database server of the parameter provider, improves the overall availability and reliability of the system, and lays the foundation for the implementation of the distributed core in the financial industry. With a solid foundation, it no longer needs to rely on third-party products, and is completely independent and controllable.

下述结合具体应用场景进行阐述:The following descriptions are combined with specific application scenarios:

在“单账户转账同时不能超过N笔”场景下,需要对转账次数进行统计,计数对于数据库来讲,是一个非常繁重的工作,需要查询大量的行,最后得出计数的结论,当数据改变的时候,又需要重新刷一遍,非常影响性能。此时,可以设计一个计数服务,将计数结果写到数据库中,并加载到分布式缓存服务器中,当数据有改变的时候,调用计数服务增加或者减少计数,并对数据库和分布式缓存服务器中的计数结果进行更新。在进行单账户转账操作的过程中,当需要获取单账户转账次数计数结果时,在分布式缓存服务器中进行加载,无需访问数据库,也不会通过数据库进行统计,以此减少了对参数提供方应用服务器和数据库服务器的访问压力。In the scenario of "single account transfers cannot exceed N transactions at the same time", the number of transfers needs to be counted. Counting is a very heavy task for the database, requiring a large number of rows to be queried, and finally the counting conclusion is drawn. When the data changes When it needs to be refreshed again, it will greatly affect the performance. At this point, you can design a counting service to write the counting results to the database and load them into the distributed cache server. When the data changes, call the counting service to increase or decrease the count, and to the database and distributed cache server. The count result is updated. In the process of single-account transfer operation, when it is necessary to obtain the count result of the number of single-account transfers, it is loaded in the distributed cache server, without accessing the database, nor through the database for statistics, which reduces the need for parameter providers. Access pressure on application servers and database servers.

在“列表排序分页”场景下,需要获得一些列表数据,并对这些数据进行排序和分页,例如,实时获取最频繁访问的数据进行排序和分页。在这种情况下,缓存里面的数据结构和数据库里面完全不一样。如果完全使用数据库进行实现,则按照某种条件将所有的行查询出来,按照某个字段进行排序后进行分页展示,当数据量比较大或者交易高峰的时候,此方式会严重影响性能。而在缓存里面,就没必要每行一个key值了,可以使用Redis的列表方式进行存储,当然列表的长短是有限制的,肯定放不下数据库里面这么多数据,但是用户或者客户往往可能只关心前几页的数据,数据条数也就几十或者几百,最多也就一千条左右,如果保持服务ID的话,列表完全放的下这些数据。此时,可以将数据库里已经排好序的数据放在分布式缓存服务器(Redis)中,进而在进行分页读取操作时,可以直接在分布式缓存服务器中加载数据取出列表,能够极大提升翻页查看的速度,无需访问数据库,以此减少了对参数提供方应用服务器和数据库服务器的访问压力。同时,后台还可以通过一个线程异步地初始化和刷新缓存,在分布式缓存服务器中保存一个数据时间戳,当有数据更新的时候,通过异步任务根据分布式缓存服务器中的数据时间戳触发缓存刷新操作。In the "list sorting and paging" scenario, you need to obtain some list data, sort and paginate the data, for example, sort and paginate the most frequently accessed data in real time. In this case, the data structure in the cache is completely different from that in the database. If the database is completely implemented, all rows will be queried according to a certain condition, sorted according to a certain field, and then displayed in pagination. When the amount of data is relatively large or the transaction peak, this method will seriously affect the performance. In the cache, there is no need to have a key value per line. You can use the Redis list method for storage. Of course, the length of the list is limited, and so much data in the database will definitely not fit, but users or customers may only care about For the data on the first few pages, the number of data items is only tens or hundreds, and the maximum is about 1,000. If the service ID is maintained, the list can completely put these data. At this time, the sorted data in the database can be placed in the distributed cache server (Redis), and then when the paging read operation is performed, the data retrieval list can be directly loaded in the distributed cache server, which can greatly improve the The speed of page turning and viewing does not need to access the database, thereby reducing the access pressure on the application server and database server of the parameter provider. At the same time, the background can also initialize and refresh the cache asynchronously through a thread, and save a data timestamp in the distributed cache server. When there is data update, the cache refresh is triggered according to the data timestamp in the distributed cache server through an asynchronous task. operate.

实施例四Embodiment 4

图4是本发明实施例四提供的一种参数使用装置的结构示意图,可适用于对参数进行多级缓存的情况,该装置可采用软件和/或硬件的方式实现,并一般可集成在计算机设备中。FIG. 4 is a schematic structural diagram of a parameter using device provided in Embodiment 4 of the present invention, which can be applied to the multi-level caching of parameters. The device can be implemented in software and/or hardware, and can generally be integrated in a computer. in the device.

如图4所示,该参数使用装置应用于参数使用方,具体包括:参数加载请求发送模块410和参数加载使用模块420。其中,As shown in FIG. 4 , the parameter using apparatus is applied to a parameter user, and specifically includes: a parameter loading request sending module 410 and a parameter loading and using module 420 . in,

参数加载请求发送模块410,用于在执行目标操作的过程中,向参数缓存服务器发送参数加载请求;A parameter loading request sending module 410, configured to send a parameter loading request to the parameter cache server in the process of executing the target operation;

参数加载使用模块420,用于获取所述参数缓存服务器根据所述参数加载请求反馈的目标参数,并根据所述目标参数继续执行所述目标操作;其中,所述参数缓存服务器中的所述目标参数是在参数提供方的数据库服务器中加载的。The parameter loading and using module 420 is configured to obtain the target parameter fed back by the parameter cache server according to the parameter loading request, and continue to perform the target operation according to the target parameter; wherein, the target in the parameter cache server Parameters are loaded in the parameter provider's database server.

本发明实施例提供的技术方案,参数缓存服务器在参数提供方的数据库服务器中加载目标参数,在参数使用方执行目标操作需要获取目标参数时,在参数缓存服务器中加载目标参数以执行所述目标操作,以此减轻了参数使用方对参数提供方应用程序服务器和数据库服务器的访问压力,提升了系统整体的可用性和可靠性。In the technical solution provided by the embodiment of the present invention, the parameter cache server loads the target parameters in the database server of the parameter provider, and when the parameter user performs the target operation and needs to obtain the target parameters, the parameter cache server loads the target parameters to execute the target parameters. operation, thereby reducing the access pressure of the parameter user to the application server and database server of the parameter provider, and improving the overall availability and reliability of the system.

可选的,上述装置还包括:参数本地缓存模块,用于在获取所述参数缓存服务器根据所述参数加载请求反馈的目标参数之后,如果所述目标参数满足预设条件,则将所述目标参数存入本地缓存。Optionally, the above device further includes: a parameter local cache module, configured to, after acquiring the target parameter fed back by the parameter cache server according to the parameter loading request, if the target parameter satisfies a preset condition, then Parameters are stored in the local cache.

可选的,上述装置还包括:参数缓存配置信息读取模块,用于在向参数缓存服务器发送参数加载请求之前,在配置中心读取参数缓存配置信息;相应的,参数加载请求发送模块410,具体用于在执行目标操作的过程中,根据所述参数缓存配置信息向所述参数缓存服务器发送参数加载请求。Optionally, the above device further includes: a parameter cache configuration information reading module, configured to read the parameter cache configuration information in the configuration center before sending the parameter loading request to the parameter cache server; correspondingly, the parameter loading request sending module 410, It is specifically configured to send a parameter loading request to the parameter cache server according to the parameter cache configuration information during the execution of the target operation.

可选的,向所述参数缓存服务器的参数访问接口发送参数加载请求;相应的,参数加载使用模块420,具体用于如果通过所述参数访问接口根据所述参数加载请求反馈的参数加载响应指示所述参数缓存服务器未存储所述目标参数,则等待所述参数缓存服务器在所述参数提供方的数据库服务器中加载所述目标参数之后通过所述参数访问接口再次反馈参数加载响应;获取通过所述参数访问接口再次反馈的参数加载响应中携带的所述目标参数。Optionally, send a parameter loading request to the parameter access interface of the parameter cache server; correspondingly, the parameter loading using module 420 is specifically used to indicate if the parameter loading response is fed back according to the parameter loading request through the parameter access interface. The parameter cache server does not store the target parameter, then waits for the parameter cache server to feed back the parameter loading response through the parameter access interface after loading the target parameter in the database server of the parameter provider; The target parameter carried in the parameter loading response fed back by the parameter access interface again.

可选的,所述参数访问接口支持键值对操作。Optionally, the parameter access interface supports key-value pair operations.

可选的,所述参数缓存服务器为分布式缓存服务器。Optionally, the parameter cache server is a distributed cache server.

上述应用于参数使用方的参数使用装置可执行本发明任意实施例所提供的应用于参数使用方的参数使用方法,具备执行应用于参数使用方的参数使用方法相应的功能模块和有益效果。The above-mentioned parameter using device applied to the parameter user can execute the parameter using method applied to the parameter user provided by any embodiment of the present invention, and has functional modules and beneficial effects corresponding to executing the parameter using method applied to the parameter user.

实施例五Embodiment 5

图5是本发明实施例五提供的一种参数使用装置的结构示意图,可适用于对参数进行多级缓存的情况,该装置可采用软件和/或硬件的方式实现,并一般可集成在计算机设备中。FIG. 5 is a schematic structural diagram of a parameter using device provided in Embodiment 5 of the present invention, which can be applied to the multi-level caching of parameters. The device can be implemented in software and/or hardware, and can generally be integrated in a computer. in the device.

如图5所示,该参数使用装置应用于参数缓存服务器,具体包括:参数加载请求接收模块510和参数提供模块520。其中,As shown in FIG. 5 , the parameter using apparatus is applied to a parameter cache server, and specifically includes: a parameter loading request receiving module 510 and a parameter providing module 520 . in,

参数加载请求接收模块510,用于接收参数使用方在执行目标操作的过程中发送的参数加载请求;A parameter loading request receiving module 510, configured to receive a parameter loading request sent by the parameter user in the process of performing the target operation;

参数提供模块520,用于响应于所述参数加载请求,为所述参数使用方提供在参数提供方的数据库服务器中加载的目标参数,以使所述参数提供方根据所述目标参数继续执行所述目标操作。The parameter providing module 520 is configured to, in response to the parameter loading request, provide the parameter user with the target parameter loaded in the database server of the parameter provider, so that the parameter provider can continue to execute the parameter according to the target parameter. Describe the target operation.

本发明实施例提供的技术方案,参数缓存服务器在参数提供方的数据库服务器中加载目标参数,在参数使用方执行目标操作需要获取目标参数时,在参数缓存服务器中加载目标参数以执行所述目标操作,以此减轻了参数使用方对参数提供方应用程序服务器和数据库服务器的访问压力,提升了系统整体的可用性和可靠性。In the technical solution provided by the embodiment of the present invention, the parameter cache server loads the target parameters in the database server of the parameter provider, and when the parameter user performs the target operation and needs to obtain the target parameters, the parameter cache server loads the target parameters to execute the target parameters. operation, thereby reducing the access pressure of the parameter user to the application server and database server of the parameter provider, and improving the overall availability and reliability of the system.

可选的,上述装置还包括:参数存储配置信息读取及参数加载模块,用于在为所述参数使用方提供在参数提供方的数据库服务器中加载的目标参数之前,在配置中心读取参数存储配置信息;根据所述参数存储配置信息访问所述参数提供方的数据库服务器加载所述目标参数。Optionally, the above-mentioned device further includes: a parameter storage configuration information reading and parameter loading module, which is used to read the parameters in the configuration center before providing the parameter user with the target parameters loaded in the database server of the parameter provider. storing configuration information; accessing the database server of the parameter provider to load the target parameter according to the parameter storage configuration information.

可选的,参数加载请求接收模块510,具体用于通过参数访问接口接收所述参数使用方在执行目标操作的过程中发送的参数加载请求;相应的,参数提供模块520,具体用于如果确定所述参数缓存服务器未存储所述目标参数,则通过所述参数访问接口向所述参数使用方反馈指示所述参数缓存服务器未存储所述目标参数的参数加载响应,并执行在所述参数提供方的数据库服务器中加载所述目标参数的操作;在完成所述目标参数加载之后,通过所述参数访问接口向所述参数使用方再次反馈携带所述目标参数的参数加载响应。Optionally, the parameter loading request receiving module 510 is specifically configured to receive, through the parameter access interface, the parameter loading request sent by the parameter user in the process of performing the target operation; correspondingly, the parameter providing module 520 is specifically configured to, if determined, The parameter cache server does not store the target parameter, then feed back to the parameter user through the parameter access interface a parameter loading response indicating that the parameter cache server does not store the target parameter, and execute the parameter provisioning response. The operation of loading the target parameters in the database server of the client; after the loading of the target parameters is completed, the parameter loading response carrying the target parameters is fed back to the parameter user through the parameter access interface again.

可选的,所述参数访问接口支持键值对操作。Optionally, the parameter access interface supports key-value pair operations.

可选的,所述参数缓存服务器为分布式缓存服务器。Optionally, the parameter cache server is a distributed cache server.

可选的,上述装置还包括:缓存记录处理模块,用于响应于缓存记录处理请求,通过参数访问接口执行与所述缓存记录处理请求匹配的操作;其中,所述缓存记录处理请求至少包括:缓存记录新增请求、缓存记录删除请求、缓存记录更新请求,缓存记录查询请求。Optionally, the above device further includes: a cache record processing module, configured to perform an operation matching the cache record processing request through a parameter access interface in response to the cache record processing request; wherein the cache record processing request includes at least: Cache record new request, cache record delete request, cache record update request, cache record query request.

可选的,上述装置还包括:缓存数据更新模块,用于响应于参数更新请求,将所述参数缓存服务器中与所述参数更新请求匹配的缓存数据淘汰;在将与所述参数更新请求匹配的更新参数写入所述参数提供方的数据库服务器中之后,在所述参数提供方的数据库服务器中加载所述更新参数。Optionally, the above-mentioned apparatus further includes: a cache data update module, configured to, in response to the parameter update request, eliminate the cache data matching the parameter update request in the parameter cache server; After the update parameters of the parameter provider are written into the database server of the parameter provider, the update parameters are loaded in the database server of the parameter provider.

上述应用于参数缓存服务器的参数使用装置可执行本发明任意实施例所提供的应用于参数缓存服务器的参数使用方法,具备执行应用于参数缓存服务器的参数使用方法相应的功能模块和有益效果。The above parameter using device applied to the parameter cache server can execute the parameter use method applied to the parameter cache server provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the parameter use method applied to the parameter cache server.

实施例六Embodiment 6

图6为本发明实施例六提供的一种计算机设备的硬件结构示意图。图6示出了适于用来实现本发明实施方式的示例性计算机设备12的框图。图6显示的计算机设备12仅仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。FIG. 6 is a schematic diagram of a hardware structure of a computer device according to Embodiment 6 of the present invention. Figure 6 shows a block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention. The computer device 12 shown in FIG. 6 is only an example, and should not impose any limitation on the function and scope of use of the embodiments of the present invention.

如图6所示,计算机设备12以通用计算设备的形式表现。计算机设备12的组件可以包括但不限于:一个或者多个处理器或者处理单元16,系统存储器28,连接不同系统组件(包括系统存储器28和处理单元16)的总线18。As shown in FIG. 6, computer device 12 takes the form of a general-purpose computing device. Components of computer device 12 may include, but are not limited to, one or more processors or processing units 16 , system memory 28 , and a bus 18 connecting various system components including system memory 28 and processing unit 16 .

总线18表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。举例来说,这些体系结构包括但不限于工业标准体系结构(ISA)总线,微通道体系结构(MAC)总线,增强型ISA总线、视频电子标准协会(VESA)局域总线以及外围组件互连(PCI)总线。Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of a variety of bus structures. By way of example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect ( PCI) bus.

计算机设备12典型地包括多种计算机系统可读介质。这些介质可以是任何能够被计算机设备12访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。Computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by computer device 12, including both volatile and nonvolatile media, removable and non-removable media.

系统存储器28可以包括易失性存储器形式的计算机系统可读介质,例如随机存取存储器(RAM)30和/或高速缓存存储器32。计算机设备12可以进一步包括其它可移动/不可移动的、易失性/非易失性计算机系统存储介质。仅作为举例,存储系统34可以用于读写不可移动的、非易失性磁介质(图6未显示,通常称为“硬盘驱动器”)。尽管图6中未示出,可以提供用于对可移动非易失性磁盘(例如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如CD-ROM,DVD-ROM或者其它光介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过一个或者多个数据介质接口与总线18相连。系统存储器28可以包括至少一个程序产品,该程序产品具有一组(例如至少一个)程序模块,这些程序模块被配置以执行本发明各实施例的功能。System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and/or cache memory 32 . Computer device 12 may further include other removable/non-removable, volatile/non-volatile computer system storage media. For example only, storage system 34 may be used to read and write to non-removable, non-volatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard drive"). Although not shown in Figure 6, a disk drive may be provided for reading and writing to removable non-volatile magnetic disks (eg "floppy disks"), as well as removable non-volatile optical disks (eg CD-ROM, DVD-ROM) or other optical media) to read and write optical drives. In these cases, each drive may be connected to bus 18 through one or more data media interfaces. System memory 28 may include at least one program product having a set (eg, at least one) of program modules configured to perform the functions of various embodiments of the present invention.

具有一组(至少一个)程序模块42的程序/实用工具40,可以存储在例如系统存储器28中,这样的程序模块42包括但不限于操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。程序模块42通常执行本发明所描述的实施例中的功能和/或方法。A program/utility 40 having a set (at least one) of program modules 42, which may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and programs Data, each or some combination of these examples may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods of the described embodiments of the present invention.

计算机设备12也可以与一个或多个外部设备14(例如键盘、指向设备、显示器24等)通信,还可与一个或者多个使得用户能与该计算机设备12交互的设备通信,和/或与使得该计算机设备12能与一个或多个其它计算设备进行通信的任何设备(例如网卡,调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口22进行。并且,计算机设备12还可以通过网络适配器20与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器20通过总线18与计算机设备12的其它模块通信。应当明白,尽管图6中未示出,可以结合计算机设备12使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。Computer device 12 may also communicate with one or more external devices 14 (eg, keyboard, pointing device, display 24, etc.), may also communicate with one or more devices that enable a user to interact with computer device 12, and/or communicate with Any device (eg, network card, modem, etc.) that enables the computer device 12 to communicate with one or more other computing devices. Such communication may take place through input/output (I/O) interface 22 . Also, the computer device 12 may communicate with one or more networks (eg, a local area network (LAN), a wide area network (WAN), and/or a public network such as the Internet) through a network adapter 20 . As shown, network adapter 20 communicates with other modules of computer device 12 via bus 18 . It should be understood that, although not shown in FIG. 6, other hardware and/or software modules may be used in conjunction with computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tapes drives and data backup storage systems.

处理单元16通过运行存储在系统存储器28中的程序,从而执行各种功能应用以及数据处理,例如实现本发明实施例所提供的一种应用于参数使用方的参数使用方法,也即,所述处理单元执行所述程序时实现:在执行目标操作的过程中,向参数缓存服务器发送参数加载请求;获取所述参数缓存服务器根据所述参数加载请求反馈的目标参数,并根据所述目标参数继续执行所述目标操作;其中,所述参数缓存服务器中的所述目标参数是在参数提供方的数据库服务器中加载的。The processing unit 16 executes various functional applications and data processing by running the programs stored in the system memory 28, for example, to implement a parameter use method provided by the embodiment of the present invention and applied to a parameter user, that is, the above When the processing unit executes the program, it is realized: in the process of executing the target operation, send a parameter loading request to the parameter cache server; obtain the target parameter fed back by the parameter cache server according to the parameter loading request, and continue according to the target parameter Execute the target operation; wherein, the target parameter in the parameter cache server is loaded in the database server of the parameter provider.

再例如实现本发明实施例所提供的一种应用于参数缓存服务器的参数使用方法,也即,所述处理单元执行所述程序时实现:接收参数使用方在执行目标操作的过程中发送的参数加载请求;响应于所述参数加载请求,为所述参数使用方提供在参数提供方的数据库服务器中加载的目标参数,以使所述参数提供方根据所述目标参数继续执行所述目标操作。Another example is to implement a method for using parameters that is applied to a parameter cache server provided by the embodiment of the present invention, that is, when the processing unit executes the program, it implements: receiving the parameters sent by the parameter user in the process of performing the target operation. Loading request; in response to the parameter loading request, providing the parameter consumer with the target parameter loaded in the database server of the parameter provider, so that the parameter provider continues to perform the target operation according to the target parameter.

实施例七Embodiment 7

本发明实施例七提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如本申请所有发明实施例提供的一种应用于参数使用方的参数使用方法,也即,该程序被处理器执行时实现:在执行目标操作的过程中,向参数缓存服务器发送参数加载请求;获取所述参数缓存服务器根据所述参数加载请求反馈的目标参数,并根据所述目标参数继续执行所述目标操作;其中,所述参数缓存服务器中的所述目标参数是在参数提供方的数据库服务器中加载的。Embodiment 7 of the present invention provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, implements a parameter use method applied to a parameter user as provided by all inventive embodiments of the present application , that is, when the program is executed by the processor: in the process of executing the target operation, send a parameter loading request to the parameter cache server; obtain the target parameter fed back by the parameter cache server according to the parameter loading request, and The target parameter continues to execute the target operation; wherein, the target parameter in the parameter cache server is loaded in the database server of the parameter provider.

或者,如实现本发明实施例所提供的一种应用于参数缓存服务器的参数使用方法,也即,该程序被处理器执行时实现:接收参数使用方在执行目标操作的过程中发送的参数加载请求;响应于所述参数加载请求,为所述参数使用方提供在参数提供方的数据库服务器中加载的目标参数,以使所述参数提供方根据所述目标参数继续执行所述目标操作。Or, to implement a method for using parameters applied to a parameter cache server provided by an embodiment of the present invention, that is, when the program is executed by the processor, the program is implemented: receiving the parameter loading sent by the parameter user in the process of executing the target operation request; in response to the parameter loading request, provide the parameter consumer with the target parameter loaded in the database server of the parameter provider, so that the parameter provider continues to perform the target operation according to the target parameter.

可以采用一个或多个计算机可读的介质的任意组合。计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质。计算机可读存储介质例如可以是但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本文件中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。Any combination of one or more computer-readable media may be employed. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples (a non-exhaustive list) of computer readable storage media include: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), Erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。A computer-readable signal medium may include a propagated data signal in baseband or as part of a carrier wave, with computer-readable program code embodied thereon. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device .

计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、电线、光缆、RF等等,或者上述的任意合适的组合。Program code embodied on a computer readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

可以以一种或多种程序设计语言或其组合来编写用于执行本发明操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言(诸如Java、Smalltalk、C++),还包括常规的过程式程序设计语言(诸如“C”语言或类似的程序设计语言)。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络(包括局域网LAN或广域网WAN)连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for carrying out operations of the present invention may be written in one or more programming languages, including object-oriented programming languages (such as Java, Smalltalk, C++), and conventional procedural programming language (such as the "C" language or similar programming language). The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. Where a remote computer is involved, the remote computer may be connected to the user's computer through any kind of network, including a local area network LAN or a wide area network WAN, or may be connected to an external computer (eg, through an Internet connection using an Internet service provider).

注意,上述仅为本发明的较佳实施例及所运用技术原理。本领域技术人员会理解,本发明不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施例对本发明进行了较为详细的说明,但是本发明不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多其他等效实施例,而本发明的范围由所附的权利要求范围决定。Note that the above are only preferred embodiments of the present invention and applied technical principles. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and can also include more other equivalent embodiments without departing from the concept of the present invention. The scope is determined by the scope of the appended claims.

Claims (15)

1.一种参数使用方法,其特征在于,应用于参数使用方,包括:1. a parameter using method is characterized in that, being applied to the parameter user, comprising: 在执行目标操作的过程中,向参数缓存服务器发送参数加载请求;In the process of executing the target operation, send a parameter loading request to the parameter cache server; 获取所述参数缓存服务器根据所述参数加载请求反馈的目标参数,并根据所述目标参数继续执行所述目标操作;其中,所述参数缓存服务器中的所述目标参数是在参数提供方的数据库服务器中加载的。Acquire the target parameter fed back by the parameter cache server according to the parameter loading request, and continue to perform the target operation according to the target parameter; wherein, the target parameter in the parameter cache server is in the database of the parameter provider loaded on the server. 2.根据权利要求1所述的方法,其特征在于,在获取所述参数缓存服务器根据所述参数加载请求反馈的目标参数之后,还包括:2. The method according to claim 1, wherein after acquiring the target parameter fed back by the parameter cache server according to the parameter loading request, the method further comprises: 如果所述目标参数满足预设条件,则将所述目标参数存入本地缓存。If the target parameter satisfies the preset condition, the target parameter is stored in the local cache. 3.根据权利要求1所述的方法,其特征在于,在向参数缓存服务器发送参数加载请求之前,还包括:在配置中心读取参数缓存配置信息;3. The method according to claim 1, wherein before sending the parameter loading request to the parameter cache server, the method further comprises: reading the parameter cache configuration information in the configuration center; 向参数缓存服务器发送参数加载请求,包括:根据所述参数缓存配置信息向所述参数缓存服务器发送参数加载请求。Sending a parameter loading request to a parameter cache server includes: sending a parameter loading request to the parameter cache server according to the parameter cache configuration information. 4.根据权利要求1所述的方法,其特征在于,向参数缓存服务器发送参数加载请求,包括:向所述参数缓存服务器的参数访问接口发送参数加载请求;4. The method according to claim 1, wherein sending a parameter loading request to a parameter cache server comprises: sending a parameter loading request to a parameter access interface of the parameter cache server; 获取所述参数缓存服务器根据所述参数加载请求反馈的目标参数,包括:Acquiring the target parameters fed back by the parameter cache server according to the parameter loading request, including: 如果通过所述参数访问接口根据所述参数加载请求反馈的参数加载响应指示所述参数缓存服务器未存储所述目标参数,则等待所述参数缓存服务器在所述参数提供方的数据库服务器中加载所述目标参数之后通过所述参数访问接口再次反馈参数加载响应;If the parameter loading response fed back according to the parameter loading request through the parameter access interface indicates that the parameter cache server does not store the target parameter, wait for the parameter cache server to load all the parameters in the database server of the parameter provider. After the target parameter is described, the parameter loading response is fed back again through the parameter access interface; 获取通过所述参数访问接口再次反馈的参数加载响应中携带的所述目标参数。Acquire the target parameter carried in the parameter loading response fed back through the parameter access interface again. 5.根据权利要求4所述的方法,其特征在于,所述参数访问接口支持键值对操作;和/或,所述参数缓存服务器为分布式缓存服务器。5. The method according to claim 4, wherein the parameter access interface supports key-value pair operations; and/or the parameter cache server is a distributed cache server. 6.一种参数使用方法,其特征在于,应用于参数缓存服务器,包括:6. A method for using parameters, characterized in that, applied to a parameter cache server, comprising: 接收参数使用方在执行目标操作的过程中发送的参数加载请求;Receive the parameter loading request sent by the parameter user during the execution of the target operation; 响应于所述参数加载请求,为所述参数使用方提供在参数提供方的数据库服务器中加载的目标参数,以使所述参数提供方根据所述目标参数继续执行所述目标操作。In response to the parameter loading request, the parameter consumer is provided with the target parameter loaded in the database server of the parameter provider, so that the parameter provider continues to perform the target operation according to the target parameter. 7.根据权利要求6所述的方法,其特征在于,在为所述参数使用方提供在参数提供方的数据库服务器中加载的目标参数之前,还包括:7. The method according to claim 6, wherein before providing the parameter user with the target parameter loaded in the database server of the parameter provider, the method further comprises: 在配置中心读取参数存储配置信息;Read parameter storage configuration information in the configuration center; 根据所述参数存储配置信息访问所述参数提供方的数据库服务器加载所述目标参数。The database server of the parameter provider is accessed to load the target parameter according to the parameter storage configuration information. 8.根据权利要求6所述的方法,其特征在于,接收参数使用方在执行目标操作的过程中发送的参数加载请求,包括:8. The method according to claim 6, wherein receiving the parameter loading request sent by the parameter user in the process of performing the target operation, comprising: 通过参数访问接口接收所述参数使用方在执行目标操作的过程中发送的参数加载请求;Receive, through the parameter access interface, a parameter loading request sent by the parameter user during the execution of the target operation; 响应于所述参数加载请求,为所述参数使用方提供在参数提供方的数据库服务器中加载的目标参数,包括:In response to the parameter loading request, provide the parameter consumer with target parameters loaded in the database server of the parameter provider, including: 如果确定所述参数缓存服务器未存储所述目标参数,则通过所述参数访问接口向所述参数使用方反馈指示所述参数缓存服务器未存储所述目标参数的参数加载响应,并执行在所述参数提供方的数据库服务器中加载所述目标参数的操作;If it is determined that the parameter cache server does not store the target parameter, feed back to the parameter user through the parameter access interface a parameter loading response indicating that the parameter cache server does not store the target parameter, and execute the parameter loading response in the parameter cache server. The operation of loading the target parameter in the database server of the parameter provider; 在完成所述目标参数加载之后,通过所述参数访问接口向所述参数使用方再次反馈携带所述目标参数的参数加载响应。After the target parameter loading is completed, the parameter loading response carrying the target parameter is fed back to the parameter user again through the parameter access interface. 9.根据权利要求8所述的方法,其特征在于,所述参数访问接口支持键值对操作;和/或,所述参数缓存服务器为分布式缓存服务器。9 . The method according to claim 8 , wherein the parameter access interface supports key-value pair operations; and/or the parameter cache server is a distributed cache server. 10 . 10.根据权利要求8所述的方法,其特征在于,还包括:10. The method of claim 8, further comprising: 响应于缓存记录处理请求,通过参数访问接口执行与所述缓存记录处理请求匹配的操作;其中,In response to the cache record processing request, an operation matching the cache record processing request is performed through the parameter access interface; wherein, 所述缓存记录处理请求至少包括:缓存记录新增请求、缓存记录删除请求、缓存记录更新请求,缓存记录查询请求。The cache record processing request at least includes: a cache record addition request, a cache record deletion request, a cache record update request, and a cache record query request. 11.根据权利要求1所述的方法,其特征在于,还包括:11. The method of claim 1, further comprising: 响应于参数更新请求,将所述参数缓存服务器中与所述参数更新请求匹配的缓存数据淘汰;In response to the parameter update request, eliminating cached data in the parameter cache server that matches the parameter update request; 在将与所述参数更新请求匹配的更新参数写入所述参数提供方的数据库服务器中之后,在所述参数提供方的数据库服务器中加载所述更新参数。After the update parameters matching the parameter update request are written in the database server of the parameter provider, the update parameters are loaded in the database server of the parameter provider. 12.一种参数使用装置,其特征在于,应用于参数使用方,包括:12. A parameter using device, characterized in that, applied to a parameter user, comprising: 参数加载请求发送模块,用于在执行目标操作的过程中,向参数缓存服务器发送参数加载请求;The parameter loading request sending module is used to send a parameter loading request to the parameter cache server in the process of executing the target operation; 参数加载使用模块,用于获取所述参数缓存服务器根据所述参数加载请求反馈的目标参数,并根据所述目标参数继续执行所述目标操作;其中,所述参数缓存服务器中的所述目标参数是在参数提供方的数据库服务器中加载的。A parameter loading and use module, configured to obtain the target parameter fed back by the parameter cache server according to the parameter loading request, and continue to perform the target operation according to the target parameter; wherein, the target parameter in the parameter cache server is loaded in the parameter provider's database server. 13.一种参数使用装置,其特征在于,应用于参数缓存服务器,包括:13. A parameter using device, characterized in that, applied to a parameter cache server, comprising: 参数加载请求接收模块,用于接收参数使用方在执行目标操作的过程中发送的参数加载请求;The parameter loading request receiving module is used to receive the parameter loading request sent by the parameter user in the process of executing the target operation; 参数提供模块,用于响应于所述参数加载请求,为所述参数使用方提供在参数提供方的数据库服务器中加载的目标参数,以使所述参数提供方根据所述目标参数继续执行所述目标操作。A parameter providing module, configured to, in response to the parameter loading request, provide the parameter consumer with the target parameter loaded in the database server of the parameter provider, so that the parameter provider continues to execute the parameter according to the target parameter target action. 14.一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现如权利要求1-5中任一所述的方法,或者实现如权利要求6-11中任一所述的方法。14. A computer device, comprising a memory, a processor and a computer program stored in the memory and running on the processor, wherein the processor implements any of claims 1-5 when the processor executes the program. 1. the method described, or implement the method according to any one of claims 6-11. 15.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现如权利要求1-5中任一所述的方法,或者实现如权利要求6-11中任一所述的方法。15. A computer-readable storage medium on which a computer program is stored, characterized in that, when the program is executed by a processor, the method according to any one of claims 1-5 is implemented, or the method as claimed in claim 6- The method of any one of 11.
CN202110351669.5A 2021-03-31 2021-03-31 Parameter using method, device, equipment and medium Pending CN112948443A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110351669.5A CN112948443A (en) 2021-03-31 2021-03-31 Parameter using method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110351669.5A CN112948443A (en) 2021-03-31 2021-03-31 Parameter using method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN112948443A true CN112948443A (en) 2021-06-11

Family

ID=76231789

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110351669.5A Pending CN112948443A (en) 2021-03-31 2021-03-31 Parameter using method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN112948443A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101345918A (en) * 2008-08-14 2009-01-14 中兴通讯股份有限公司 Service handling method and system based on integrated service management platform
CN111694865A (en) * 2020-06-02 2020-09-22 中国工商银行股份有限公司 Four-layer structure data acquisition method and device based on distributed system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101345918A (en) * 2008-08-14 2009-01-14 中兴通讯股份有限公司 Service handling method and system based on integrated service management platform
CN111694865A (en) * 2020-06-02 2020-09-22 中国工商银行股份有限公司 Four-layer structure data acquisition method and device based on distributed system

Similar Documents

Publication Publication Date Title
CN111865970B (en) Method and apparatus for implementing interface idempotency
CN112000394B (en) Method, apparatus, device and storage medium for accessing applet
CN103793485B (en) Client is based on the data cached method for realizing inquiry network data
US20160179919A1 (en) Asynchronous data replication using an external buffer table
US9104437B2 (en) Efficient serialization of mutable objects
WO2019242437A1 (en) Distributed transaction processing method and related device
CN110851276A (en) A service request processing method, device, server and storage medium
CN115145748A (en) Cross-process communication method, device, equipment and storage medium
CN113806655A (en) Data processing method, device, electronic device and storage medium
CN111917814B (en) Data publishing method, data subscribing method, data publishing device, data subscribing system and readable storage medium
US9473565B2 (en) Data transmission for transaction processing in a networked environment
CN112632053A (en) Method and system for realizing data splicing
CN113722389B (en) Data management method, device, electronic equipment and computer readable storage medium
CN113051244A (en) Data access method and device, and data acquisition method and device
CN112948443A (en) Parameter using method, device, equipment and medium
US20240089339A1 (en) Caching across multiple cloud environments
CN114448976B (en) Method, device, equipment, medium and program product for assembling network message
CN114896260A (en) Information processing method, information processing device, electronic equipment and storage medium
CN113821519B (en) Data processing method and domain drive design architecture
CN117807115A (en) Data processing method, device, equipment and storage medium
CN114418702A (en) Method and device for confirming order state to be paid based on time window
CN114218904A (en) A method and system for configurable report export design
CN110941643A (en) Data caching system, control method, device and storage medium
CN111625524A (en) Data processing method, device, equipment and storage medium
CN112131287A (en) Method and device for reading data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination