CN111782631A - Management system and management method based on mysql and redis databases - Google Patents

Management system and management method based on mysql and redis databases Download PDF

Info

Publication number
CN111782631A
CN111782631A CN202010599326.6A CN202010599326A CN111782631A CN 111782631 A CN111782631 A CN 111782631A CN 202010599326 A CN202010599326 A CN 202010599326A CN 111782631 A CN111782631 A CN 111782631A
Authority
CN
China
Prior art keywords
mysql
internet
database
redis
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010599326.6A
Other languages
Chinese (zh)
Inventor
张红艳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hebei Shengyu Zhike Environmental Technology Co Ltd
Original Assignee
Hebei Shengyu Zhike Environmental 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 Hebei Shengyu Zhike Environmental Technology Co Ltd filed Critical Hebei Shengyu Zhike Environmental Technology Co Ltd
Priority to CN202010599326.6A priority Critical patent/CN111782631A/en
Publication of CN111782631A publication Critical patent/CN111782631A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/217Database tuning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

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)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a management method based on mysql and redis databases, which comprises the following specific steps: step 1: user information is sent to the Internet of things server through different interfaces; step 2: the internet of things server stores the user message into a message queue of a redis database; and step 3: the system server acquires the user message from the message queue of the redis database and stores the user message in the mysql database; and 4, step 4: and the system server calls an interface for processing the user message, feeds back a response and pushes the user message in the mysql database to the Internet of things equipment. The invention discloses a management system and a management method based on mysql and Redis databases, which are used for completing communication between a management system server and an internet of things server through a socket, directly operating internet of things equipment in the management system, caching the internet of things equipment by using the Redis database and improving the data processing speed.

Description

Management system and management method based on mysql and redis databases
Technical Field
The invention relates to the technical field of data processing, in particular to a management system and a management method based on mysql and redis databases.
Background
In the field of data processing, the most common operation is a request-response operation, the request is usually provided in the form of a message, and the message processing has two forms, one is synchronous processing, namely, sending a request, waiting for returning, then sending the next request, and having a waiting process; the other asynchronous processing means that one request is sent without waiting for return, and the next request can be sent at any time, namely, without waiting; however, the synchronous processing has a process of waiting for response, the processing of the message is not timely enough, the access amount born by the backend service every day and the data amount of the operation are continuously increased, and as a result, the load of the backend application service is too large and the processing is slow, and even more, the server is crashed, which greatly affects the operation of the system. At present, many management systems are complex and redundant, the efficiency is not high, and the popularization of the management systems is greatly influenced.
Therefore, how to provide a management system and a management method for solving the problem of low message processing efficiency is an urgent problem to be solved by those skilled in the art.
Disclosure of Invention
In view of the above, the invention provides a management system and a management method based on mysql and Redis databases, which complete communication between a management system server and an internet of things server through a socket, can directly operate internet of things equipment in the management system, and cache the internet of things equipment by using the Redis database, thereby improving the data processing speed.
In order to achieve the above purpose, the invention provides the following technical scheme:
a management method based on mysql and redis databases comprises the following specific steps:
step 1: user information is sent to the Internet of things server through different interfaces;
step 2: the internet of things server stores the user message into a message queue of a redis database;
and step 3: the system server acquires the user message from the message queue of the redis database and stores the user message in the mysql database;
and 4, step 4: and the system server calls an interface for processing the user message, feeds back a response and pushes the user message in the mysql database to the Internet of things equipment.
Preferably, in the management method based on mysql and redis databases, when the speed of processing the message is slower than the storage speed of the user message, the message queue is cached in the redis database.
Preferably, in the above management method based on mysql and redis databases, in step 3, the specific step of saving the user message to the mysql database includes:
step 31: the Internet of things server analyzes the user behavior by calling a computing interface according to the user behavior log, and calculates and generates an index result, a rule result and a strategy result;
step 32: storing the index result, the rule result and the strategy result into a redis database, and calculating and acquiring alarm and security event information;
step 33: and writing the acquired alarm and security event information into the mysql database.
Preferably, in the management method based on mysql and redis databases, in the step 32, preprocessing is performed in the redis database; and the preprocessing processes the information with the connection into one information according to the incidence relation and selects a processing mode.
A mysql and redis database-based management system, comprising: the system comprises a system server, an Internet of things server, Internet of things equipment, a client, a mysql database and a redis database; the client controls the Internet of things equipment through the Internet of things server; and the Internet of things server and the system server perform data interaction through the mysql database and the redis database.
Preferably, in the management system based on mysql and redis databases, the client and the internet of things server perform data transmission through at least one communication protocol.
Preferably, in the management system based on mysql and redis databases, the management system further includes a management system front end connected to the system server; the management system front end is used for packaging rules, user login and authentication into middleware.
Preferably, in the management system based on mysql and redis databases, the internet of things server is connected to the system server by using a socket protocol.
According to the technical scheme, compared with the prior art, the management system and the management method based on the mysql and the Redis databases are provided, communication between the management system server and the internet of things server is completed through the socket, the internet of things equipment can be directly operated in the management system, the Redis database is used for caching the internet of things equipment, and the data processing speed is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a schematic diagram of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention discloses a management system and a management method based on mysql and Redis databases, communication between a management system server and an internet of things server is completed through a socket, internet of things equipment can be directly operated in the management system, the Redis database is used for caching the internet of things equipment, and the data processing speed is increased.
In order to give consideration to a plurality of factors such as low hardware cost, high response speed, reliability and safety, Redis and MySQL are combined together, a server of the Internet of things stores user information into an information queue of a Redis database, relevant calculation is carried out on the information through the calculation capacity of Redis to obtain a result, a system server obtains the information from a list queue of the Redis, and then the information is stored into the MySQL at the same time to realize data persistence of the information, so that the reliability and the safety of the data before the information is successfully processed are ensured; the application server stores the data into MySQL and then calls an interface for processing the message to process the message; and when the message is successfully processed and returned, controlling the equipment of the Internet of things to act.
A management method based on mysql and redis databases comprises the following specific steps:
step 1: user information is sent to the Internet of things server through different interfaces;
step 2: the internet of things server stores the user message into a message queue of a redis database;
and step 3: the system server acquires the user message from the message queue of the redis database and stores the user message in the mysql database;
and 4, step 4: and the system server calls an interface for processing the user message, feeds back a response and pushes the user message in the mysql database to the Internet of things equipment.
In order to further optimize the technical effect, when the speed of processing the message is slower than the storage speed of the user message, the message queue is cached in the redis database.
In order to further optimize the technical effect, in step 3, the specific step of saving the user message in the mysql database includes:
step 31: the Internet of things server analyzes the user behavior by calling a computing interface according to the user behavior log, and calculates and generates an index result, a rule result and a strategy result;
step 32: storing the index result, the rule result and the strategy result into a redis database, and calculating to obtain alarm and security event information;
step 33: and writing the acquired alarm and security event information into the mysql database.
In order to further optimize the above technical effect, in step 32, preprocessing is performed in the redis database; preprocessing processes the associated message into a message according to the association relationship, and selects a processing mode. For example, the repeated messages are subjected to the deduplication operation, so that the number of messages in the message queue can be reduced, and the messages with different request sources and identical request contents are subjected to the merging operation, so that the actual message processing operation can be reduced, such as a table lookup operation for querying the same content by a plurality of users, and the operations can be merged into one operation comprising a plurality of request sources. The messages in the message queue are preprocessed, so that a plurality of connected messages are processed into one message, and the message processing efficiency is greatly improved.
A mysql and redis database-based management system, comprising: the system comprises a system server, an Internet of things server, Internet of things equipment, a client, a mysql database and a redis database; the client controls the Internet of things equipment through the Internet of things server; and the Internet of things server and the system server perform data interaction through the mysql database and the redis database.
In order to further optimize the technical effect, the client and the internet of things server perform data transmission through at least one communication protocol.
In order to further optimize the technical effect, the system also comprises a management system front end connected with the system server; the management system front end is used for packaging the rules, user login and authentication into middleware.
In order to further optimize the technical effect, the internet of things server is connected with the system server by using a socket protocol.
The invention has the technical effects that: (1) the response time required when a user instruction is successfully processed can be effectively reduced, and the overall efficiency of message processing is improved; (2) the database space can be emptied in advance, so that a plurality of instructions can share the same MySQL database space at the same time (the phenomenon that the application systems of one instruction occupy the database space for a long time to cause that the application systems of other consumption messages lack enough database space to store the messages is avoided); (3) the method is beneficial to acquiring a plurality of messages with the association relationship and processing the messages at the same time.
Taking intelligent garbage classification and recycling as an example, a user puts garbage to be recycled according to different categories through a client, firstly, user login, authorization and other operations are carried out at the front end of a management system, because the recycling prices of various types of garbage are different, an internet of things server transmits the garbage according to a price rule built in the system server through a socket protocol, secondly, when the user puts a batch of similar garbage, the user selects a plastic internet of things server to call the price rule of the system server, the price of the plastic is 1.4 yuan/kg, and internet of things equipment weighs and pays the garbage to finish recycling; finally, when the user continuously puts in different types of garbage, such as pots, kettles, pillows, plush toys and quilts; the method comprises the following steps that users respectively select different garbage types to form task queues, the task queues are stored in a redis database, and a system server acquires user messages from message queues of the redis database and stores the user messages in a mysql database; the redis database carries out preprocessing according to the contact of each task, wherein the pot and the kettle are metal, the throw pillow, the plush toy and the cotton quilt belong to textile, the prices of the metal and the textile are respectively called from the system server, and the internet of things equipment weighs, pays and finishes recycling.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. A management method based on mysql and redis databases is characterized by comprising the following specific steps:
step 1: user information is sent to the Internet of things server through different interfaces;
step 2: the internet of things server stores the user message into a message queue of a redis database;
and step 3: the system server acquires the user message from the message queue of the redis database and stores the user message in the mysql database;
and 4, step 4: and the system server calls an interface for processing the user message, feeds back a response and pushes the user message in the mysql database to the Internet of things equipment.
2. The mysql and redis database-based management method according to claim 1, wherein when the message processing speed is slower than the user message storage speed, the message queue is cached in the redis database.
3. The mysql and redis database-based management method according to claim 1, wherein in the step 3, the specific step of saving the user message to the mysql database includes:
step 31: the Internet of things server analyzes the user behavior by calling a computing interface according to the user behavior log, and calculates and generates an index result, a rule result and a strategy result;
step 32: storing the index result, the rule result and the strategy result into a redis database, and calculating and acquiring alarm and security event information;
step 33: and writing the acquired alarm and security event information into the mysql database.
4. The mysql and redis database-based management method according to claim 3, wherein in the step 32, preprocessing is performed in the redis database; and the preprocessing processes the information with the connection into one information according to the incidence relation and selects a processing mode.
5. A management system based on mysql and redis databases, comprising: the system comprises a system server, an Internet of things server, Internet of things equipment, a client, a mysql database and a redis database; the client controls the Internet of things equipment through the Internet of things server; and the Internet of things server and the system server perform data interaction through the mysql database and the redis database.
6. The mysql and redis database-based management system according to claim 5, wherein the client and the internet of things server perform data transmission via at least one communication protocol.
7. The mysql and redis database-based management system of claim 5, further comprising a management system front end connected to the system server; the management system front end is used for packaging rules, user login and authentication into middleware.
8. The mysql and redis database-based management system according to claim 5, wherein the internet of things server and the system server are connected by using a socket protocol.
CN202010599326.6A 2020-06-28 2020-06-28 Management system and management method based on mysql and redis databases Pending CN111782631A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010599326.6A CN111782631A (en) 2020-06-28 2020-06-28 Management system and management method based on mysql and redis databases

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010599326.6A CN111782631A (en) 2020-06-28 2020-06-28 Management system and management method based on mysql and redis databases

Publications (1)

Publication Number Publication Date
CN111782631A true CN111782631A (en) 2020-10-16

Family

ID=72761576

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010599326.6A Pending CN111782631A (en) 2020-06-28 2020-06-28 Management system and management method based on mysql and redis databases

Country Status (1)

Country Link
CN (1) CN111782631A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105929874A (en) * 2016-04-22 2016-09-07 北京石油化工学院 Warehouse temperature and humidity remote intelligent control system based on internet of things
US20170286011A1 (en) * 2016-04-05 2017-10-05 International Business Machines Corporation Monitoring storage systems
CN107733778A (en) * 2017-08-18 2018-02-23 深圳市艾特智能科技有限公司 Message treatment method, system, storage medium and computer equipment
CN109445965A (en) * 2018-11-07 2019-03-08 北京明朝万达科技股份有限公司 By the Redis and MySQL message treatment method realized and equipment
CN110351270A (en) * 2019-07-05 2019-10-18 深圳市浩科电子有限公司 A kind of method and system improving concurrent data treatment effeciency
CN110417629A (en) * 2019-07-26 2019-11-05 深圳市浩科电子有限公司 The method and system of one kind of multiple different types of internet of things equipment access Internet of Things
CN111176352A (en) * 2019-12-30 2020-05-19 中国铁道科学研究院集团有限公司电子计算技术研究所 Environment monitoring system and method in intelligent railway passenger station

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170286011A1 (en) * 2016-04-05 2017-10-05 International Business Machines Corporation Monitoring storage systems
CN105929874A (en) * 2016-04-22 2016-09-07 北京石油化工学院 Warehouse temperature and humidity remote intelligent control system based on internet of things
CN107733778A (en) * 2017-08-18 2018-02-23 深圳市艾特智能科技有限公司 Message treatment method, system, storage medium and computer equipment
CN109445965A (en) * 2018-11-07 2019-03-08 北京明朝万达科技股份有限公司 By the Redis and MySQL message treatment method realized and equipment
CN110351270A (en) * 2019-07-05 2019-10-18 深圳市浩科电子有限公司 A kind of method and system improving concurrent data treatment effeciency
CN110417629A (en) * 2019-07-26 2019-11-05 深圳市浩科电子有限公司 The method and system of one kind of multiple different types of internet of things equipment access Internet of Things
CN111176352A (en) * 2019-12-30 2020-05-19 中国铁道科学研究院集团有限公司电子计算技术研究所 Environment monitoring system and method in intelligent railway passenger station

Similar Documents

Publication Publication Date Title
US6910070B1 (en) Methods and systems for asynchronous notification of database events
CN111680124A (en) RPA-based large-scale customized customer demand obtaining and inquiring method
CN111078436B (en) Data processing method, device, equipment and storage medium
CN111881221A (en) Method, device and equipment for customer portrait in logistics service
CN104219235A (en) Distributed transaction requesting method and device
CN114760286A (en) Remote cabinet opening method, device, equipment and storage medium of shared cabinet
CN102571371A (en) Network information pushing method and system
CN108711025A (en) It hires a car vehicle inquiring stock method, apparatus, electronic equipment, storage medium
CN101087262A (en) An instant communication processing method and system
CN105046466A (en) Inventory data concurrency control system and inventory data concurrency control method
CN111159300A (en) Data processing method and device based on block chain
CN111709696B (en) Method and device for generating mailing list based on SOA architecture
CN111782631A (en) Management system and management method based on mysql and redis databases
WO2001065382A1 (en) Method and system for processing requests using dynamically loadable rules determined by class and context
CN107451301B (en) Processing method, device, equipment and storage medium for real-time delivery bill mail
CN103970592B (en) The single thread multi-task processing method and server of transaction middleware
CN115757490A (en) Implementation method and device for avoiding repeated invoicing of internet
CN115081413A (en) Report generation method, device, system, equipment and medium
CN112633855B (en) Task reminding method and computer equipment
CN110377421B (en) Data source access method and device based on single data item label
CN111400053B (en) Database access system, method, apparatus and computer readable storage medium
CN111210288A (en) Tax control server-based invoicing batch invoicing job optimized scheduling method and system
CN113762819A (en) Channel scheduling method and device
CN111582996A (en) Business information display method and device
CN112150083B (en) Message sending method and device, electronic 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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Room 201, Office Building, No. 110 Diamond Street, Wusi Middle Road, Sub District Office, Hancun North Road, Jingxiu District, Baoding City, Hebei Province, 071000

Applicant after: Hebei Shengyu Zhike Environmental Technology Co.,Ltd.

Address before: 071000 Commercial, No. 989, West 2nd Ring Road, Jiezhuang Township, Jingxiu District, Baoding City, Hebei Province

Applicant before: Hebei Shengyu Zhike Environmental Technology Co.,Ltd.