CN111666265A - Data management method, device, server and storage medium - Google Patents

Data management method, device, server and storage medium Download PDF

Info

Publication number
CN111666265A
CN111666265A CN202010501333.8A CN202010501333A CN111666265A CN 111666265 A CN111666265 A CN 111666265A CN 202010501333 A CN202010501333 A CN 202010501333A CN 111666265 A CN111666265 A CN 111666265A
Authority
CN
China
Prior art keywords
data
key
database
data management
management request
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.)
Granted
Application number
CN202010501333.8A
Other languages
Chinese (zh)
Other versions
CN111666265B (en
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.)
Nanjing Leading Technology Co Ltd
Original Assignee
Nanjing Leading Technology 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 Nanjing Leading Technology Co Ltd filed Critical Nanjing Leading Technology Co Ltd
Priority to CN202010501333.8A priority Critical patent/CN111666265B/en
Publication of CN111666265A publication Critical patent/CN111666265A/en
Application granted granted Critical
Publication of CN111666265B publication Critical patent/CN111666265B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/21Design, administration or maintenance of databases
    • 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

Landscapes

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

Abstract

The embodiment of the invention discloses a data management method, a data management device, a server and a storage medium. The method comprises the following steps: obtaining routing rule data, wherein the routing rule data is used for indicating a mapping relation between keys of business data and database numbers, and the database codes are numbers of database fragments; acquiring a data management request, and determining a key of data to be managed according to the data management request; and judging whether to send a data management request to the Redis server according to the key of the data to be managed and the key of the service data. The embodiment of the invention determines the key of the data to be managed according to the data management request, routes the data management request to the corresponding database fragment in the Redis server according to the key of the data to be managed and the key of the service data, realizes the storage of the service data into the pre-specified database fragment, realizes the independent management of the service data in each database fragment, and improves the fragment utilization rate of data cache and the balanced utilization rate of the database.

Description

Data management method, device, server and storage medium
Technical Field
Embodiments of the present invention relate to data processing technologies, and in particular, to a data management method, an apparatus, a server, and a storage medium.
Background
With the increasing frequency and dependence of data synchronization of an internet distributed system on a Redis server, services of many applications need to be realized by the Redis server.
At present, data is stored in a cache of a Redis server, and as the use frequency and the dependence degree of the Redis server increase, the data in the cache increases exponentially, which brings great challenges to the management of mass data stored in the cache of the Redis server. Therefore, how to effectively manage the cache data of the Redis server becomes a problem to be solved urgently.
Disclosure of Invention
Embodiments of the present invention provide a data management method, an apparatus, a server, and a storage medium, which can improve the fragmentation utilization rate of a data cache and the balanced utilization rate of a database.
In a first aspect, an embodiment of the present invention provides a data management method, including:
acquiring routing rule data, wherein the routing rule data is used for indicating a mapping relation between a key of service data and a database number, and the database number is the number of a database fragment;
acquiring a data management request, and determining a key of data to be managed according to the data management request;
and judging whether to send the data management request to a Redis server according to the key of the data to be managed and the key of the service data, wherein the data management request is used for indicating the Redis server to execute corresponding database operation.
In a second aspect, an embodiment of the present invention further provides a data management apparatus, including:
the system comprises a data acquisition module, a data transmission module and a data transmission module, wherein the data acquisition module is used for acquiring routing rule data, the routing rule data are used for indicating the mapping relation between keys of service data and database numbers, and the database numbers are the numbers of database fragments;
the request acquisition module is used for acquiring a data management request and determining a key of data to be managed according to the data management request;
and the request judging module is used for judging whether to send the data management request to a Redis server according to the key of the data to be managed and the key of the service data, wherein the data management request is used for indicating the Redis server to execute corresponding database operation.
In a third aspect, an embodiment of the present invention further provides an application server, where the application server includes:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a data management method as provided by any of the embodiments of the invention.
In a fourth aspect, embodiments of the present invention also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform a data management method as provided in any of the embodiments of the present invention.
The embodiment of the invention determines the key of the data to be managed according to the data management request, routes the data management request to the corresponding database fragment in the Redis server according to the key of the data to be managed and the key of the service data, realizes the storage of the service data into the pre-specified database fragment, realizes the independent management of the service data in each database fragment, and improves the fragment utilization rate of data cache and the balanced utilization rate of the database.
Drawings
FIG. 1 is a flow chart of a data management method according to a first embodiment of the present invention;
FIG. 2 is a flow chart of another data management method according to a second embodiment of the present invention;
FIG. 3 is a flowchart of another data management method according to a third embodiment of the present invention;
FIG. 4 is a diagram illustrating a data management method according to a third embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a data management apparatus according to a fourth embodiment of the present invention;
fig. 6 is a schematic structural diagram of an application server in the fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a data management method according to an embodiment of the present invention, where the method is applicable to a data management situation of a distributed system, and the method may be executed by a data management apparatus, and the apparatus may be implemented in a software/hardware manner. The apparatus may be configured in an application server that performs data management. As shown in fig. 1, the method specifically includes:
and step S110, acquiring routing rule data.
The routing rule data is used to indicate the mapping relationship between the key of the service data and the database number, and the key of the service data may be a route named according to the service data.
The database number is the number of the database shard. For example, the database is fragmented to obtain a set number of database fragments. The set number is an empirical value, and the database can be divided into a plurality of pieces according to actual requirements.
Illustratively, the database of the Redis server is divided into 256 database shards according to the maximum principle, and the database shards are numbered from 0 to 255, such as DB 0-DB 255, wherein DB0 can be considered as the database number of database shard 0.
The routing rule data comprises keys of the business data with mapping relation and database numbers, the routing rule data is initialized to the database fragments of the specified database numbers, and the specified keys represent the database fragments for storing the routing rule data. The keys of the service data comprise service center identification information and application identification information which are arranged according to a preset rule. Wherein a key of a business data may correspond to one or more database shards. For example, the key for the service data is A: a:, which may correspond to DB 1. Alternatively, A: a may correspond to DB1 and DB 10. The designated key is used to represent a designated database shard in the cache of the Redis server. And after the application server establishes a Redis connection pool with the Redis server, loading the routing rule data from the specified database fragment according to the specified key.
The naming rule of the route may be many, and the embodiment of the present invention is not particularly limited. Alternatively, the naming of the route may be in the form of the business center english name, the application english name. Wherein the application is an application in a service center. It should be noted that an application may be a project or a project. Redundant or meaningless routes can be avoided by using this identification.
The mapping relation between the route and the database number can be preset by a development responsible person corresponding to the Redis server component to obtain the route rule data, and the mapping relation is initialized to the database fragment in the Redis server. For example, if the development manager corresponding to the Redis server component specifies that the database fragment with database number 39 corresponds to the route TRIP: PLAN, the routing rule data may be TRIP: PLAN: ═ 39, which indicates that the service center is an outgoing line and the application in the service center is the planned route correspondence DB 39. In the above manner, a database fragment is respectively assigned to each route (i.e. a key of service data), a mapping table of the key of service data and the database number is generated according to a preset mapping relationship, and the mapping table is stored in the database fragment DB0 in the Redis server, and the mapping table can be adaptively adjusted according to actual needs, such as deletion, addition, replacement, and the like.
Optionally, when the routing rule data needs to be adjusted, the application may be made to a development principal corresponding to the Redis server component, so as to adjust the routing rule data. Wherein, the meaning of the adjustment includes addition, deletion or modification. And if the routing rule data is newly added, newly assigning the mapping relation between the key of the service data and the database number, and adding the newly assigned mapping relation into a database fragment which is in charge of storing the routing rule data in the Redis server. For example, the database fragment DB0 in the Redis server is used to store routing rule data, and when a new routing rule data needs to be added, a newly specified mapping relationship is obtained, and the new mapping relationship is added to the database fragment DB 0.
Optionally, all the applied routing rule data is published to all applications to avoid duplicate applications.
Optionally, the data is stored in the corresponding database fragment according to the mapping relationship between the key of the service data and the database number through preset routing rule data.
Optionally, when data is extracted from the database, the corresponding database code is directly matched according to the key of the service data, and the data is extracted from the corresponding database fragment according to the corresponding database code.
Step S120, acquiring a data management request, and determining a key of data to be managed according to the data management request.
The data management request is a request related to data management, which is issued by an application in the service center to the application server, and is used for managing data in the Redis server. The data management request may be a key for data management. For example, the data management request includes a request for storing, querying, replacing, or deleting data in the Redis server.
It should be noted that the service data may use the route according to the designated rule in a unified manner to obtain the data management request. The rules may be in many forms, and embodiments of the present invention are not limited in particular. For example, the data management request may be a service center english name application english name associated service: [ custom: ] unique identification. The 'self-definition in' in the data management request is optional data, and whether the 'self-definition in' is added in the data management request is determined according to an actual scene. The value of the unique identifier may be determined in various ways, and the embodiment of the present invention is not particularly limited. For example, the unique identifier may be a car license number, a cell phone number, an identification number, or a campaign ID for hosting a campaign, among others. An alternative representation of a data management request is illustrated below: CHARGING, wherein CHARGING is the key of the data to be managed (same as the route in the routing rule data), sending is the related service, and a plurality of services can be provided according to the requirement, such as sending, DRIVER, or sending, USER, and the like. 005eec2dd8644974bbe03cc6af3e409c is a unique identification, and the content of the unique identification of each data management request is different.
Step S130, judging whether to send a data management request to the Redis server according to the key of the data to be managed and the key of the service data, wherein the data management request is used for indicating the Redis server to execute corresponding database operation.
It should be noted that the Redis server may be a server configured with a Redis application.
Optionally, the key of the data to be managed and the key of the service data are matched, and if the matching is successful, the data management request is sent to the Redis server. For example, the key of the data to be managed is MARKETING: ACT, if the key of the service data in the application server also comprises MARKETING: ACT, the matching is successful, and a data management request is sent to the Redis server.
Optionally, the database management request includes a field for instructing the Redis server to perform a corresponding database operation, wherein the corresponding database operation may be a store, a query, a replace, a delete, or the like. For example, if the storage field is included in the database management request, the request is used for indicating that data is stored in the corresponding database fragment in the Redis server, if the query field is included in the database management request, the request is used for indicating that data in the corresponding database fragment in the Redis server is queried, if the replacement field is included in the database management request, the request is used for indicating that corresponding data in the corresponding database fragment in the Redis server is replaced, and if the deletion field is included in the database management request, the request is used for indicating that the Redis server deletes corresponding data in the corresponding database fragment.
According to the technical scheme of the embodiment, the routing rule data is obtained, the key of the data to be managed is determined according to the data management request, the data management request is routed to the corresponding database fragment in the Redis server according to the key of the data to be managed and the key of the service data, the service data is stored in the pre-designated database fragment, the service data in each database fragment is independently managed, and the fragment utilization rate of the data cache and the equilibrium utilization rate of the database are improved.
Example two
Fig. 2 is a flowchart of another data management method in the second embodiment of the present invention, and this embodiment performs optimization based on the above embodiment, as shown in fig. 2, the method includes:
and step S210, creating a Redis connection pool.
The Redis connection pool is connected between the application server and the Redis server and used for storing the connection relation between the application server and the Redis server. The application server establishes a Redis connection pool in advance, when the connection needs to be used, the application server obtains the established connection from the Redis connection pool through a certain algorithm, and the connection pool is provided after the use is finished, so that the time occupied by database connection is saved.
And step S220, judging whether the Redis connection pool is established completely, if so, executing step S230, otherwise, returning to execute step S210.
Illustratively, a periodic determination is made as to whether the Redis connection pool is created. If the creation is complete, step 230 is performed. If the creation is not completed, the step S210 is continuously executed.
And step S230, inquiring a Redis server according to preset frequency to obtain routing rule data.
Optionally, in the application starting process, after the Redis connection pool is created, the routing rule data is asynchronously loaded by the thread, and the routing rule data is stored in the memory of the application server.
Optionally, after the Redis connection pool is created, the hot loading frequency of the routing rule data is specified as needed, for example, the query of the routing rule data in the Redis server is executed again every 2 minutes, and the queried routing rule data is stored in the application server memory.
The set database fragment in the Redis server stores the routing rule data, and the rest database fragments store the service data.
One or more database fragments in the database fragments are pre-assigned to store the routing rule data, the database fragment assigned to store the routing rule data is a set database fragment, and the rest database fragments are used for storing service data.
Illustratively, the database of the Redis server is divided into 256 database shards according to the maximum principle, and the database shards are numbered from 0 to 255, such as DB0 DB255, wherein DB0 is used for storing routing rule data and DB1 DB255 is used for storing service data. The Redis database in the Redis server stores data with different purposes according to actual needs in a sharding mode, and sharding management of the database is facilitated.
Alternatively, the database in which the data is located may be located according to a Redis data management tool in the Redis server. For example, whether the cache data exists or not, whether the cache data meets expectations or not and the like can be checked, so that rapid troubleshooting of problems in the development process and on the line is facilitated.
Step S240, acquiring the data management request, and determining the key of the data to be managed according to the data management request.
Step S250, judging whether to send a data management request to the Redis server according to the key of the data to be managed and the key of the service data, wherein the data management request is used for indicating the Redis server to execute corresponding database operation.
According to the technical scheme, the Redis connection pool is created, so that the problem that connection needs to be reestablished every time when the application server and the Redis server need to be connected, time is saved, and the connection speed is increased. The Redis server is inquired according to the preset frequency, the routing rule data can be updated in time, the routing rule data can be temporarily added without restarting the application server in the operation process of the application server, and fluctuation and other adverse effects caused by restarting the application server are reduced. The routing rule data is stored in the set database fragments in the Redis server, and the service data is stored in the rest database fragments, so that the phenomenon of disordered storage of Redis cache data among all service centers can be avoided, the cache data of all the service centers are stored in a pre-designated database, the Redis server can independently manage the service data in the database fragments, and the fragment utilization rate of data cache and the balanced utilization rate of the database are improved.
EXAMPLE III
Fig. 3 is a flowchart of another data management method in a third embodiment of the present invention, and this embodiment performs optimization based on the foregoing embodiment, as shown in fig. 3, the method includes:
step S310, inquiring a setting database according to a preset frequency to obtain routing rule data.
The setting database is a common database connected with the application server in advance and used for storing routing rule data, and the setting database can be a relational database management system, such as MySQL and the like.
Illustratively, the routing rule data is stored in MySQL in advance, when an application in the service center is started, the application server queries MySQL, and loads the routing rule data in MySQL into a memory of the application server.
Alternatively, the application server may read the routing rule data in the setting database at regular time. For example, the application server regularly reads MySQL in coordination with a timing task, and is used for hot loading of routing rule data in MySQL.
Step S320, obtaining the data management request, and determining a field corresponding to the data management request, where the field is arranged according to a preset rule.
Alternatively, the service data may use the route uniformly according to a specified rule, for example, according to: the business center English name is the mode of unique identification of the application English name and the related business, wherein the related business is the business related to the application in the business center, and the related business is optional and can be customized according to the actual requirement. For example, TRIP PLAN PERSONAL means that the service center is a TRIP, the application in the service center is a PLAN, and the related service is a PERSONAL service, so that the data of all services can be conveniently managed by the specified identifier.
And step S330, determining the target field of the set position as the key of the data to be managed according to the field arrangement sequence.
Since the fields forming the data management request are arranged according to the preset rule, the target fields corresponding to the keys of the data to be managed can be determined according to the field arrangement sequence, for example, the business center English name in the data management request, namely the English name is used as the key of the data to be managed.
Step S340, determining whether the routing rule data includes a key of the service data matching with the key of the data to be managed, if yes, performing step S350, otherwise, performing step S370.
And step S350, determining the key of the business data matched with the key of the data to be managed as a target key. Step S360 follows.
And step S360, determining target routing data according to the target key and the routing rule data, and sending the target routing data and the data management request to the Redis server.
Illustratively, target routing data corresponding to the target key in the routing rule data is determined, and the target routing data and the data management request are sent to the Redis server. And after receiving the target routing data and the data management request, the Redis server executes data management operation on the database fragment pointed by the target routing data according to the data management request.
Step S370, intercepting the data management request and displaying the prompt information of route abnormity.
Exemplarily, fig. 4 is a schematic diagram of a data management method in a third embodiment of the present invention, as shown in fig. 4, an application end includes an application a, an application B, and an application C … … application N, an application server receives a data management request of the application end, MARKETING: ACT issued by the application a is a key representing data to be managed corresponding to the application a, and CUA: CONFIG issued by the application N is a key representing data to be managed corresponding to the application N, and other applications are similar. The application server stores routing rule data in a memory of the application server, judges whether the routing rule data contains a key of service data matched with the key of the data to be managed, for example, the routing rule data contains MARKETING: ACT: 22 and CUA: CONFIG: 13, and contains a key MARKETING: ACT of the data to be managed corresponding to the application A and a key CUA: CONFIG of the data to be managed corresponding to the application N, and considers that the matching is successful, and sends the data management request of the application to the Redis server, wherein the database number corresponding to the data management request can be determined according to the database number in the routing rule data, and further directly routes the data management request to the corresponding database, for example, the data management request of the application A is sent to the database DB22, and the data management request of the application N is sent to the database DB 13. If the routing rule data does not contain the key of the business data matched with the key of the data to be managed, for example, the key of the data to be managed of the application D is RISK: CONTROL:, and the application server does not have the matched key of the business data, the matching is considered to be failed, the application server intercepts the data management request and displays the prompt information of routing abnormity. In addition, the routing rule data in the application server is regularly hot loaded to update the data.
According to the technical scheme of the embodiment, a set database is inquired according to preset frequency, routing rule data are obtained, a field corresponding to a data management request is determined, a key of data to be managed is further determined, whether the routing rule data comprise a key of business data matched with the key of the data to be managed or not is judged, if yes, the key of the data to be managed and the key of the business data are matched, a target key matched with the key of the data to be managed is determined, target routing data are determined according to the target key and the routing rule data, the target routing data and the data management request are sent to a Redis server, and if not, the data management request is intercepted, and route abnormity prompting information is displayed. The application of each service center can hit the database where the data are located efficiently, so that the value taking efficiency is improved, the fragment use of the Redis server is more balanced and reasonable, and if the key of the service data requested by the Redis server does not exist, the request can be directly intercepted, a friendly warning is given, the request cannot be sent to the Redis server, and the pressure of the Redis server is reduced.
Example four
Fig. 5 is a schematic structural diagram of a data management apparatus according to a fourth embodiment of the present invention. The device can be realized by software and/or hardware, can be generally integrated in an application server, and can improve the fragmentation utilization rate of data cache and the equilibrium utilization rate of a database by executing a data management method. As shown in fig. 5, the apparatus includes:
a data obtaining module 510, configured to obtain routing rule data, where the routing rule data is used to indicate a mapping relationship between a key of service data and a database number, and the database number is a number of a database fragment;
a request obtaining module 520, configured to obtain a data management request, and determine a key of data to be managed according to the data management request;
a request determining module 530, configured to determine, according to the key of the data to be managed and the key of the service data, whether to send the data management request to a Redis server, where the data management request is used to instruct the Redis server to perform a corresponding database operation.
Optionally, the data obtaining module 510 is specifically configured to:
creating a Redis connection pool;
and if the Redis connection pool is established, querying a Redis server according to preset frequency to obtain routing rule data.
Optionally, a set database segment in the Redis server stores the routing rule data, and the remaining database segments store service data.
Optionally, the data obtaining module 510 is specifically configured to:
and inquiring a set database according to the preset frequency to obtain routing rule data.
Optionally, the request obtaining module 520 is specifically configured to:
acquiring a data management request, and determining fields corresponding to the data management request, wherein the fields are arranged according to a preset rule;
and determining the target field of the set position as a key of the data to be managed according to the field arrangement sequence.
Optionally, the request determining module 530 is specifically configured to:
matching the key of the data to be managed with the key of the business data, and determining a target key matched with the key of the data to be managed;
and determining target routing data according to the target key and the routing rule data, and sending the target routing data and the data management request to a Redis server.
Optionally, the request determining module 530 is further specifically configured to:
after the key of the data to be managed and the key of the service data are matched, if the routing rule data does not contain a target key matched with the key of the data to be managed, the data management request is intercepted, and routing abnormity prompt information is displayed.
EXAMPLE five
Fig. 6 is a schematic structural diagram of an application server in the fifth embodiment of the present invention, as shown in fig. 6, the application server includes a processor 610, a memory 620, an input device 630, and an output device 640; the number of the processors 610 in the application server may be one or more, and one processor 610 is taken as an example in fig. 6; the processor 610, the memory 620, the input device 630 and the output device 640 in the application server may be connected by a bus or other means, and fig. 6 illustrates an example of a connection by a bus.
The memory 620, as a computer-readable storage medium, may be used for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the data management method in the embodiment of the present invention (for example, the data acquisition module 510, the request acquisition module 520, and the request judgment module 530 in the data management apparatus). The processor 610 executes various functional applications of the application server and data management by executing software programs, instructions, and modules stored in the memory 620, that is, implements the above-described data management method.
The memory 620 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 620 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 620 may further include memory located remotely from the processor 610, which may be connected to an application server over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input means 630 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the application server. The output device 640 may include a display device such as a display screen.
EXAMPLE six
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, perform a data management method, including:
obtaining routing rule data, wherein the routing rule data is used for indicating a mapping relation between keys of business data and database numbers, and the database codes are numbers of database fragments;
acquiring a data management request, and determining a key of data to be managed according to the data management request;
and judging whether to send the data management request to a Redis server according to the key of the data to be managed and the key of the service data, wherein the data management request is used for indicating the Redis server to execute corresponding database operation.
Of course, the storage medium provided by the embodiment of the present invention contains computer-executable instructions, and the computer-executable instructions are not limited to the operations of the method described above, and may also perform related operations in the data management method provided by any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the data management apparatus, the included units and modules are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention. It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method for managing data, comprising:
acquiring routing rule data, wherein the routing rule data is used for indicating a mapping relation between a key of service data and a database number, and the database number is the number of a database fragment;
acquiring a data management request, and determining a key of data to be managed according to the data management request;
and judging whether to send the data management request to a remote dictionary service Redis server or not according to the key of the data to be managed and the key of the service data, wherein the data management request is used for indicating the Redis server to execute corresponding database operation.
2. The method of claim 1, wherein obtaining routing rule data comprises:
creating a Redis connection pool;
and if the Redis connection pool is established, querying a Redis server according to preset frequency to obtain routing rule data.
3. The method of claim 2, comprising: and the set database fragment in the Redis server stores the routing rule data, and the rest database fragments store service data.
4. The method of claim 1, wherein obtaining routing rule data comprises:
and inquiring a set database according to the preset frequency to obtain routing rule data.
5. The method of claim 1, wherein the obtaining a data management request and determining a key of data to be managed according to the data management request comprises:
acquiring a data management request, and determining fields corresponding to the data management request, wherein the fields are arranged according to a preset rule;
and determining the target field of the set position as a key of the data to be managed according to the field arrangement sequence.
6. The method according to claim 1, wherein said determining whether to send the data management request to a Redis server according to the key of the data to be managed and the key of the service data comprises:
matching the key of the data to be managed with the key of the business data, and determining a target key matched with the key of the data to be managed;
and determining target routing data according to the target key and the routing rule data, and sending the target routing data and the data management request to a Redis server.
7. The method of claim 6, further comprising, after matching the key of the data to be managed and the key of the business data:
and if the routing rule data does not contain a target key matched with the key of the data to be managed, intercepting the data management request and displaying a routing abnormity prompt message.
8. A data management apparatus, comprising:
the system comprises a data acquisition module, a data transmission module and a data transmission module, wherein the data acquisition module is used for acquiring routing rule data, the routing rule data are used for indicating the mapping relation between keys of service data and database numbers, and the database numbers are the numbers of database fragments;
the request acquisition module is used for acquiring a data management request and determining a key of data to be managed according to the data management request;
and the request judging module is used for judging whether to send the data management request to a Redis server according to the key of the data to be managed and the key of the service data, wherein the data management request is used for indicating the Redis server to execute corresponding database operation.
9. An application server, characterized in that the application server comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a data management method as recited in any of claims 1-7.
10. A storage medium containing computer-executable instructions for performing the data management method of any one of claims 1-7 when executed by a computer processor.
CN202010501333.8A 2020-06-04 2020-06-04 Data management method, device, server and storage medium Active CN111666265B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010501333.8A CN111666265B (en) 2020-06-04 2020-06-04 Data management method, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010501333.8A CN111666265B (en) 2020-06-04 2020-06-04 Data management method, device, server and storage medium

Publications (2)

Publication Number Publication Date
CN111666265A true CN111666265A (en) 2020-09-15
CN111666265B CN111666265B (en) 2022-06-24

Family

ID=72386127

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010501333.8A Active CN111666265B (en) 2020-06-04 2020-06-04 Data management method, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN111666265B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112650760A (en) * 2021-01-15 2021-04-13 北京金和网络股份有限公司 Management method and device for caching service data to different addresses
CN112988874A (en) * 2021-04-08 2021-06-18 海南车智易通信息技术有限公司 Data processing method, system, computing device and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110019213A (en) * 2017-12-04 2019-07-16 北京京东尚科信息技术有限公司 Data managing method, device, electronic equipment and storage medium
CN110555041A (en) * 2018-03-30 2019-12-10 腾讯科技(深圳)有限公司 Data processing method, data processing device, computer equipment and storage medium
CN111125169A (en) * 2019-11-28 2020-05-08 江苏苏宁物流有限公司 Data query method, control device, medium and computer equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110019213A (en) * 2017-12-04 2019-07-16 北京京东尚科信息技术有限公司 Data managing method, device, electronic equipment and storage medium
CN110555041A (en) * 2018-03-30 2019-12-10 腾讯科技(深圳)有限公司 Data processing method, data processing device, computer equipment and storage medium
CN111125169A (en) * 2019-11-28 2020-05-08 江苏苏宁物流有限公司 Data query method, control device, medium and computer equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112650760A (en) * 2021-01-15 2021-04-13 北京金和网络股份有限公司 Management method and device for caching service data to different addresses
CN112988874A (en) * 2021-04-08 2021-06-18 海南车智易通信息技术有限公司 Data processing method, system, computing device and readable storage medium

Also Published As

Publication number Publication date
CN111666265B (en) 2022-06-24

Similar Documents

Publication Publication Date Title
WO2021042923A1 (en) Data sharding storage method and apparatus, and terminal and computer-readable storage mediium
JP6967615B2 (en) Distributed search and index update methods, systems, servers and computer equipment
US20160026684A1 (en) Framework for volatile memory query execution in a multi node cluster
CN110489059B (en) Data cluster storage method and device and computer equipment
CN111666265B (en) Data management method, device, server and storage medium
CN112765262B (en) Data redistribution method, electronic equipment and storage medium
CN107004013A (en) System and method for providing distributed tree traversal using hardware based processing
CN111553670B (en) Transaction processing method and device and computer readable storage medium
CN110633378A (en) Graph database construction method supporting super-large scale relational network
CN113515364B (en) Data migration method and device, computer equipment and storage medium
CN107548039B (en) Short message retry processing method, device and system
CN111930770A (en) Data query method and device and electronic equipment
WO2024113996A1 (en) Optimization method and apparatus for host io processing, device, and nonvolatile readable storage medium
CN112860953A (en) Data importing method, device, equipment and storage medium of graph database
CN110515979B (en) Data query method, device, equipment and storage medium
US20230019037A1 (en) Reactive non-blocking input and output for target device communication
CN116233254A (en) Business cut-off method, device, computer equipment and storage medium
CN111259031A (en) Data updating method, device, equipment and storage medium
CN112988874A (en) Data processing method, system, computing device and readable storage medium
US10649821B2 (en) Method, system and apparatus for dynamically allocating event data
CN115269530A (en) Data synchronization method, electronic device and computer-readable storage medium
CN111611447B (en) Computer and server
US11445036B1 (en) Cluster management method and apparatus, electronic device and storage medium
CN116361309B (en) Data query system and method for updating cache data
CN109408241B (en) Load balancing method, device, equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant