CN117271667A - Data reading method and device, electronic equipment and storage medium - Google Patents

Data reading method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117271667A
CN117271667A CN202311281684.2A CN202311281684A CN117271667A CN 117271667 A CN117271667 A CN 117271667A CN 202311281684 A CN202311281684 A CN 202311281684A CN 117271667 A CN117271667 A CN 117271667A
Authority
CN
China
Prior art keywords
database
internet
equipment
things
data
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
CN202311281684.2A
Other languages
Chinese (zh)
Inventor
梁剑明
赵定金
张常华
明德
林弟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Baolun Electronics Co ltd
Original Assignee
Guangdong Baolun Electronics 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 Guangdong Baolun Electronics Co ltd filed Critical Guangdong Baolun Electronics Co ltd
Priority to CN202311281684.2A priority Critical patent/CN117271667A/en
Publication of CN117271667A publication Critical patent/CN117271667A/en
Pending legal-status Critical Current

Links

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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • 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
    • G06F16/254Extract, transform and load [ETL] procedures, e.g. ETL data flows in data warehouses

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

Abstract

The invention discloses a data reading method, a data reading device, electronic equipment and a storage medium. The method comprises the following steps: responding to a synchronization request of equipment data, synchronizing the information of the Internet of things equipment stored in a first database to a second database, wherein the second database is pre-stored with real-time state data of the Internet of things equipment; and responding to the equipment data reading request, and reading the information of the equipment of the Internet of things and the real-time state data of the equipment of the Internet of things from the second database. According to the technical scheme, after the information of the Internet of things equipment is synchronized to the second database, the information of the Internet of things equipment and the real-time state data of the Internet of things equipment can be directly read from the second database at the same time when the equipment data is read, and compared with the prior art, the method and the device have the advantages that the information of the Internet of things equipment does not need to be matched in the first database, and the equipment data reading rate is improved.

Description

Data reading method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of internet of things, and in particular, to a data reading method, a data reading device, an electronic device, and a storage medium.
Background
Along with the development of the internet of things, the application of the internet of things in various fields is also becoming wider and wider.
At present, the information of the equipment of the Internet of things and the real-time state data of the equipment of the Internet of things are respectively stored in different databases, and when the equipment data is read, the equipment data is required to be respectively obtained and matched from the databases, so that the problem of low equipment data reading efficiency exists.
Disclosure of Invention
The invention provides a data reading method, a data reading device, electronic equipment and a storage medium, so as to improve the data reading efficiency of the equipment.
According to an aspect of the present invention, there is provided a data reading method including:
responding to a synchronization request of equipment data, synchronizing the information of the Internet of things equipment stored in a first database to a second database, wherein the second database is pre-stored with real-time state data of the Internet of things equipment;
and responding to the equipment data reading request, and reading the information of the equipment of the Internet of things and the real-time state data of the equipment of the Internet of things from the second database.
According to another aspect of the present invention, there is provided a data reading apparatus including:
the device data synchronization module is used for responding to a synchronization request of the device data and synchronizing the internet of things device information stored in the first database to the second database, wherein the second database is pre-stored with real-time state data of the internet of things device;
and the equipment data reading module is used for responding to the equipment data reading request and reading the information of the equipment of the Internet of things and the real-time state data of the equipment of the Internet of things from the second database.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor;
and a memory communicatively coupled to the at least one processor;
wherein the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the data reading method according to any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute a data reading method according to any one of the embodiments of the present invention.
According to the technical scheme, after the information of the equipment of the Internet of things is synchronized to the second database, the information of the equipment of the Internet of things and the real-time state data of the equipment of the Internet of things can be directly read from the second database at the same time when the equipment data is read, and compared with the prior art, the method and the device have the advantages that the information of the equipment of the Internet of things does not need to be matched with the information of the equipment of the Internet of things in the first database, and the equipment data reading rate is improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a data reading method according to a first embodiment of the present invention;
FIG. 2 is a flow chart of a data reading method according to a second embodiment of the present invention;
FIG. 3 is a flow chart of a data reading method according to a third embodiment of the present invention;
fig. 4 is a flowchart of a data pushing method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a data reading device according to a fourth embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device implementing a data reading method according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a data reading method according to an embodiment of the present invention, where the method may be applied to the case of automatic synchronization and reading of device data, and the method may be performed by a data reading device, where the data reading device may be implemented in hardware and/or software, and the data reading device may be configured in an electronic device such as a terminal, a server, or the like. As shown in fig. 1, the method includes:
s110, responding to a synchronization request of the equipment data, and synchronizing the information of the Internet of things equipment stored in the first database to a second database, wherein the second database stores real-time state data of the Internet of things equipment in advance.
S120, responding to the equipment data reading request, and reading the information of the equipment of the Internet of things and the real-time state data of the equipment of the Internet of things from the second database.
In this embodiment, the internet of things device information refers to related information of each terminal device in the internet of things, which may include, but is not limited to, a device identification number, an IP address, and the like, and may be stored in the first database. The first database may be a relational database, and is configured to store information of the internet of things device that changes in non-real time. The real-time status data refers to a real-time device status of the internet of things device, and may include, but is not limited to, an online status, an offline status, an idle status, a busy status, etc., which may be stored in the second database. The second database may be a non-relational database, and is configured to store real-time status data of the internet of things device that changes in real-time.
It can be understood that after the information of the internet of things device is synchronized to the second database, the information of the internet of things device and the real-time state data of the internet of things device are stored in the second database at the same time, wherein the information of the internet of things device and the real-time state data of the internet of things device have a corresponding relationship, in other words, the information of the internet of things device and the real-time state data of the internet of things device can be stored in an associated manner, so that rapid reading can be realized when data reading is performed.
In some alternative embodiments, the first database is a Mysql database and the second database is a Redis database.
The electronic device, in response to a request for synchronizing device data, synchronizes the internet of things device information stored in the Mysql database to the Redis database, where the Redis database stores real-time state data of the internet of things device in advance. Further, the electronic device responds to the device data reading request, and directly reads the device information of the Internet of things and the real-time state data of the device of the Internet of things from the Redis database at the same time.
According to the technical scheme, after the information of the equipment of the Internet of things is synchronized to the second database, the information of the equipment of the Internet of things and the real-time state data of the equipment of the Internet of things can be directly read from the second database at the same time when the equipment data is read, and compared with the prior art, the method and the device have the advantages that the information of the equipment of the Internet of things does not need to be matched with the information of the equipment of the Internet of things in the first database, and the equipment data reading rate is improved.
Example two
Fig. 2 is a flowchart of a data reading method according to a second embodiment of the present invention, where the method according to the present embodiment may be combined with each of the alternatives in the data reading method according to the foregoing embodiment. The data reading method provided by the embodiment further limits the 'internet of things equipment information synchronization process'.
As shown in fig. 2, the method includes:
s210, responding to a full-scale synchronization request of equipment data, and synchronizing the Internet of things equipment information corresponding to a data synchronization table stored in a first database to a second database, wherein the second database stores real-time state data of the Internet of things equipment in advance.
In this embodiment, the data synchronization table is a preset table that needs to be synchronized, and may include, but is not limited to, a terminal table, a station table, and the like, which are not specifically limited herein.
The electronic device responds to the full-volume synchronization request of the device data, so that the internet of things device information corresponding to the data synchronization table stored in the Mysql database is synchronized to the Redis database, and full-volume synchronization of the device data is achieved.
Optionally, synchronizing the internet of things device information corresponding to the data synchronization table stored in the first database to the second database includes: under the condition of initializing and starting a database, acquiring a pre-configured data synchronization table; and synchronizing the Internet of things equipment information corresponding to the data synchronization table stored in the first database to the second database based on the pre-configured data synchronization table.
For example, when the Mysql database and the Redis database are initialized and started, a pre-configured data synchronization table is obtained, and then according to the data synchronization table, the internet of things device information corresponding to the data synchronization table stored in the Mysql database is synchronized to the Redis database, so that full synchronization of device data is realized.
In some optional embodiments, under the condition that the second database stores real-time status data, an additional field may be added in the second database, so as to prevent the real-time status data from being covered when the information of the internet of things device in the first database is synchronized to the second database, and ensure the integrity of the device data.
S220, responding to an increment synchronization request of the equipment data, and synchronizing the Internet of things equipment information corresponding to the log increment stored in the first database to the second database.
In this embodiment, the log increment is increment information in a binlog log of the database. It should be noted that, synchronization of newly added or changed data in the device data can be achieved through log increment, and real-time synchronization of the device data is achieved.
Optionally, synchronizing the internet of things device information corresponding to the log increment stored in the first database to the second database includes: transmitting a data backup protocol to a first database, and acquiring the equipment information of the Internet of things corresponding to the log increment fed back by the first database based on the data backup protocol; and updating the Internet of things equipment information corresponding to the log increment to the second database.
The service program configured on the electronic device may masquerade as a slave node of Mysql master-slave replication, sending a data backup (dump) protocol to the Mysql database, so as to obtain an increment in the binlog, parse the increment into internet of things device information, and feed back the information to the service program, and the service program updates the internet of things device information corresponding to the increment of the log to the Redis database, so as to achieve incremental synchronization of device data.
S230, responding to the equipment data reading request, and reading the information of the equipment of the Internet of things and the real-time state data of the equipment of the Internet of things from the second database.
According to the technical scheme, the full-volume synchronization of the equipment data is realized by responding to the full-volume synchronization request of the equipment data and synchronizing the equipment information of the Internet of things corresponding to the data synchronization table stored in the first database to the second database; and responding to the increment synchronization request of the equipment data, synchronizing the Internet of things equipment information corresponding to the log increment stored in the first database to the second database, thereby realizing increment synchronization of the equipment data and ensuring the real-time performance of the equipment data.
Example III
Fig. 3 is a flowchart of a data reading method according to a third embodiment of the present invention, where the method according to the present embodiment may be combined with each of the alternatives in the data reading method provided in the foregoing embodiment. The data reading method provided by the embodiment is further optimized. Optionally, before reading the internet of things device information and the real-time status data of the internet of things device from the second database in response to the device data reading request, the method further comprises: receiving an equipment working state instruction sent by equipment of the Internet of things; and updating the real-time state data of the Internet of things equipment in the second database based on the equipment working state instruction sent by the Internet of things equipment.
As shown in fig. 3, the method includes:
and S310, responding to a synchronization request of the equipment data, and synchronizing the information of the Internet of things equipment stored in the first database to a second database, wherein the second database stores the real-time state data of the Internet of things equipment in advance.
S320, receiving a device working state instruction sent by the Internet of things device.
In this embodiment, the device working state instruction refers to an instruction corresponding to a device state of the internet of things device, and may be represented by an arabic numeral or a letter.
For example, the electronic device may receive a device operating state instruction sent by the internet of things device, where the device operating state instruction may be a program instruction corresponding to an online state, an offline state, an idle state, or a busy state.
S330, updating real-time state data of the Internet of things equipment in the second database based on the equipment working state instruction sent by the Internet of things equipment.
Specifically, based on a pre-configured instruction mapping relation, the device working state instruction sent by the internet of things device is converted to obtain real-time state data of the internet of things device corresponding to the device working state instruction, and then the real-time state data of the internet of things device corresponding to the device working state instruction is updated to the second database, so that the real-time update of the device working state is realized, and the real-time performance of the device state in the database is ensured.
The command mapping relationship may be a 0-offline state, a 1-online state, and a 2-busy state, where 0, 1, and 2 represent device working state commands sent by the internet of things device, the offline state is real-time state data of the internet of things device corresponding to 0, the online state is real-time state data of the internet of things device corresponding to 1, and the busy state is real-time state data of the internet of things device corresponding to 2.
S340, responding to the equipment data reading request, and reading the information of the equipment of the Internet of things and the real-time state data of the equipment of the Internet of things from the second database.
Fig. 4 is a flowchart of a data pushing method according to an embodiment of the present invention; specifically, the Mysql database starts a binlog, and the connection setting of the Mysql database and the Redis database is preconfigured by a service program on the electronic device, and a data synchronization table is set. Further, the Mysql database, the Redis database and the business service program are started, and a pre-configured data synchronization table is obtained when the Mysql database, so that the Internet of things equipment information corresponding to the data synchronization table stored in the Mysql database is synchronized to the Redis database according to the data synchronization table, and the full synchronization of the equipment data is realized. Further, the service program configured on the electronic device may masquerade as a slave node of Mysql master-slave replication, send dump protocol to the Mysql database, so as to obtain an increment in the binlog log, parse the increment into internet of things device information, feed back the information to the service program, update the internet of things device information corresponding to the log increment to the dis database, so as to realize increment synchronization of device data, where the increment in the binlog may include, but is not limited to, operations of adding, deleting, modifying, and clearing data. Further, the electronic device can receive the device working state instruction sent by the internet of things device, convert the device working state instruction sent by the internet of things device based on a pre-configured instruction mapping relation, obtain real-time state data of the internet of things device corresponding to the device working state instruction, and further update the real-time state data of the internet of things device corresponding to the device working state instruction to the Redis database, so that real-time update of the device working state is realized, and real-time performance of the device state in the Redis database is ensured. Further, the electronic device responds to the device data reading request to read the device data from the Redis database, wherein the device data comprises the Internet of things device information and the real-time state data of the Internet of things device corresponding to the Internet of things device information, so that the device data is distributed or pushed to other business service nodes or pages, the storage and the reading of the Mysql database are reduced, and the high-efficiency device data reading is realized.
According to the technical scheme, the real-time state data of the Internet of things equipment in the second database is updated based on the equipment working state instruction sent by the Internet of things equipment by receiving the equipment working state instruction sent by the Internet of things equipment, so that the real-time update of the equipment working state is realized, and the real-time performance of the equipment state in the database is ensured.
Example IV
Fig. 5 is a schematic structural diagram of a data reading device according to a fourth embodiment of the present invention. As shown in fig. 5, the apparatus includes:
the device data synchronization module 410 is configured to synchronize, in response to a synchronization request of device data, the internet of things device information stored in the first database to a second database, where the second database stores real-time state data of the internet of things device in advance;
and the device data reading module 420 is configured to read, in response to a device data reading request, the internet of things device information and the real-time status data of the internet of things device from the second database.
According to the technical scheme, after the information of the equipment of the Internet of things is synchronized to the second database, the information of the equipment of the Internet of things and the real-time state data of the equipment of the Internet of things can be directly read from the second database at the same time when the equipment data is read, and compared with the prior art, the method and the device have the advantages that the information of the equipment of the Internet of things does not need to be matched with the information of the equipment of the Internet of things in the first database, and the equipment data reading rate is improved.
In some alternative embodiments, the device data synchronization module 410 includes:
the full-volume synchronization unit is used for responding to a full-volume synchronization request of the equipment data and synchronizing the equipment information of the Internet of things corresponding to the data synchronization table stored in the first database to the second database;
and the increment synchronization unit is used for responding to an increment synchronization request of the equipment data and synchronizing the equipment information of the Internet of things corresponding to the log increment stored in the first database to the second database.
In some alternative embodiments, the full synchronization unit is specifically configured to:
under the condition of initializing and starting a database, acquiring a pre-configured data synchronization table;
and synchronizing the Internet of things equipment information corresponding to the data synchronization table stored in the first database to the second database based on the pre-configured data synchronization table.
In some alternative embodiments, the incremental synchronization unit is specifically configured to:
transmitting a data backup protocol to the first database, and acquiring the equipment information of the Internet of things corresponding to the log increment fed back by the first database based on the data backup protocol;
and updating the Internet of things equipment information corresponding to the log increment to the second database.
In some alternative embodiments, the data reading apparatus further comprises:
the state instruction receiving module is used for receiving an equipment working state instruction sent by the equipment of the Internet of things;
and the state data updating module is used for updating the real-time state data of the Internet of things equipment in the second database based on the equipment working state instruction sent by the Internet of things equipment.
In some alternative embodiments, the status data updating module is specifically configured to:
converting the equipment working state instruction sent by the equipment of the Internet of things based on a pre-configured instruction mapping relation to obtain real-time state data of the equipment of the Internet of things corresponding to the equipment working state instruction;
and updating the real-time state data of the Internet of things equipment corresponding to the equipment working state instruction into the second database.
In some alternative embodiments, the first database is a Mysql database and the second database is a Redis database.
The data reading device provided by the embodiment of the invention can execute the data reading method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example five
Fig. 6 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices (e.g., helmets, eyeglasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 6, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An I/O interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as a data reading method, which includes:
responding to a synchronization request of equipment data, synchronizing the information of the Internet of things equipment stored in a first database to a second database, wherein the second database is pre-stored with real-time state data of the Internet of things equipment;
and responding to the equipment data reading request, and reading the information of the equipment of the Internet of things and the real-time state data of the equipment of the Internet of things from the second database.
In some embodiments, the data reading method may be implemented as a computer program, which is tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the data reading method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the data reading method in any other suitable way (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A data reading method, comprising:
responding to a synchronization request of equipment data, synchronizing the information of the Internet of things equipment stored in a first database to a second database, wherein the second database is pre-stored with real-time state data of the Internet of things equipment;
and responding to the equipment data reading request, and reading the information of the equipment of the Internet of things and the real-time state data of the equipment of the Internet of things from the second database.
2. The method of claim 1, wherein synchronizing the internet of things device information stored in the first database to the second database in response to the request for synchronization of the device data comprises:
responding to a full-scale synchronization request of equipment data, and synchronizing the equipment information of the Internet of things corresponding to the data synchronization table stored in the first database to the second database;
and responding to an increment synchronization request of the equipment data, and synchronizing the Internet of things equipment information corresponding to the log increment stored in the first database to the second database.
3. The method according to claim 2, wherein synchronizing the internet of things device information corresponding to the data synchronization table stored in the first database to the second database comprises:
under the condition of initializing and starting a database, acquiring a pre-configured data synchronization table;
and synchronizing the Internet of things equipment information corresponding to the data synchronization table stored in the first database to the second database based on the pre-configured data synchronization table.
4. The method of claim 2, wherein synchronizing the internet of things device information corresponding to the log delta stored in the first database to the second database comprises:
transmitting a data backup protocol to the first database, and acquiring the equipment information of the Internet of things corresponding to the log increment fed back by the first database based on the data backup protocol;
and updating the Internet of things equipment information corresponding to the log increment to the second database.
5. The method of claim 1, wherein prior to reading the internet of things device information and the real-time status data of the internet of things device from the second database in response to the device data read request, the method further comprises:
receiving an equipment working state instruction sent by equipment of the Internet of things;
and updating the real-time state data of the Internet of things equipment in the second database based on the equipment working state instruction sent by the Internet of things equipment.
6. The method of claim 5, wherein the updating real-time status data of the internet of things device in the second database based on the device operating status instructions sent by the internet of things device comprises:
converting the equipment working state instruction sent by the equipment of the Internet of things based on a pre-configured instruction mapping relation to obtain real-time state data of the equipment of the Internet of things corresponding to the equipment working state instruction;
and updating the real-time state data of the Internet of things equipment corresponding to the equipment working state instruction into the second database.
7. The method of any one of claims 1-6, wherein the first database is a Mysql database and the second database is a Redis database.
8. A data reading apparatus, comprising:
the device data synchronization module is used for responding to a synchronization request of the device data and synchronizing the internet of things device information stored in the first database to the second database, wherein the second database is pre-stored with real-time state data of the internet of things device;
and the equipment data reading module is used for responding to the equipment data reading request and reading the information of the equipment of the Internet of things and the real-time state data of the equipment of the Internet of things from the second database.
9. An electronic device, the electronic device comprising:
at least one processor;
and a memory communicatively coupled to the at least one processor;
wherein the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the data reading method of any one of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to perform the data reading method of any one of claims 1-7.
CN202311281684.2A 2023-09-28 2023-09-28 Data reading method and device, electronic equipment and storage medium Pending CN117271667A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311281684.2A CN117271667A (en) 2023-09-28 2023-09-28 Data reading method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311281684.2A CN117271667A (en) 2023-09-28 2023-09-28 Data reading method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117271667A true CN117271667A (en) 2023-12-22

Family

ID=89214062

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311281684.2A Pending CN117271667A (en) 2023-09-28 2023-09-28 Data reading method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117271667A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110362625A (en) * 2019-05-30 2019-10-22 杭州数梦工场科技有限公司 Data base read-write separation method, device, electronic equipment and storage medium
CN111343286A (en) * 2020-04-17 2020-06-26 中移(杭州)信息技术有限公司 Network access system and network access method
CN114168603A (en) * 2021-11-01 2022-03-11 山东有人物联网股份有限公司 Internet of things equipment state synchronization method, system, device and storage medium
CN116436966A (en) * 2023-04-10 2023-07-14 四川虹美智能科技有限公司 Method and system for realizing equipment activation based on EMQ

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110362625A (en) * 2019-05-30 2019-10-22 杭州数梦工场科技有限公司 Data base read-write separation method, device, electronic equipment and storage medium
CN111343286A (en) * 2020-04-17 2020-06-26 中移(杭州)信息技术有限公司 Network access system and network access method
CN114168603A (en) * 2021-11-01 2022-03-11 山东有人物联网股份有限公司 Internet of things equipment state synchronization method, system, device and storage medium
CN116436966A (en) * 2023-04-10 2023-07-14 四川虹美智能科技有限公司 Method and system for realizing equipment activation based on EMQ

Similar Documents

Publication Publication Date Title
CN116108094A (en) Data integration method and device, electronic equipment and storage medium
CN114328739A (en) Data synchronization method, data reading method, data synchronization device, data reading device, electronic equipment, storage medium and product
CN117271667A (en) Data reading method and device, electronic equipment and storage medium
CN115525659A (en) Data query method and device, electronic equipment and storage medium
CN118503298B (en) Data processing method, device, equipment and storage medium based on double caches
CN117201483B (en) File transmission method, device, electronic equipment and storage medium
CN115695397B (en) Communication method, device, equipment and medium based on JSON file
CN114553894B (en) Data synchronization method, device, system and storage medium
CN113741937B (en) Application updating method and device for cloud terminal and computer program product
CN116708362A (en) Communication address processing method, device, equipment and storage medium
CN117294597A (en) Network card binding configuration method, device, equipment and medium
CN117931805A (en) Data processing method and device, electronic equipment and storage medium
CN116049311A (en) Data synchronization method and device, electronic equipment and storage medium
CN116881368A (en) Data synchronization method and device, electronic equipment and storage medium
CN118673068A (en) Data transfer method, device, electronic equipment and storage medium
CN118503298A (en) Data processing method, device, equipment and storage medium based on double caches
CN116668436A (en) Distributed data acquisition method and system based on SMB protocol
CN117651078A (en) Data transmission method and device, electronic equipment and storage medium
CN117873787A (en) Data backup and recovery method, device, equipment and storage medium
CN118626566A (en) Data synchronization method and device, electronic equipment and storage medium
CN117076048A (en) Container application starting method and device, storage medium and electronic equipment
CN114416040A (en) Page construction method, device, equipment and storage medium
CN115098520A (en) Device data updating method and device, electronic device and storage medium
CN116708478A (en) Sea-land communication-based data synchronous transmission system, method, equipment and medium
CN117675820A (en) Big data cluster deployment 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