CN112650760A - Management method and device for caching service data to different addresses - Google Patents

Management method and device for caching service data to different addresses Download PDF

Info

Publication number
CN112650760A
CN112650760A CN202110054929.2A CN202110054929A CN112650760A CN 112650760 A CN112650760 A CN 112650760A CN 202110054929 A CN202110054929 A CN 202110054929A CN 112650760 A CN112650760 A CN 112650760A
Authority
CN
China
Prior art keywords
address
redis
service
configuration item
connection
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
CN202110054929.2A
Other languages
Chinese (zh)
Inventor
乌兰
王洪超
梁强
连守才
李跃海
党国利
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jinher Software Co Ltd
Original Assignee
Beijing Jinher Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jinher Software Co Ltd filed Critical Beijing Jinher Software Co Ltd
Priority to CN202110054929.2A priority Critical patent/CN112650760A/en
Publication of CN112650760A publication Critical patent/CN112650760A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • G06F12/0646Configuration or reconfiguration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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; CALCULATING OR 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/25Integrating or interfacing systems involving database management systems

Landscapes

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

Abstract

The invention relates to a management method and a device for caching service data to different addresses, wherein the management method comprises the steps of pre-configuring a redis address configuration item of the service data cache; judging whether the redis address configuration item changes in real time, and carrying out hot loading on the redis address configuration item when the redis address configuration item is determined to change; establishing effective address connection according to the redis address configuration item after hot loading; and operating corresponding service data in the effective address connection according to the received service. The invention can establish an effective connection mode with the redis service by carrying out hot loading on the configuration items on the service and monitoring the change of the configuration items in time, provides a mode for the service to operate the connection of the redis address corresponding to the service data, can reduce the risk brought by restarting the service and is convenient to manage the cache address of the service data.

Description

Management method and device for caching service data to different addresses
Technical Field
The invention belongs to the technical field of data processing, and particularly relates to a method and a device for managing business data cached to different addresses.
Background
Redis (remote Dictionary Server), a remote Dictionary service, is an open source log-type and Key-Value database written in ANSI C language, supporting network, based on memory and persistent, and provides API of multiple languages. The Redis is a high-performance open-source key-value database, has high read-write performance, can store mapping between keys (keys) and 5 different types of values (values), and can persist key value pair data stored in a memory to a hard disk, and a user can configure different persistence modes according to actual use scenes.
The redis cache technology is widely applied to each architecture system, the existing redis operation and maintenance technology cannot timely satisfy personnel such as development teams and operation and maintenance teams, and if business data cache addresses are randomly appointed to restart business services and corresponding services, unknown risks can be brought, for example: after the service uses the configuration item connection, the service cannot be put back to the connection pool in time, so that the effective connection is in work, the service processing is blocked, or the workload of the service connection management configuration item is large and heavy.
Disclosure of Invention
In view of the above, an object of the present invention is to overcome the deficiencies of the prior art, and to provide a method and an apparatus for managing service data cached to different addresses, so as to solve the problem of unknown risks caused by randomly designating a service data cache address to restart a service and a corresponding service in the prior art.
In order to achieve the purpose, the invention adopts the following technical scheme: a management method for caching service data to different addresses comprises the following steps:
a redis address configuration item of business data cache is pre-configured;
judging whether the redis address configuration item changes in real time, and carrying out hot loading on the redis address configuration item when the redis address configuration item is determined to change;
establishing effective address connection according to the redis address configuration item after hot loading;
and operating corresponding service data in the effective address connection according to the received service.
Further, the redis address configuration item includes:
configuration item primary key, redis operation address, user name, user password, maximum connection number, minimum connection number, default use library and configuration item enable mark.
Further, the method also comprises the following steps:
all redis address configuration entries are stored to the connection pool.
Further, the method also comprises the following steps:
and the validity of the address connection is detected in real time, so that the service can access the valid address connection.
Further, the method also comprises the following steps:
presetting a plurality of levels of business services;
and setting the number of address connections released by the connection pool according to the level of the service.
Further, the business service comprises an idle level and a busy level;
when the business service is in an idle level, the connection pool releases a first address connection quantity;
when the business service is at a busy level, the connection pool releases a second number of address connections.
Further, the operating the corresponding service data in the effective address connection according to the received service includes:
determining the service type of the service;
acquiring corresponding effective address connection from a connection pool according to the service type and a configuration item primary key, and operating corresponding service data in the effective address connection;
and after the service data is used, releasing the current address connection.
An embodiment of the present application provides a management device for caching service data to different addresses, including:
the configuration module is used for pre-configuring a redis address configuration item of the service data cache;
the judging module is used for judging whether the redis address configuration item changes in real time and carrying out hot loading on the redis address configuration item when the redis address configuration item is determined to change;
the establishing module is used for establishing effective address connection according to the redis address configuration item after hot loading;
and the operation module is used for operating the corresponding service data in the effective address connection according to the received service.
In some embodiments, further comprising:
and the storage module is used for storing all the redis address configuration items to the connection pool.
In some embodiments, further comprising:
and the detection module is used for detecting the validity of the address connection in real time and ensuring that the service can access the valid address connection.
The embodiment of the application provides computer equipment, which comprises a processor and a memory connected with the processor;
the memory is used for storing a computer program, and the computer program is used for executing the management method for caching the service data to different addresses, which is provided by any one of the above embodiments;
the processor is used to call and execute the computer program in the memory.
By adopting the technical scheme, the invention can achieve the following beneficial effects:
the invention provides a management method and a device for caching service data to different addresses, wherein the management method comprises the steps of pre-configuring a redis address configuration item of the service data cache; judging whether the redis address configuration item changes in real time, and carrying out hot loading on the redis address configuration item when the redis address configuration item is determined to change; establishing effective address connection according to the redis address configuration item after hot loading; and operating corresponding service data in the effective address connection according to the received service. The invention can establish an effective connection mode with the redis service by carrying out hot loading on the configuration items on the service and monitoring the change of the configuration items in time, provides a mode for the service to operate the connection of the redis address corresponding to the service data, can reduce the risk brought by restarting the service and is convenient to manage the cache address of the service data.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic diagram illustrating steps of a management method for caching service data to different addresses according to the present invention;
FIG. 2 is a schematic structural diagram of a management device for caching service data to different addresses according to the present invention;
fig. 3 is a schematic structural diagram of a computer device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be described in detail below. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the examples given herein without any inventive step, are within the scope of the present invention.
A specific method and apparatus for managing service data cached in different addresses provided in the embodiments of the present application are described below with reference to the accompanying drawings.
As shown in fig. 1, a method for managing service data cached in different addresses provided in this embodiment of the present application includes:
s101, a redis address configuration item of a service data cache is preconfigured;
preferably, the redis address configuration item includes:
configuration item primary key, redis access address, user name, user password, maximum number of connections, minimum number of connections, default use library, and configuration item enable flag.
S102, judging whether the redis address configuration item changes in real time, and carrying out hot loading on the redis address configuration item when the redis address configuration item is determined to change;
s103, establishing effective address connection according to the redis address configuration item after hot loading;
s104, operating the corresponding service data in the effective address connection according to the received service.
The working principle of the management method for caching the service data to different addresses is as follows: and configuring a service data cache redis address configuration item through a UI configuration item management interface, wherein the service data cache redis address configuration item comprises a configuration item main key, a redis access address, a user name, a user password, a maximum connection quantity, a minimum connection quantity, a default use library and a configuration item enabling mark. And judging whether the redis address configuration item changes in real time, carrying out hot loading on the redis address configuration item when the change of the redis address configuration item is determined, and establishing effective address connection according to the redis address configuration item after the hot loading so that the accessed business service can operate corresponding business data in an effective redis address.
Preferably, the application is further provided with a connection pool, and all redis address configuration items are stored in the connection pool.
Preferably, the method further comprises the following steps:
and detecting the validity of the address connection in real time, and ensuring that the service operates corresponding service data in the valid address connection. The method and the device ensure that the service data cache redis address connection is available in real time, so that the service can operate the corresponding service data in the effective address connection.
In some embodiments, the method for managing service data cached in different addresses provided by the present application further includes:
presetting a plurality of levels of business services;
and setting the number of address connections released by the connection pool according to the level of the service.
Preferably, the business service comprises an idle level and a busy level;
when the business service is in an idle level, the connection pool releases a first address connection quantity;
when the business service is at a busy level, the connection pool releases a second number of address connections.
Specifically, the technical scheme provided by the application can monitor the business service in real time, determine the business service level, wherein the business service level comprises an idle level and a busy level, and when the idle level is the idle level, the connection pool is released to the minimum connection quantity, so that the efficient utilization of the resources of the business service system is ensured. And applying for the redis connection with the maximum connection number less than or equal to the configuration item when the connection is in a busy level, so as to improve the concurrency of the service.
In some embodiments, the operating the corresponding service data in the effective address connection according to the received service includes:
determining the service type of the service;
acquiring corresponding effective address connection from a connection pool according to the service type and a configuration item primary key, and operating corresponding service data in the effective address connection;
and after the service data is used, releasing the current address connection.
According to the method and the device, the UI management interface is configured with the service data cache redis address, the redis connection service is notified online, when the configuration item of the service data cache address changes, hot loading is carried out, and effective address connection is established in time, so that the service can access the effective redis address and operate the service data in the effective redis address.
An embodiment of the present application provides a management device for caching service data to different addresses, as shown in fig. 2, including:
a configuration module 201, configured to pre-configure a redis address configuration item of a service data cache;
the judging module 202 is configured to judge whether the redis address configuration item changes in real time, and perform hot loading on the redis address configuration item when it is determined that the redis address configuration item changes;
the establishing module 203 is configured to establish an effective address connection according to the redis address configuration item after the hot loading;
an operation module 204, configured to operate corresponding service data in the effective address connection according to the received service.
The working principle of the management device for caching service data to different addresses provided by the application is that the configuration module 201 pre-configures a redis address configuration item of the service data cache; the judging module 202 obtains operational service data, judges whether the redis address configuration item changes according to the service data, and performs hot loading on the redis address configuration item when the change of the redis address configuration item is determined; the establishing module 203 establishes effective address connection according to the redis address configuration item after hot loading; the operation module 204 operates the corresponding service data in the effective address connection according to the received service.
The device manages and realizes that a UI configuration item management interface configures a service data cache redis address, actively informs a redis connection service on line, carries out hot loading when monitoring that the service configuration item cache address changes, and establishes effective connection in time so that the service can access the effective redis address and operate corresponding service data in the effective redis address.
As shown in fig. 3, an embodiment of the present application provides a computer device, including a processor, and a memory connected to the processor;
the memory is used for storing a computer program, and the computer program is used for executing the management method for caching the service data to different addresses, which is provided by any one of the above embodiments;
the processor is used to call and execute the computer program in the memory.
In summary, the present invention provides a management method and apparatus for caching service data to different addresses, where the management method includes pre-configuring a redis address configuration item of the service data cache; judging whether the redis address configuration item changes in real time, and carrying out hot loading on the redis address configuration item when the redis address configuration item is determined to change; establishing effective address connection according to the redis address configuration item after hot loading; and operating corresponding service data in the effective address connection according to the received service. The invention can establish an effective connection mode with the redis service by carrying out hot loading on the configuration items on the service and monitoring the change of the configuration items in time, provides a mode for the service to operate the connection of the redis address corresponding to the service data, can reduce the risk brought by restarting the service and is convenient to manage the cache address of the service data.
It is to be understood that the embodiments of the method provided above correspond to the embodiments of the apparatus described above, and the corresponding specific contents may be referred to each other, which is not described herein again.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (9)

1. A management method for caching service data to different addresses is characterized by comprising the following steps:
a redis address configuration item of business data cache is pre-configured;
judging whether the redis address configuration item changes in real time, and carrying out hot loading on the redis address configuration item when the redis address configuration item is determined to change;
establishing effective address connection according to the redis address configuration item after hot loading;
and operating corresponding service data in the effective address connection according to the received service.
2. The method of claim 1, wherein the redis address configuration entry comprises:
configuration item primary key, redis access address, user name, user password, maximum number of connections, minimum number of connections, default use library, and configuration item enable flag.
3. The method of claim 1, further comprising:
all redis address configuration entries are stored to the connection pool.
4. The method of claim 1, further comprising:
and the validity of the address connection is detected in real time, so that the service can access the valid address connection.
5. The method of claim 1, further comprising:
presetting a plurality of levels of business services;
and setting the number of address connections released by the connection pool according to the level of the service.
6. The method of claim 5,
the business service comprises an idle level and a busy level;
when the business service is in an idle level, the connection pool releases a first address connection quantity;
when the business service is at a busy level, the connection pool releases a second number of address connections.
7. The method of claim 3, wherein the operating on the corresponding traffic data in the effective address connection according to the received traffic service comprises:
determining the service type of the service;
acquiring corresponding effective address connection from a connection pool according to the service type and a configuration item primary key, and operating corresponding service data in the effective address connection;
and after the service data is used, releasing the current address connection.
8. A management apparatus for caching service data to different addresses, comprising:
the configuration module is used for pre-configuring a redis address configuration item of the service data cache;
the judging module is used for judging whether the redis address configuration item changes in real time and carrying out hot loading on the redis address configuration item when the redis address configuration item is determined to change;
the establishing module is used for establishing effective address connection according to the redis address configuration item after hot loading;
and the operation module is used for operating the corresponding service data in the effective address connection according to the received service.
9. A computer device, comprising: a processor, and a memory coupled to the processor;
the memory is used for storing a computer program, and the computer program is used for executing the management method for caching the business data to different addresses according to any one of claims 1 to 7;
the processor is used for calling and executing the computer program in the memory.
CN202110054929.2A 2021-01-15 2021-01-15 Management method and device for caching service data to different addresses Pending CN112650760A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110054929.2A CN112650760A (en) 2021-01-15 2021-01-15 Management method and device for caching service data to different addresses

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110054929.2A CN112650760A (en) 2021-01-15 2021-01-15 Management method and device for caching service data to different addresses

Publications (1)

Publication Number Publication Date
CN112650760A true CN112650760A (en) 2021-04-13

Family

ID=75368456

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110054929.2A Pending CN112650760A (en) 2021-01-15 2021-01-15 Management method and device for caching service data to different addresses

Country Status (1)

Country Link
CN (1) CN112650760A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114237747A (en) * 2021-12-17 2022-03-25 深圳壹账通智能科技有限公司 Application program interface gateway configuration method and device, terminal equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109471896A (en) * 2018-11-01 2019-03-15 数贸科技(北京)有限公司 Data source information dynamic altering method and device
CN111666265A (en) * 2020-06-04 2020-09-15 南京领行科技股份有限公司 Data management method, device, server and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109471896A (en) * 2018-11-01 2019-03-15 数贸科技(北京)有限公司 Data source information dynamic altering method and device
CN111666265A (en) * 2020-06-04 2020-09-15 南京领行科技股份有限公司 Data management method, device, server and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114237747A (en) * 2021-12-17 2022-03-25 深圳壹账通智能科技有限公司 Application program interface gateway configuration method and device, terminal equipment and storage medium

Similar Documents

Publication Publication Date Title
US10255110B2 (en) Node selection for a new application in a multi-tenant cloud hosting environment
US9317325B2 (en) Application idling in a multi-tenant cloud-based application hosting environment
US9167028B1 (en) Monitoring distributed web application transactions
US10365953B2 (en) Tracking and utilizing facts about a node of a multi-tenant cloud hosting environment
US10162708B2 (en) Fault tolerance for complex distributed computing operations
US20210006628A1 (en) Managing operation of instances
US10367705B1 (en) Selecting and configuring metrics for monitoring
US10303678B2 (en) Application resiliency management using a database driver
US11956330B2 (en) Adaptive data fetching from network storage
US11593177B2 (en) Cost-savings using ephemeral hosts in infrastructure as a service environments based on health score
US20160323160A1 (en) Detection of node.js memory leaks
CN113157411B (en) Celery-based reliable configurable task system and device
CN113238815B (en) Interface access control method, device, equipment and storage medium
CN103399791A (en) Method and device for migrating virtual machines on basis of cloud computing
CN111290839A (en) IAAS cloud platform system based on openstack
US10476766B1 (en) Selecting and configuring metrics for monitoring
CN109165078B (en) Virtual distributed server and access method thereof
US20170031740A1 (en) Naming of nodes in net framework
US9319274B1 (en) Method and system for dynamic provisioning using server dormant mode for virtual server dormancy
CN112650760A (en) Management method and device for caching service data to different addresses
CN109800084A (en) Discharge the method and terminal device of resources of virtual machine
CN109286532B (en) Management method and device for alarm information in cloud computing system
US11416318B1 (en) Application programming interface for integration flow design
US11870706B2 (en) Method and system for allocating and managing cloud resources
US12020039B2 (en) Compute instance warmup operations

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