CN110008281A - Method and device for processing visualized data based on Redis database - Google Patents
Method and device for processing visualized data based on Redis database Download PDFInfo
- Publication number
- CN110008281A CN110008281A CN201910276251.5A CN201910276251A CN110008281A CN 110008281 A CN110008281 A CN 110008281A CN 201910276251 A CN201910276251 A CN 201910276251A CN 110008281 A CN110008281 A CN 110008281A
- Authority
- CN
- China
- Prior art keywords
- data
- target data
- target
- mode
- command object
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 60
- 238000012545 processing Methods 0.000 title claims abstract description 31
- 238000013079 data visualisation Methods 0.000 claims abstract description 28
- 238000012800 visualization Methods 0.000 claims description 26
- 238000005538 encapsulation Methods 0.000 claims description 19
- 230000000007 visual effect Effects 0.000 claims description 16
- 238000003672 processing method Methods 0.000 claims description 14
- 230000008676 import Effects 0.000 claims description 3
- 238000005516 engineering process Methods 0.000 abstract description 10
- 238000003860 storage Methods 0.000 description 15
- 238000004590 computer program Methods 0.000 description 10
- 230000008569 process Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 6
- 230000002688 persistence Effects 0.000 description 6
- 230000000694 effects Effects 0.000 description 5
- 230000008859 change Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 2
- 238000000151 deposition Methods 0.000 description 2
- 238000011084 recovery Methods 0.000 description 2
- 108010001267 Protein Subunits Proteins 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 230000002045 lasting effect Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/26—Visual data mining; Browsing structured data
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/28—Databases characterised by their database models, e.g. relational or object models
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application discloses a method and a device for processing visualized data based on a Redis database. The method comprises the following steps: acquiring a target command; if the target command is used for performing data visualization processing, target data is obtained, wherein the target data is data stored in a Redis database; analyzing and recording an original coding mode of target data; if the original coding mode of the target data is not the target coding mode, converting the coding mode of the target data into the target coding mode; and writing the transcoded target data into a target file, wherein the target data is visible in a target coding mode. By the method and the device, the problem that data of other coding modes are not visible due to the fact that the Redis application tool in the related technology only supports viewing of data of a single data coding mode.
Description
Technical field
This application involves data visualization field, in particular to a kind of based on Redis database visualization data
Processing method and processing device.
Background technique
In the related technology, Redis server is only used as buffer, and the data in database are substantially all defeated from other
The Backup Data that place synchronizes, it is generally the case that the data stored in Redis can be any one or more coded number
According to being visually only a kind of coding mode, i.e., the data file opening of a variety of coding mode persistences is messy code, that is, though
The data of a variety of coding modes can be stored in right Redis, but current Redis application tool is only supported to check that single data are compiled
Code mode data, therefore other coding modes are not visible, the data for other coding modes that user sees are messy codes.
Meanwhile persistence viewdata being imported into the method in redis currently without a key.
For the above problem present in the relevant technologies, currently no effective solution has been proposed.
Summary of the invention
The main purpose of the application is to provide a kind of processing method and dress based on Redis database visualization data
It sets, to solve the data visualization that Redis application tool in the related technology only supports to check single data coding mode, so as to cause
The not visible problem of the data of other coding modes.
To achieve the goals above, it according to the one aspect of the application, provides a kind of based on Redis database visualization
The processing method of data.This method comprises: obtaining command object;If command object is handled data visualization for executing,
Then obtain target data, wherein target data is the data being stored in Redis database;It analyzes and records target data
Original encoding mode;If the original encoding mode of target data is not target code mode, the coding mode of target data is turned
For target code mode;File destination is written into target data after transcoding, wherein target data is under target code mode
Visual.
Further, this method further include: if the original encoding mode of target data is target code mode, by target
Data are written in file destination.
Further, target data is written in file destination further include: whether the format for judging target data is Json
Data format;If the format of target data is Json data format, target data is subjected to unserializing, and to antitone sequence
Serializing operation is carried out after data encapsulation after change;File destination is written into target data after serializing operation.
Further, this method further include: if the format of target data is not Json data format, by target data
It is packaged;Serializing operation is carried out to the target data after encapsulation, and target is written into the target data after serializing operation
File.
Further, after obtaining command object, this method further include: if command object leads data for executing
Enter in Redis database, then target data is read according to command object, wherein carry depositing for target data in command object
Store up the information in path;The information of store path based on target data reads target data;Restore the original encoding side of target data
Formula;And the target data for having restored original encoding mode is stored in Redis database.
Further, the original encoding mode for restoring target data includes: that target data is carried out unserializing operation, is obtained
Unserializing result, wherein include the original encoding mode of target data in unserializing result;Restore according to unserializing result
The original encoding mode of target data.
Further, target code mode is any one following coding mode: utf-8 or gbk.
Further, after obtaining command object, this method further include: judge whether command object is legal;If mesh
Mark order is legal, then executes corresponding object run according to command object, wherein the command object including predetermined keyword closes
Method, object run are one of the following: by data visualization processing and being imported data in Redis database.
To achieve the goals above, it according to the another aspect of the application, provides a kind of based on Redis database visualization
The processing unit of data.The device includes: first acquisition unit, for obtaining command object;Second acquisition unit, in mesh
In the case that mark order is handled data visualization for execution, target data is obtained, wherein target data is to be stored in
Data in Redis database;Recording unit is analyzed, for analyzing and recording the original encoding mode of target data;Transcoding units,
For in the case where the original encoding mode of target data is not target code mode, the coding mode of target data to be switched to mesh
Mark coding mode;Writing unit, for file destination to be written in the target data after transcoding, wherein under target code mode
Target data is visual.
Further, writing unit is also used in the case where the original encoding mode of target data is target code mode,
Target data is written in file destination.
By the application, using following steps: obtaining command object;If command object is for executing data visualization
Processing, then obtain target data, wherein target data is the data being stored in Redis database;It analyzes and records number of targets
According to original encoding mode;If the original encoding mode of target data is not target code mode, by the coding staff of target data
Formula switchs to target code mode;File destination is written into target data after transcoding, wherein the number of targets under target code mode
According to be it is visual, solve in the related technology Redis application tool only support to check the data visualization of single data coding mode, from
And the problem for causing the data of other coding modes not visible, and then by derived data will all unite from Redis database
One is a kind of predeterminated target coding mode, has achieved the effect that the application efficiency for improving Redis database.
Detailed description of the invention
The attached drawing constituted part of this application is used to provide further understanding of the present application, the schematic reality of the application
Example and its explanation are applied for explaining the application, is not constituted an undue limitation on the present application.In the accompanying drawings:
Fig. 1 is the process according to a kind of processing method based on Redis database visualization data of the embodiment of the present application
Figure;
Fig. 2 is the signal according to a kind of processing method based on Redis database visualization data of the embodiment of the present application
Figure;
Fig. 3 is according to a kind of processing unit based on Redis database visualization data provided by the embodiments of the present application
Schematic diagram.
Specific embodiment
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase
Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
In order to make those skilled in the art more fully understand application scheme, below in conjunction in the embodiment of the present application
Attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is only
The embodiment of the application a part, instead of all the embodiments.Based on the embodiment in the application, ordinary skill people
Member's every other embodiment obtained without making creative work, all should belong to the model of the application protection
It encloses.
It should be noted that the description and claims of this application and term " first " in above-mentioned attached drawing, "
Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this way
Data be interchangeable under appropriate circumstances, so as to embodiments herein described herein.In addition, term " includes " and " tool
Have " and their any deformation, it is intended that cover it is non-exclusive include, for example, containing a series of steps or units
Process, method, system, product or equipment those of are not necessarily limited to be clearly listed step or unit, but may include without clear
Other step or units listing to Chu or intrinsic for these process, methods, product or equipment.
For ease of description, below to the invention relates to part noun or term be illustrated:
Redis: BDS agreement is abided by, is a high performance key-value database.Redis supports the lasting of data
Change, the data in memory can be stored in disk, can be loaded again when restarting carry out using.Redis supports number
According to backup, i.e. the data backup of master-slave mode.
According to an embodiment of the present application, a kind of processing method based on Redis database visualization data is provided.
Fig. 1 is the process according to a kind of processing method based on Redis database visualization data of the embodiment of the present application
Figure.As shown in Figure 1, method includes the following steps:
Step S101 obtains command object.
Specifically, it is necessary first to obtain the order being manually entered.
Optionally, after obtaining command object, this method further include: judge whether command object is legal;If target
It is legal to order, then executes corresponding object run according to command object, wherein and the command object including predetermined keyword is legal,
Object run is one of the following: by data visualization processing and being imported data in Redis database.
Specifically, after obtaining command object, need the first step first judges whether command object is legal, if target is ordered
It include preset keyword in order, for example, key in order, password, library number, file path, document No. mode, is held at link
The keywords such as longization that is, it is believed that the command object obtained is legal, then judge object run corresponding to legal command object,
It is instruction for data visualization processing or imports data in Redis database, is carried out according to the instruction of command object corresponding
Operation.
Step S102 obtains target data, wherein mesh if command object is handled data visualization for executing
Marking data is the data being stored in Redis database.
Specifically, it if carrying out visualization processing to data according to the instruction of command object, extracts be stored in Redis first
Target data in database.
Step S103 analyzes and records the original encoding mode of target data.
Above-mentionedly, after extracting target data, it is necessary first to analyze target data, analysis target data is not deposited
Enter the original encoding mode before database, and original encoding mode is recorded.
Optionally, if the original encoding mode of target data is target code mode, by target data write-in target text
In part.
Specifically, goal-selling coding mode in this implementation, as long as the data under target code mode, that is, be not in
Mess code phenomenon, i.e. data visualization.If the original encoding mode for analyzing target data is just target code mode, directly by mesh
It marks data and file destination is written.
Step S104, if the original encoding mode of target data is not target code mode, by the coding of target data
Mode switchs to target code mode.
Specifically, after extracting target data and analyzing the original encoding mode of target data, if the former of target data is compiled
Code mode is not target code mode, needs the original encoding mode transcoding of target data to be target code mode.
File destination is written, wherein the target data under target code mode in target data after transcoding by step S105
It is visual.
Specifically, because the target data under target code mode is visual, become then carrying out the target data after transcoding
To be visual, the target data write-in file destination after transcoding is completed into file and is extracted, the operation of data visualization.
Optionally, this method further include: if the original encoding mode of target data is target code mode, by number of targets
According in write-in file destination.
Above-mentionedly, it if the original encoding mode of the target data extracted is exactly target code mode, needs directly
It is visual that target data is can be realized into target data write-in file destination.
Optionally, target data is written in file destination further include: whether the format for judging target data is Json number
According to format;If the format of target data is Json data format, target data is subjected to unserializing, and to unserializing
Serializing operation is carried out after data encapsulation afterwards;File destination is written into target data after serializing operation.
Specifically, Redis perdurable data provided in this embodiment is visually based on json data format, using serializing and
Unserializing principle persistence and parsing data, by data using structural body as carrier storage in persistence.So by transcoding
Or not when file destination is written in the target data of transcoding further include: the format of target data is judged, if target data
Format is Json data format, then the Json data can be carried out unserializing operation, then be packaged target data, will encapsulated
Target data afterwards serializes operation, and the purpose of serializing operation here is that the data after encapsulation are changed into character string lattice
Later file destination is written again in character string by formula.
Optionally, this method further include: if the format of target data is not Json data format, the target that will acquire
Data are packaged;Serializing operation is carried out to the target data after encapsulation, and the target data after serializing operation is written
File destination.
Above-mentionedly, it if it is judged that the format of target data is Json data format, then needs to carry out target data anti-
Serializing operation, so that the visualization format for the target data being stored in file destination is clear, orderly, clear, and to inverted sequence
The target data of columnization is packaged, then carries out serializing operation to the target data after encapsulation, so that target data is converted to
Then file destination is written in character string by character string.If it is judged that the data format of target data is not Json data format,
Directly target data is packaged, serializing operation then is carried out to the target data after encapsulation.
Optionally, target code mode is any one following coding mode: utf-8 or gbk.
Specifically, the coding mode of target data is unified for specified coding mode, target data can be realized from number
Effect visual in file is persisted to according to library.
By foregoing description, the method for above-mentioned offer is to carry out visualization processing to data, its purpose is that Redis is any
Coding mode data are persisted in file after taking, visual after opening file, are unable to messy code.
Optionally, after obtaining command object, this method further include: if command object is imported data to for executing
In Redis database, then target data is read according to command object, wherein the storage of target data is carried in command object
The information in path;The information of store path based on target data reads target data;Restore the original encoding mode of target data;
And the target data for having restored original encoding mode is stored in Redis database.
Specifically, such as foregoing description it is found that command object be also used to indicate by target data import Redis database in,
It include the store path of target data when in reading target data, in target instruction target word, by target data from store path
After extracting, according to the original encoding mode of the target data of record, the target data for having restored original encoding mode is stored in
Redis database.
It should be noted that the data of visual persistence is can be deposited into institute by the purpose of above-mentioned steps in a manner of original encoding
In the corresponding library redis.Due to having recorded original coding mode, so can be restored in redis in a manner of original encoding, therefore
The tool has the function of existing Backup Data, that is, has the function importeding into data original format in redis.
Optionally, the original encoding mode for restoring target data includes: that target data is carried out unserializing operation, is obtained anti-
Serialize result, wherein include the original encoding mode of target data in unserializing result;Restore mesh according to unserializing result
Mark the original encoding mode of data.
Above-mentionedly, the original encoding mode for restoring target data carries out unserializing operation firstly the need of by target data, obtains
Unserializing as a result, in result include original encoding mode, according to original encoding mode to target data carry out original encoding mode into
Row restores.
A kind of processing method based on Redis database visualization data provided by the embodiments of the present application, by obtaining mesh
Mark order;If command object is handled data visualization for executing, target data is obtained, wherein target data is to deposit
Store up the data in Redis database;Analyze and record the original encoding mode of target data;If the original encoding side of target data
Formula is not target code mode, then the coding mode of target data is switched to target code mode;By the target data after transcoding
File destination is written, wherein target data is visual under target code mode, solves Redis application work in the related technology
Tool only supports to check the data visualization of single data coding mode, not visible asks so as to cause the data of other coding modes
Topic, and then by derived data will all be unified for a kind of predeterminated target coding mode from Redis database, reach raising
The effect of the application efficiency of Redis database.
Fig. 2 is the signal according to a kind of processing method based on Redis database visualization data of the embodiment of the present application
Figure.As shown in Fig. 2, this method comprises: obtaining manual input commands judges whether order is persistence order, if it is according to key
Redis data are obtained, judge whether the coding mode of Redis data is UTF-8, if so, judging the data structure of data is
No is Json format, if coding mode is not UTF-8, simultaneously transcoding becomes UTF-8 to record original encoding mode, then judges data lattice
Whether formula is Json data format, if so, by data unserializing, if not encapsulated object, and by Data Serialization, then
File is written, perdurable data terminates.
If order is to execute the order for reading file data, by data unserializing, data encoding in structural body is taken out
Record, judges whether data coding mode is UTF-8, if so, depositing into Redis, restores original encoding side if not by data
Formula is stored in Redis.
Target code mode of illustrating in Fig. 2 is utf-8, which can be specified according to specific requirements, is only in figure
Facilitate citing, does not represent target code mode unique.
By the above method, solves Redis application tool in the related technology and only support to check single data coding mode
Data visualization, so as to cause the not visible problem of the data of other coding modes, and then by that will be exported from Redis database
Data be all unified for a kind of predeterminated target coding mode, achieved the effect that the application efficiency for improving Redis database.
It should be noted that step shown in the flowchart of the accompanying drawings can be in such as a group of computer-executable instructions
It is executed in computer system, although also, logical order is shown in flow charts, and it in some cases, can be with not
The sequence being same as herein executes shown or described step.
The embodiment of the present application also provides a kind of processing units based on Redis database visualization data, need to illustrate
, a kind of processing unit based on Redis database visualization data of the embodiment of the present application can be used for executing the application
A kind of processing method based on Redis database visualization data is used for provided by embodiment.Below to the embodiment of the present application
A kind of processing unit based on Redis database visualization data of offer is introduced.
Fig. 3 is according to a kind of processing unit based on Redis database visualization data provided by the embodiments of the present application
Schematic diagram.As shown in figure 3, the device includes: first acquisition unit 301, for obtaining command object;Second acquisition unit 303,
For obtaining target data in the case where command object is handled data visualization for executing, wherein target data is to deposit
Store up the data in Redis database;Recording unit 303 is analyzed, for analyzing and recording the original encoding mode of target data;Turn
Code unit 304, in the case where the original encoding mode of target data is not target code mode, by the coding of target data
Mode switchs to target code mode;Writing unit 305, for file destination to be written in the target data after transcoding, wherein in mesh
It is visual for marking target data under coding mode.
A kind of processing unit based on Redis database visualization data provided by the embodiments of the present application, is obtained by first
Unit 301 is taken, for obtaining command object;Second acquisition unit 302, for being used to execute data visualization in command object
In the case where processing, target data is obtained, wherein target data is the data being stored in Redis database;Analyze record
Member 303, for analyzing and recording the original encoding mode of target data;Transcoding units 304, in the original encoding side of target data
In the case that formula is not target code mode, the coding mode of target data is switched into target code mode;Writing unit 305,
For file destination to be written in the target data after transcoding, wherein target data is visual under target code mode, is solved
Redis application tool is only supported to check the data visualization of single data coding mode in the related technology, so as to cause other codings
The not visible problem of the data of mode, and then by derived data will all be unified for a kind of predetermined mesh from Redis database
Coding mode is marked, has achieved the effect that the application efficiency for improving Redis database.
Optionally, writing unit 305 is also used in the case where the original encoding mode of target data is target code mode,
Target data is written in file destination.
Optionally, writing unit 305 further include: judgment sub-unit, for judging whether the format of target data is Json
Data format;First encapsulation subelement, for the format of target data be Json data format in the case where, by target data
It is packaged;First ray beggar's unit, for carrying out serializing operation to the target data after encapsulation;First write-in is single
File destination is written for that will serialize the target data after operating in member.
Optionally, writing unit 305 further include: the first unserializing subelement is not for the format in target data
In the case where Json data format, target data is subjected to unserializing operation;Second encapsulation subelement, for encapsulating antitone sequence
Target data after changing operation;Second serializing subelement, for carrying out serializing operation to the target data after encapsulation;Second
Subelement is written, be used for and file destination is written into the target data after serializing operation.
Optionally, device further include: the first reading unit is used for after obtaining command object, if command object
It is imported data in Redis database for executing, then target data is read according to command object, wherein take in command object
The information of store path with target data;Second reading unit, the information for the store path based on target data are read
Take target data;Recovery unit, for restoring the original encoding mode of target data;It is stored in unit, for original encoding will to have been restored
The target data of mode is stored in Redis database.
Optionally, recovery unit includes: the second unserializing subelement, for target data to be carried out unserializing behaviour
Make, obtain unserializing result, wherein includes the original encoding mode of target data in unserializing result;Restore subelement, uses
In the original encoding mode for restoring target data according to unserializing result.
Optionally, target code mode is any one following coding mode: utf-8 or gbk.
Optionally, the device further include: judging unit, for whether judging command object after obtaining command object
It is legal;Execution unit, for executing corresponding object run according to command object in the case where command object is legal, wherein
Command object including predetermined keyword is legal, and object run is one of the following: by data visualization processing and importing data to
In Redis database.
A kind of processing unit based on Redis database visualization data includes processor and memory, and above-mentioned first obtains
Take unit 301, second acquisition unit 303, analysis recording unit 303, transcoding units 304 and writing unit 305 etc. as journey
Sequence unit stores in memory, executes above procedure unit stored in memory by processor to realize corresponding function
Energy.
Include kernel in processor, is gone in memory to transfer corresponding program unit by kernel.Kernel can be set one
Or more, it only supports to check single data encoding side to solve Redis application tool in the related technology by adjusting kernel parameter
The data visualization of formula, so as to cause the not visible problem of the data of other coding modes.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/
Or the forms such as Nonvolatile memory, if read-only memory (ROM) or flash memory (flash RAM), memory include that at least one is deposited
Store up chip.
The embodiment of the invention provides a kind of storage mediums, are stored thereon with program, real when which is executed by processor
A kind of existing processing method based on Redis database visualization data.
The embodiment of the invention provides a kind of processor, processor is for running program, wherein program executes one when running
Processing method of the kind based on Redis database visualization data.
The embodiment of the invention provides a kind of equipment, equipment include processor, memory and storage on a memory and can
The program run on a processor, processor perform the steps of acquisition command object when executing program;If command object is used
Data visualization is handled in executing, then obtains target data, wherein target data is the number being stored in Redis database
According to;Analyze and record the original encoding mode of target data;If the original encoding mode of target data is not target code mode,
The coding mode of target data is switched into target code mode;File destination is written into target data after transcoding, wherein in mesh
It is visual for marking target data under coding mode.
Optionally, this method further include: if the original encoding mode of target data is target code mode, by number of targets
According in write-in file destination.
Optionally, target data is written in file destination further include: whether the format for judging target data is Json number
According to format;If the format of target data is Json data format, target data is subjected to unserializing, and to unserializing
Serializing operation is carried out after data encapsulation afterwards;File destination is written into target data after serializing operation.
Optionally, this method further include: if the format of target data is not Json data format, by target data into
Row encapsulation;Serializing operation is carried out to the target data after encapsulation, and the target data write-in target after serializing operation is literary
Part.
Optionally, after obtaining command object, this method further include: if command object is imported data to for executing
In Redis database, then target data is read according to command object, wherein the storage of target data is carried in command object
The information in path;The information of store path based on target data reads target data;Restore the original encoding mode of target data;
And the target data for having restored original encoding mode is stored in Redis database.
Optionally, the original encoding mode for restoring target data includes: that target data is carried out unserializing operation, is obtained anti-
Serialize result, wherein include the original encoding mode of target data in unserializing result;Restore mesh according to unserializing result
Mark the original encoding mode of data.
Optionally, target code mode is any one following coding mode: utf-8 or gbk.
Optionally, after obtaining command object, this method further include: judge whether command object is legal;If target
It is legal to order, then executes corresponding object run according to command object, wherein and the command object including predetermined keyword is legal,
Object run is one of the following: by data visualization processing and being imported data in Redis database.Equipment herein can be with
It is server, PC, PAD, mobile phone etc..
Present invention also provides a kind of computer program products, when executing on data processing equipment, are adapted for carrying out just
The program of beginningization there are as below methods step: command object is obtained;If command object is handled data visualization for executing,
Obtain target data, wherein target data is the data being stored in Redis database;Analyze and record the original of target data
Coding mode;If the original encoding mode of target data is not target code mode, the coding mode of target data is switched to
Target code mode;By after transcoding target data be written file destination, wherein under target code mode target data be can
Depending on.
Optionally, this method further include: if the original encoding mode of target data is target code mode, by number of targets
According in write-in file destination.
Optionally, target data is written in file destination further include: whether the format for judging target data is Json number
According to format;If the format of target data is Json data format, target data is subjected to unserializing, and to unserializing
Serializing operation is carried out after data encapsulation afterwards;File destination is written into target data after serializing operation.
Optionally, this method further include: if the format of target data is not Json data format, by target data into
Row encapsulation;Serializing operation is carried out to the target data after encapsulation, and the target data write-in target after serializing operation is literary
Part.
Optionally, after obtaining command object, this method further include: if command object is imported data to for executing
In Redis database, then target data is read according to command object, wherein the storage of target data is carried in command object
The information in path;The information of store path based on target data reads target data;Restore the original encoding mode of target data;
And the target data for having restored original encoding mode is stored in Redis database.
Optionally, the original encoding mode for restoring target data includes: that target data is carried out unserializing operation, is obtained anti-
Serialize result, wherein include the original encoding mode of target data in unserializing result;Restore mesh according to unserializing result
Mark the original encoding mode of data.
Optionally, target code mode is any one following coding mode: utf-8 or gbk.
Optionally, after obtaining command object, this method further include: judge whether command object is legal;If target
It is legal to order, then executes corresponding object run according to command object, wherein and the command object including predetermined keyword is legal,
Object run is one of the following: by data visualization processing and being imported data in Redis database.
It should be understood by those skilled in the art that, embodiments herein can provide as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the application
Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the application, which can be used in one or more,
The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces
The form of product.
The application is referring to method, the process of equipment (system) and computer program product according to the embodiment of the present application
Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions
The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs
Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real
The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
In a typical configuration, calculating equipment includes one or more processors (CPU), input/output interface, net
Network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/
Or the forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable Jie
The example of matter.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices
Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates
Machine readable medium does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability
It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap
Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including element
There is also other identical elements in process, method, commodity or equipment.
It will be understood by those skilled in the art that embodiments herein can provide as method, system or computer program product.
Therefore, complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in the application
Form.It is deposited moreover, the application can be used to can be used in the computer that one or more wherein includes computer usable program code
The shape for the computer program product implemented on storage media (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
Formula.
The above is only embodiments herein, are not intended to limit this application.To those skilled in the art,
Various changes and changes are possible in this application.It is all within the spirit and principles of the present application made by any modification, equivalent replacement,
Improve etc., it should be included within the scope of the claims of this application.
Claims (10)
1. a kind of processing method based on Redis database visualization data characterized by comprising
Obtain command object;
If the command object is handled data visualization for executing, target data is obtained, wherein the target data
For the data being stored in Redis database;
Analyze and record the original encoding mode of the target data;
If the original encoding mode of the target data is not target code mode, the coding mode of the target data is turned
For the target code mode;
File destination is written into the target data after transcoding, wherein the target data under the target code mode
It is visual.
2. the method according to claim 1, wherein the method also includes: if the original of target data
Coding mode is target code mode, then the target data is written in the file destination.
3. method according to claim 1 or 2, which is characterized in that the target data to be written in the file destination
Further include:
Whether the format for judging the target data is Json data format;
If the format of the target data is Json data format, the target data is subjected to unserializing, and to anti-
Serializing operation is carried out after data encapsulation after serializing;
The file destination is written into the target data after serializing operation.
4. according to the method described in claim 3, it is characterized in that, the method also includes:
If the format of the target data is not Json data format, the target data is packaged;
Serializing operation is carried out to the target data after encapsulation, and institute is written into the target data after serializing operation
State file destination.
5. the method according to claim 1, wherein after obtaining command object, the method also includes:
If the command object imports data in Redis database for executing, institute is read according to the command object
State target data, wherein the information of the store path of the target data is carried in the command object;
The information of store path based on the target data reads the target data;
Restore the original encoding mode of the target data;
And the target data for having restored original encoding mode is stored in the Redis database.
6. according to the method described in claim 5, it is characterized in that, the original encoding mode for restoring the target data includes:
The target data is subjected to unserializing operation, obtains unserializing result, wherein wrap in the unserializing result
Include the original encoding mode of the target data;
Restore the original encoding mode of the target data according to the unserializing result.
7. the method according to claim 1, wherein the target code mode is any one following coding staff
Formula: utf-8 or gbk.
8. the method according to claim 1, wherein after obtaining command object, the method also includes:
Judge whether the command object is legal;
If the command object is legal, corresponding object run is executed according to the command object, wherein close including default
The command object of keyword is legal, and the object run is one of the following: by data visualization processing and importing data to
In Redis database.
9. a kind of processing unit based on Redis database visualization data characterized by comprising
First acquisition unit, for obtaining command object;
Second acquisition unit, for obtaining target in the case where the command object is handled data visualization for executing
Data, wherein the target data is the data being stored in Redis database;
Recording unit is analyzed, for analyzing and recording the original encoding mode of the target data;
Transcoding units, in the case where the original encoding mode of the target data is not target code mode, by the mesh
The coding mode of mark data switchs to the target code mode;
Writing unit, for file destination to be written in the target data after transcoding, wherein under the target code mode
The target data is visual.
10. device according to claim 9, which is characterized in that said write unit is also used to described in the target data
In the case that original encoding mode is target code mode, the target data is written in the file destination.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910276251.5A CN110008281A (en) | 2019-04-08 | 2019-04-08 | Method and device for processing visualized data based on Redis database |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910276251.5A CN110008281A (en) | 2019-04-08 | 2019-04-08 | Method and device for processing visualized data based on Redis database |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110008281A true CN110008281A (en) | 2019-07-12 |
Family
ID=67170259
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910276251.5A Pending CN110008281A (en) | 2019-04-08 | 2019-04-08 | Method and device for processing visualized data based on Redis database |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110008281A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112527298A (en) * | 2021-02-08 | 2021-03-19 | 北京关键科技股份有限公司 | Military software management data display method and system based on genotype spectrum |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110264819A1 (en) * | 2010-04-24 | 2011-10-27 | Sudharshan Srinivasan | Binary data serialization system using machine dependant data alignement |
CN102487493A (en) * | 2009-11-06 | 2012-06-06 | 中国电信股份有限公司 | Short message processing method and international intercommunication gateway |
CN103236959A (en) * | 2013-05-09 | 2013-08-07 | 中国银行股份有限公司 | Test system and test method for testing business processing module |
CN103605518A (en) * | 2013-11-19 | 2014-02-26 | 北京国双科技有限公司 | Object deserialization method and device |
US20140254659A1 (en) * | 2013-03-11 | 2014-09-11 | Mediatek Inc. | Video coding method using at least evaluated visual quality and related video coding apparatus |
CN106202235A (en) * | 2016-06-28 | 2016-12-07 | 微梦创科网络科技(中国)有限公司 | A kind of data processing method and device |
CN108846072A (en) * | 2018-06-08 | 2018-11-20 | 国网山东省电力公司临沂供电公司 | A kind of data realization encapsulation technology based on visual analyzing |
-
2019
- 2019-04-08 CN CN201910276251.5A patent/CN110008281A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102487493A (en) * | 2009-11-06 | 2012-06-06 | 中国电信股份有限公司 | Short message processing method and international intercommunication gateway |
US20110264819A1 (en) * | 2010-04-24 | 2011-10-27 | Sudharshan Srinivasan | Binary data serialization system using machine dependant data alignement |
US20140254659A1 (en) * | 2013-03-11 | 2014-09-11 | Mediatek Inc. | Video coding method using at least evaluated visual quality and related video coding apparatus |
CN103236959A (en) * | 2013-05-09 | 2013-08-07 | 中国银行股份有限公司 | Test system and test method for testing business processing module |
CN103605518A (en) * | 2013-11-19 | 2014-02-26 | 北京国双科技有限公司 | Object deserialization method and device |
CN106202235A (en) * | 2016-06-28 | 2016-12-07 | 微梦创科网络科技(中国)有限公司 | A kind of data processing method and device |
CN108846072A (en) * | 2018-06-08 | 2018-11-20 | 国网山东省电力公司临沂供电公司 | A kind of data realization encapsulation technology based on visual analyzing |
Non-Patent Citations (1)
Title |
---|
吹静静: "Windows下永久解决数据库乱码utf8转gbk", 《HTTPS://WWW.CNBLOGS.COM/CHUIJINGJING/P/9850440.HTML》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112527298A (en) * | 2021-02-08 | 2021-03-19 | 北京关键科技股份有限公司 | Military software management data display method and system based on genotype spectrum |
CN112527298B (en) * | 2021-02-08 | 2021-06-22 | 北京关键科技股份有限公司 | Military software management data display method and system based on genotype spectrum |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108509185B (en) | System and method for arbitrary software logic modeling | |
CN106844682B (en) | Method for interchanging data, apparatus and system | |
CN109783084A (en) | A kind of computer code automatic generation method, system, device and storage medium | |
CN105446865A (en) | Test method and device under multi-environment | |
CN107066266A (en) | Unity data processing method and device is supported in Android application | |
CN106990960A (en) | Code dispositions method and device | |
CN110471754A (en) | Method for exhibiting data, device, equipment and storage medium in job scheduling | |
CN104714957B (en) | A kind of variation and device of table structure | |
CN112163017B (en) | Knowledge mining system and method | |
CN104423961A (en) | Method and system for generating testing script | |
CN106598828B (en) | A kind of invalid class in source code determines method and device | |
CN110019111A (en) | Data processing method, device, storage medium and processor | |
CN107330028A (en) | Expansion application methods and system of a kind of Apache NiFi in terms of source data input database | |
CN106844288A (en) | A kind of random string generation method and device | |
CN106547658A (en) | A kind of automated testing method and device | |
CN107479866B (en) | A method for realizing open terminal application data and functions based on reconstruction technology | |
CN112364074A (en) | Time sequence data visualization method, equipment and medium | |
CN109558548A (en) | A kind of method and Related product for eliminating CSS style redundancy | |
CN110008281A (en) | Method and device for processing visualized data based on Redis database | |
CN103425795A (en) | Radar data analyzing method based on cloud calculation | |
CN109343871A (en) | Method, apparatus, equipment and the storage medium that application program is packaged | |
CN109086362A (en) | The management method of multimode project | |
CN109960497A (en) | Call method and device between a kind of script file | |
CA2830868A1 (en) | A digital netlist partitioning system for faster circuit reverse-engineering | |
CN107016112A (en) | A kind of method of heterogeneous storage system map publishing |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190712 |