CN111914032B - Data processing device and method applied to automatic monitoring system of vehicle - Google Patents

Data processing device and method applied to automatic monitoring system of vehicle Download PDF

Info

Publication number
CN111914032B
CN111914032B CN202010819735.2A CN202010819735A CN111914032B CN 111914032 B CN111914032 B CN 111914032B CN 202010819735 A CN202010819735 A CN 202010819735A CN 111914032 B CN111914032 B CN 111914032B
Authority
CN
China
Prior art keywords
database
client application
remote database
data
connection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010819735.2A
Other languages
Chinese (zh)
Other versions
CN111914032A (en
Inventor
王三燕
栾伟杰
李乐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Hisense Wechat Signal Co ltd
Original Assignee
Qingdao Hisense Wechat Signal 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 Qingdao Hisense Wechat Signal Co ltd filed Critical Qingdao Hisense Wechat Signal Co ltd
Priority to CN202010819735.2A priority Critical patent/CN111914032B/en
Publication of CN111914032A publication Critical patent/CN111914032A/en
Application granted granted Critical
Publication of CN111914032B publication Critical patent/CN111914032B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06F16/275Synchronous replication
    • 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/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Quality & Reliability (AREA)
  • Computing Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data processing device and a method applied to an automatic monitoring system of a vehicle, when a starting instruction is issued to a client application of the automatic monitoring system, a connection establishment request is firstly sent to a remote database, and if connection fails, the starting of the client application is supported by loading static data stored in a local database, so that the problem that the client application cannot be started due to the fact that the client cannot be connected with the remote database is solved. Dynamic data generated in the running process of the client application is stored in the local database until connection is established with the remote database, and static data stored in the local database is synchronized to the remote database. In this way, the dynamic data generated by the client application in operation can be effectively ensured not to be lost in the period of time when the connection with the remote database is not established.

Description

Data processing device and method applied to automatic monitoring system of vehicle
Technical Field
The present disclosure relates to the field of database processing technologies, and in particular, to a data processing device and method applied to an automatic monitoring system of a vehicle.
Background
The traditional automatic monitoring system for the vehicles generally adopts a distributed system architecture, the whole system equipment is connected with a centralized relational database through a redundant network, a remote database is required to be connected when the system is started, and if the connection fails, the system cannot be started normally.
Disclosure of Invention
The disclosure aims to provide a data processing device and a data processing method applied to an automatic monitoring system of a vehicle, which are used for solving the problem that a client application cannot be started normally due to the fact that connection with a remote database cannot be established when the automatic monitoring system of the vehicle is started.
In a first aspect, the present disclosure provides an electronic device for application to an automatic vehicle monitoring system, the electronic device comprising: a memory and a controller, wherein:
the memory is used for storing static data and dynamic data which can be executed by the controller;
the controller is connected to the memory and configured to:
responsive to a start indication of a client application that starts the automated monitoring system, attempting to establish a connection with a remote database;
if the connection fails, starting the client application by loading static data in a local database; wherein, the data information which is dependent on the client application when started and does not change in the running process is the static data; the data generated by the client application in the running process are dynamic data;
after the client application is started, when the client application generates the dynamic data in the running process, the dynamic data is stored in the local database, and the dynamic data is synchronized to the remote database after connection with the remote database is established.
In some possible embodiments, the controller, in response to a start-up indication of a client application that starts the automated monitoring system, is further configured to, after attempting to establish a connection with a remote database:
if the connection with the remote database is successful, loading the static data in the remote database to be synchronized into the local database;
the client application is launched by the static data loaded from the remote database.
In some possible embodiments, after the controller starts the client application with the static data loaded from the remote database, it is further configured to:
and if the local database has dynamic data to be synchronized, synchronizing the dynamic data to be synchronized into the remote database.
In some possible embodiments, the controller is further configured to:
after the connection with the remote database is established, and when the client application is in an operation state, if the connection with the remote database is disconnected, the remote database is reconnected by adopting an automatic reconnection mechanism;
storing the dynamic data generated in real time to the local database before the connection is successfully re-established;
if the reconnection is successful, synchronizing the dynamic data stored in the local database to the remote database;
and after the synchronization is completed, deleting the dynamic data stored in the local database and synchronized to the remote database.
In some possible embodiments, the controller, after executing the client application, is further configured to:
executing a configuration file loading operation; the configuration file comprises an entity class name and a class attribute, wherein the entity class name is consistent with the name of the database table, and the class attribute name is consistent with the column name of the database table.
In some possible embodiments, the controller is further configured to:
the designating operation for any pair of the remote database or the local database is completed through a preset unified access interface, wherein the designating operation for a plurality of types of databases is packaged in the unified access interface, and the designating operation comprises at least one or a combination of the following operations: establishing connection, disconnecting connection, adding data to a database, deleting data, querying data and updating data.
In a second aspect, the present disclosure also provides a data processing method applied to an automatic vehicle monitoring system, the method comprising:
responsive to a start indication of a client application that starts the automated monitoring system, attempting to establish a connection with a remote database;
if the connection fails, starting the client application by loading static data in a local database; wherein, the data information which is dependent on the client application when started and does not change in the running process is the static data; the data generated by the client application in the running process are dynamic data;
after the client application is started, when the client application generates the dynamic data in the running process, the dynamic data is stored in the local database, and the dynamic data is synchronized to the remote database after connection with the remote database is established.
In some possible embodiments, after attempting to establish a connection with a remote database in response to a start-up indication of a client application that starts the automated monitoring system, the method further comprises:
if the connection with the remote database is successful, loading the static data in the remote database to be synchronized into the local database;
the client application is launched by the static data loaded from the remote database.
In some possible embodiments, after the client application is started by the static data loaded from the remote database, the method further comprises:
and if the local database has dynamic data to be synchronized, synchronizing the dynamic data to be synchronized into the remote database.
In some possible embodiments, the method further comprises:
after the connection with the remote database is established, and when the client application is in an operation state, if the connection with the remote database is disconnected, the remote database is reconnected by adopting an automatic reconnection mechanism;
storing the dynamic data generated in real time to the local database before the connection is successfully re-established;
if the reconnection is successful, synchronizing the dynamic data stored in the local database to the remote database;
and after the synchronization is completed, deleting the dynamic data stored in the local database and synchronized to the remote database.
In some possible embodiments, the client application, after being started, the method further comprises:
executing a configuration file loading operation; the configuration file comprises an entity class name and a class attribute, wherein the entity class name is consistent with the name of the database table, and the class attribute name is consistent with the column name of the database table.
In some possible embodiments, the method further comprises:
the designating operation for any pair of the remote database or the local database is completed through a preset unified access interface, wherein the designating operation for a plurality of types of databases is packaged in the unified access interface, and the designating operation comprises at least one or a combination of the following operations: establishing connection, disconnecting connection, adding data to a database, deleting data, querying data and updating data.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings that are needed in the embodiments of the present disclosure will be briefly described below, and it is obvious that the drawings described below are only some embodiments of the present disclosure, and other drawings may be obtained according to these drawings without inventive effort to a person of ordinary skill in the art.
Fig. 1 is an application scenario diagram provided by some embodiments of the present disclosure;
FIG. 2 is a block diagram of a hardware configuration provided by some embodiments of the present disclosure;
FIG. 3 is a flow chart of data processing for application to an automatic vehicle monitoring system provided in some embodiments of the present disclosure;
FIG. 4 is a client application launch flow chart provided by some embodiments of the present disclosure;
FIG. 5 is a flow chart of dynamic data storage during client application run-time provided by some embodiments of the present disclosure.
Detailed Description
The following description will be given in detail of the technical solutions in the embodiments of the present application with reference to the accompanying drawings. In the description of the embodiments of the present disclosure, unless otherwise indicated, "/" means or, for example, A/B may represent A or B; the text "and/or" is merely an association relation describing the associated object, meaning that there may be three relations, e.g., a and/or B, may represent: the three cases where a exists alone, a and B exist together, and B exists alone, and in addition, in the description of the embodiments of the present application, "plural" means two or more than two.
In the description of the embodiments of the present disclosure, unless otherwise indicated, the term "plurality" refers to two or more, and other words and analogs should be understood that the preferred embodiments described herein are merely illustrative and explanatory of the disclosure and are not restrictive of the disclosure, and that the embodiments of the disclosure and features of the embodiments may be combined with each other without conflict.
In order to further explain the technical solutions provided by the embodiments of the present disclosure, the following details are described with reference to the accompanying drawings and the detailed description. Although the embodiments of the present disclosure provide the method operational steps as shown in the following embodiments or figures, more or fewer operational steps may be included in the method based on routine or non-inventive labor. In steps where there is logically no necessary causal relationship, the order of execution of the steps is not limited to the order of execution provided by embodiments of the present disclosure. The methods may be performed sequentially or in parallel as shown in the embodiments or the drawings when the actual processing or the control device is executing.
When the data processing method applied to the automatic monitoring system of the vehicle gives the starting instruction to the client application of the automatic monitoring system, firstly, a connection establishment request is sent to a remote database, if connection fails, the starting of the client application is supported by loading static data such as station yard graph configuration and vehicle information configuration stored in a local database, and the problem that the client application cannot be started due to the fact that the client cannot be connected with the remote database is solved.
Dynamic data (such as user operation instructions and system alarm information) generated and recorded in the running process of the client application can be stored in the local database until connection with the remote database is established, and then static data stored in the local database is synchronized to the remote database. In this way, the dynamic data generated by the client application in operation can be effectively ensured not to be lost in the period of time when the connection with the remote database is not established.
The following describes in detail the management method of the electronic device and the application in the embodiments of the present disclosure with reference to the accompanying drawings.
As shown in fig. 1, an application environment of the data processing method applied to the vehicle automatic monitoring system in the present disclosure is schematically shown, where the application environment may include, for example, a network 10, at least one client application 20, a local database 30, and a remote database 40, where:
through the network 10, the client application 20 may receive a start-up indication for starting the client application, the controller of which sends a connection request to the remote database 40 through the network 10. If the connection fails, the client application is started by loading static data stored in the local database 30.
Because the data processing method applied to the automatic monitoring system of the vehicle provided by the present disclosure is different from the conventional method, the client application 20 can be started by loading static information in the local database 30 when the connection with the remote database 40 fails, and the dynamic data stored in the local database 30 can be completely restored to the remote database 40 during the disconnection of the client application 20 from the remote database in order to maintain the consistency of the static data in the local database 30 and the remote database 40, the present disclosure also establishes an automatic synchronization mechanism in the client application 20.
If the remote database 40 is not successfully connected during the startup phase, the client application 20 will store the generated dynamic data in the local database 30 during the run phase. Until the controller is successfully connected with the remote database 40, the controller synchronizes the dynamic data to be synchronized stored in the local database 30 to the remote database 40 through the network 10, and deletes the dynamic data in the local database 30 after the synchronization is finished.
If the remote database 40 is successfully connected during the enablement phase, static data in the remote database 40 is loaded through the network 10 and synchronized into the local database. In the operation stage, the client application 20 monitors the connection condition with the remote database 40 in real time through the network 10, if the connection is suddenly interrupted, an automatic reconnection mechanism is started, a reconnection request is sent to the remote server 40 according to a preset interval, after reconnecting with the remote server 40, the controller rechecks whether dynamic data to be synchronized exist in the local database 30, if the dynamic data to be synchronized exist, the data is synchronized to the remote database 40 through the network 10, and the dynamic data in the local database 30 is deleted after the synchronization is finished.
To facilitate an understanding of the data processing method provided by the present disclosure applied to an automatic vehicle monitoring system, a hardware configuration block diagram of the electronic device 130 is exemplarily shown in fig. 2. The electronic device 130 according to this embodiment of the present disclosure is described below with reference to fig. 2, and the electronic device 130 shown in fig. 2 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 2, the electronic device 130 is in the form of a general-purpose electronic device. Components of electronic device 130 may include, but are not limited to: the at least one processor 131, the at least one memory 132, and a bus 133 connecting the various system components, including the memory 132 and the processor 131.
Bus 133 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor, and a local bus using any of a variety of bus architectures.
Memory 132 may include readable media in the form of volatile memory such as Random Access Memory (RAM) 1321 and/or cache memory 1322, and may further include Read Only Memory (ROM) 1323.
Memory 132 may also include a program/utility 1325 having a set (at least one) of program modules 1324, such program modules 1324 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
The electronic device 130 may also communicate with one or more external devices 134 (e.g., keyboard, pointing device, etc.), one or more devices that enable a user to interact with the electronic device 130, and/or any device (e.g., router, modem, etc.) that enables the electronic device 130 to communicate with one or more other electronic devices. Such communication may occur through an input/output (I/O) interface 135. Also, electronic device 130 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through network adapter 136. As shown, network adapter 136 communicates with other modules for electronic device 130 over bus 133. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 130, including, but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
In some possible embodiments, aspects of a data processing method applied to an automatic vehicle monitoring system provided by the present disclosure may also be implemented in the form of a program product comprising program code for causing a computer device to perform the steps of a data processing method applied to an automatic vehicle monitoring system according to various exemplary embodiments of the present disclosure as described above when the program product is run on the computer device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A program product for data processing applied to an automatic vehicle monitoring system of embodiments of the present disclosure may employ a portable compact disc read only memory (CD-ROM) and include program code and may be run on an electronic device. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the consumer electronic device, partly on the consumer electronic device, as a stand-alone software package, partly on the consumer electronic device, partly on the remote electronic device, or entirely on the remote electronic device or server. In the case of remote electronic devices, the remote electronic device may be connected to the consumer electronic device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external electronic device (e.g., connected through the internet using an internet service provider).
It should be noted that although several units or sub-units of the apparatus are mentioned in the above detailed description, such a division is merely exemplary and not mandatory. Indeed, the features and functions of two or more of the units described above may be embodied in one unit in accordance with embodiments of the present disclosure. Conversely, the features and functions of one unit described above may be further divided into a plurality of units to be embodied.
Furthermore, although the operations of the methods of the present disclosure are depicted in the drawings in a particular order, this is not required to or suggested that these operations must be performed in this particular order or that all of the illustrated operations must be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform.
It will be apparent to those skilled in the art that embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
Vehicle automatic monitoring systems can be divided into client applications and remote databases. The client application can collect data required in the running process of the vehicle, such as train time, inbound/outbound time for each station, temperature, humidity information and the like after being started. The specific information collected may be determined based on the vehicle and the actual needs, which is not limited by the present disclosure.
The inventors found that in the related art, a client application of a vehicle automatic monitoring system must access a remote database if allowed, and acquire data required for starting the application from the remote database. Therefore, the stability of the corresponding access link and the network environment in the related art have certain requirements. As such, whether the client application is able to launch depends entirely on whether the remote database can be connected. Making the availability and stability of the overall automated monitoring system low.
In view of this, the inventor analyzes the situation that the client application starts to run, defines data that is required for starting the client application and is unchanged during the running process as static data, and defines data generated during the running process of the client application, for example, some collected information as dynamic data. On the basis, static data are timely stored in the client application, so that if connection with a remote database cannot be established when the client application is started, the client application can be started through the locally stored static data, and dynamic data can be timely collected.
Fig. 3 is a schematic flow chart of a data processing method applied to an automatic monitoring system of a vehicle, which includes the following steps:
in response to a start-up indication of a client application that starts an automated monitoring system, an attempt is made to establish a connection with a remote database, step 301.
After a starting instruction is issued to a client application of the automatic monitoring system, a configuration file loading operation is executed, wherein the configuration file comprises entity class names and class attributes, the entity class names in the configuration file are consistent with database table names, and the class attribute names are consistent with database column names. In the process of loading the configuration file, the system automatically initiates a connection establishment request to a remote database.
Step 302, if the connection fails, starting the client application by loading static data in a local database; the client application is started, and the data information which is dependent on the client application in the starting process and does not change in the running process is static data; the data generated by the client application during the running process is dynamic data.
In practice, modifications are not allowed, since the static data remains unchanged during the running of the client application. Therefore, the data in the remote database is divided into static data for configuration and dynamic data for recording, and after the static data for configuration is mapped to the memory object when the client application is started, the data can be stored all the time, that is, the client application can directly access the memory object to obtain the static data in the starting process by loading the static data in the local database.
In order to ensure that the system can still be normally used under the condition that the connection with the remote database cannot be established. The present disclosure also employs a configuration-free local database SQLite (Light Structured Query Language lightweight structured query language) to establish a data management mechanism. The client application performs unified management on data required by the system in operation and dynamic information generated in the operation process through the local database, so that serious dependence on remote database servers and network states is further reduced or even eliminated.
In implementation, the local database and the remote database can be designed to maintain the same data structure, and data access is performed through the same data access technology, so that the local database is ensured to support the data access and storage functions consistent with those of the remote database.
Step 303, after the client application is started, when the client application generates dynamic data in the running process, the dynamic data is stored in the local database, and after a connection is established with the remote database, the dynamic data is synchronized to the remote database.
In summary, if the client application and the remote server cannot successfully establish a connection, the client application is started by loading static data in the local database. In order to ensure data integrity, the usability of the system in the case that the remote database cannot be accessed is improved.
In some embodiments, if a connection is successfully established with a remote database, in order to effectively ensure consistency of data versions used by each node, a data synchronization policy adopted in the present disclosure is that static data in the remote database is synchronized to a local database. That is, after the remote database is connected, static data in the remote database is loaded and synchronized into the local database. The client application is then started by static data loaded from the remote database.
After the client application is started, in order to ensure the integrity of the system data in running, the important loss caused by data loss is avoided. For the starting state of the client application under different connection states with the remote database, the dynamic data generated in the operation is stored in the following two modes, including:
in mode 1, if connection with a remote database fails when a client application is started, dynamic data generated by the client application in the running process is stored in a local database. By means of the method, the client application can still operate normally when no connection is established with the remote database, and the dynamic data generated during operation can be durable.
And 2, if the connection is successfully established with the remote database when the client application is started, storing dynamic data generated by the client application in the running process into the remote database.
And after the client application is started by the static data loaded from the remote database, automatically detecting the local database, if the dynamic data is detected to be stored in the local database, uploading the dynamic data to the remote database, and deleting the dynamic data in the local database after the uploading is finished. Therefore, the dynamic data generated by the client application in the running process can not be lost due to the fact that the client application is not connected with a remote database.
In addition, not only is it necessary to synchronize dynamic data in a local database to a remote database after a client application is started by static data loaded from the remote database, but in this embodiment of the present disclosure, no matter what way is adopted to start the client application, a connection state is monitored as long as the client application is connected to the remote database, so as to prevent a problem that a working efficiency is reduced and an operation and maintenance cost is increased due to a remote database connection interruption caused by an emergency after the client application successfully establishes a connection with the remote database, a unified database connection state automatic diagnosis mechanism and a disconnection reconnection mechanism are established, so as to ensure that the client application can detect a connection situation with the remote database in real time when running, and if an emergency causes a connection interruption with the remote database, an attempt can be made to reestablish a connection with the remote database by adopting an automatic reconnection way.
In some possible embodiments, a database connection state monitor is deployed in the system, when the client application runs, the database connection state monitor monitors connection conditions of the client application and the remote database in real time, if the connection with the remote database is suddenly interrupted, dynamic data, such as user operation instructions and system alarm information, generated by the client application during the running are stored in the local database, and for a disconnection reconnection mechanism, a mode of calling a socket function and a connect function is adopted to send a reconnection request to the remote database, and the number of automatic reconnections and reconnection intervals are preset in the reconnection request according to actual conditions. After the reconnection is successful, the client application automatically performs a detection operation on the local database, synchronizes the detected dynamic data to the remote database, and deletes the dynamic data stored in the local database after the synchronization is finished. It should be noted that the technology for monitoring the connection state of the database in real time and the technology for automatically reconnecting are applicable within the present disclosure, and the present disclosure is not limited thereto.
In some embodiments, the inventors have found that, during the development phase, when the database type in the system needs to be replaced, a large amount of source code is manually modified due to the different versions of the database. In view of this, the present disclosure addresses a number of source code modifying operations in an access manner that is suitable for a unified access interface to multiple types of databases. In implementation, establishing an access mode for unified interfaces of multiple types of databases in a development stage can comprise the following contents:
first, all operations on different types of databases (including remote databases and local databases) are unified into five operation interfaces in the development stage, including: the method comprises the steps of establishing a connection interface, disconnecting the connection interface, adding a data interface, deleting the data interface, updating the data interface and inquiring the data interface for a remote database and a local database.
And then packaging various types of database system drivers so as to realize unified interface access of an application layer, wherein the packaged database systems can be mainstream database systems such as SQLite, access, excel, mySQL, SQL Server, oracle and the like.
And finally, in the development stage, the database connection pool is optimally managed to solve the problem that the database connection pool is full and cannot be connected due to frequent disconnection of the database, the database network is monitored in a data driving layer through double-network redundancy communication management, and seamless switching of the database can be realized under the condition of single network failure by adopting a periodic Ping database network address, so that the database can be switched in real time when the database fails, and loss of information data is avoided.
On the other hand, the inventors found that a complex mapping algorithm is required in the related art to implement development of a configuration file, so that mapping from entity class to database is completed through the configuration file. In order to simplify the development and maintenance operations on configuration files, in the embodiment of the application, the objects in the system are automatically persisted into the database by establishing a high-performance configuration-free object relation mapping frame in the development stage, so that the development period and the operation and maintenance cost are reduced.
The inventor has studied and found that in the automatic monitoring system of the vehicle, since the automatic monitoring system of the vehicle needs to monitor and manage a large amount of vehicle data, platform information, travel records of each vehicle, and the like, a large amount of database tables are required to record and store the corresponding data. In solving the object relationship mapping problem of entity class and database table, the ORM framework (Object Relational Mapping object relationship mapping framework) can be adopted to compile codes.
When the ORM framework (such as the Nhibernate data persistence layer framework) is adopted to realize the mapping relation between the entity objects and the database table data, the corresponding mapping characteristics are marked for the entity classes and class attributes in the compiling process, and the mapping of the entity class objects in the system to the database table is realized through the configuration metadata of the mapping file. Because complex object relation mapping can cause the increase of development period and operation and maintenance work, in order to realize the mapping-free of object relation, the present disclosure establishes a mapping strategy that entity class names are consistent with database table names in the development stage, class attribute names are consistent with column names, a reflection technology is used for obtaining class names and class attribute names under a reference name space, the entity class names establish a mapping relation to the database table, and the class attribute names establish a mapping relation with fields in the database table, thereby avoiding complex mapping relation configuration files, and the mapping of entity classes and the database table is automatically completed by a system. The above operation can make the entity class in the disclosure not need to inherit the basic class in the ORM framework, so when the database table and the table structure change, the developer only needs to pay attention to the entity class in the system, and does not need to additionally map related configuration and development. Therefore, the development period is reduced, and the problem of mapping errors caused by human factors can be effectively avoided.
In order to better meet the object-oriented development strategy, the method also screens and inquires LINQ sentences, and queries, deletion and modification of data recording conditions are realized by analyzing and adapting WHERE keywords in the LINQ sentences (Language Integrated Query language integrated query). In addition, in contrast to the commonly used SQL statement (Structured Query Language structured query language), the LINQ statement can be created by automatically translating the SQL statement and creating the result set into objects and returning. And in the compiling process of the codes, the LINQ statement can check the codes in real time. It is not necessary to automatically check for errors at run-time. So that code errors that occur during compilation are changed in time, rather than just until the runtime is reached.
After the data processing method applied to the automatic monitoring system of the vehicle provided by the present disclosure is generally introduced, in order to facilitate understanding how to start the automatic data synchronization function when the client application is started or when the connection with the remote database is interrupted, as shown in fig. 4, a data synchronization flow chart of the client application when the client application is started or reconnected is provided, which includes the following steps:
step 401: before the client application is started, or when reconnecting with the remote database, a connection request is sent to the remote database.
If the connection request with the remote database fails, step 402 is performed to launch the client application by loading static data in the local database.
If the connection request with the remote database is successful, step 403 is performed to synchronize the static data in the remote database to the local database.
After the data synchronization is finished, step 404 is executed to check whether dynamic data exists in the local database, if so, step 405 is executed to upload static data in the local database to the remote database, and after the uploading is finished, the static data in the local database is deleted.
To facilitate understanding of a flow of storing dynamic data generated when a client application and a remote database are running in different connection states, fig. 5 illustrates a flow chart of storing dynamic data during running of a client application provided by some embodiments of the present disclosure, including the following steps:
during the operation of the client application, the database connection state monitor monitors the connection state of the client application and the remote database in real time, and when the connection state is in connection as shown in 501, step 5011 is executed to synchronize the dynamic data generated by the client application in operation into the remote database.
When the connection state is in failure, as shown in 502, the dynamic data generated by the client application in operation is synchronized into the remote database, and the disconnection reconnection operation is automatically executed, and a reconnection request is sent to the remote database.
When the connection status is as shown in 503, and the reconnection is successful, then step 5031 is executed: checking whether static data to be synchronized exists in the local database, and synchronizing the data to a remote database if the static data to be synchronized exists.
After synchronization is completed, static data in the local database is deleted and step 5032 is performed: and after the client application is successfully reconnected with the remote database, the dynamic data generated in the running process is synchronized into the remote database.
The present disclosure is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to the disclosure. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Since the communication terminal and the computer storage medium in the embodiments of the present disclosure may be applied to the above-mentioned processing method, the technical effects that can be obtained by the communication terminal and the computer storage medium may also refer to the above-mentioned method embodiments, and the embodiments of the present disclosure are not repeated herein.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present application without departing from the spirit or scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to cover such modifications and variations.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the method embodiments described above may be performed by hardware associated with program instructions. The foregoing program may be stored in a computer readable storage medium. The program, when executed, performs steps including the method embodiments described above; and the aforementioned storage medium includes: various media that can store program code, such as ROM, RAM, magnetic or optical disks.
While specific embodiments of the present disclosure have been described above, it will be appreciated by those skilled in the art that these are by way of example only, and the scope of the disclosure is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the principles and spirit of the disclosure, but such changes and modifications fall within the scope of the disclosure.

Claims (8)

1. An electronic device for use in an automatic vehicle monitoring system, the electronic device comprising: a memory and a controller, wherein:
the memory is used for storing static data and dynamic data which can be executed by the controller;
the controller is connected to the memory and configured to:
responsive to a start indication of a client application that starts the automated monitoring system, attempting to establish a connection with a remote database;
if the connection fails, starting the client application by loading static data in a local database; wherein, the data information which is dependent on the client application when started and does not change in the running process is the static data; the data generated by the client application in the running process are dynamic data;
after the client application is started, when the client application generates the dynamic data in the running process, the dynamic data is stored in the local database, and the dynamic data is synchronized to the remote database after connection is established with the remote database; the controller is further configured to:
after the connection with the remote database is established, and when the client application is in an operation state, if the connection with the remote database is disconnected, the remote database is reconnected by adopting an automatic reconnection mechanism;
storing the dynamic data generated in real time to the local database before the connection is successfully re-established;
if the reconnection is successful, synchronizing the dynamic data stored in the local database to the remote database; and after the synchronization is completed, deleting the dynamic data stored in the local database and synchronized to the remote database.
2. The electronic device of claim 1, wherein, in response to a start-up indication of a client application that starts the automated monitoring system, the controller is further configured to, after attempting to establish a connection with a remote database:
if the connection with the remote database is successful, loading the static data in the remote database to be synchronized into the local database; and is combined with the other components of the water treatment device,
the client application is launched by the static data loaded from the remote database.
3. The electronic device of claim 2, wherein after the controller starts the client application with the static data loaded from the remote database, the controller is further configured to:
and if the local database has dynamic data to be synchronized, synchronizing the dynamic data to be synchronized into the remote database.
4. The electronic device of claim 1 or 2, wherein the controller, in executing the client application during startup, is further configured to:
executing a configuration file loading operation; the configuration file comprises an entity class name and a class attribute, wherein the entity class name is consistent with the name of the database table, and the class attribute name is consistent with the column name of the database table.
5. The electronic device of claim 1, wherein the controller is further configured to:
the designating operation for any pair of the remote database or the local database is completed through a preset unified access interface, wherein the designating operation for a plurality of types of databases is packaged in the unified access interface, and the designating operation comprises at least one or a combination of the following operations: establishing connection, disconnecting connection, adding data to a database, deleting data, querying data and updating data.
6. A data processing method applied to an automatic vehicle monitoring system, the method comprising:
responsive to a start indication of a client application that starts the automated monitoring system, attempting to establish a connection with a remote database;
if the connection fails, starting the client application by loading static data in a local database; wherein, the data information which is dependent on the client application when started and does not change in the running process is the static data; the data generated by the client application in the running process are dynamic data;
after the client application is started, when the client application generates the dynamic data in the running process, the dynamic data is stored in the local database, and the dynamic data is synchronized to the remote database after connection is established with the remote database; after the connection with the remote database is established, and when the client application is in an operation state, if the connection with the remote database is disconnected, the remote database is reconnected by adopting an automatic reconnection mechanism;
storing the dynamic data generated in real time to the local database before the connection is successfully re-established;
if the reconnection is successful, synchronizing the dynamic data stored in the local database to the remote database; and after the synchronization is completed, deleting the dynamic data stored in the local database and synchronized to the remote database.
7. The method of claim 6, wherein, in response to the initiation indication of the client application that initiated the automated monitoring system, after attempting to establish a connection with a remote database, the method further comprises:
if the connection with the remote database is successful, loading the static data in the remote database to be synchronized into the local database; and is combined with the other components of the water treatment device,
the client application is launched by the static data loaded from the remote database.
8. The method of claim 7, wherein after the client application is launched with the static data loaded from the remote database, the method further comprises:
and if the local database has dynamic data to be synchronized, synchronizing the dynamic data to be synchronized into the remote database.
CN202010819735.2A 2020-08-14 2020-08-14 Data processing device and method applied to automatic monitoring system of vehicle Active CN111914032B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010819735.2A CN111914032B (en) 2020-08-14 2020-08-14 Data processing device and method applied to automatic monitoring system of vehicle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010819735.2A CN111914032B (en) 2020-08-14 2020-08-14 Data processing device and method applied to automatic monitoring system of vehicle

Publications (2)

Publication Number Publication Date
CN111914032A CN111914032A (en) 2020-11-10
CN111914032B true CN111914032B (en) 2024-03-22

Family

ID=73284127

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010819735.2A Active CN111914032B (en) 2020-08-14 2020-08-14 Data processing device and method applied to automatic monitoring system of vehicle

Country Status (1)

Country Link
CN (1) CN111914032B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113377585B (en) * 2021-06-02 2022-10-18 深圳市鹰硕技术有限公司 Online education network fault processing method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106446658A (en) * 2016-08-30 2017-02-22 孙鸿鹏 Data center security protection method and system
CN111177112A (en) * 2019-12-06 2020-05-19 陕西上讯信息技术有限公司 Database blocking method and device based on operation and maintenance management system and electronic equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6801914B2 (en) * 1999-03-15 2004-10-05 Microsoft Corporation Persistent client-server database sessions
EP1784725A1 (en) * 2004-08-03 2007-05-16 Softricity, Inc. System and method for controlling inter-application association through contextual policy control
US9833901B2 (en) * 2006-02-27 2017-12-05 Perrone Robotics, Inc. General purpose robotics operating system with unmanned and autonomous vehicle extensions
US20140283115A1 (en) * 2013-03-15 2014-09-18 International Business Machines Corporation Method and system for monitoring access attempts of shared memory of databases
US10591975B2 (en) * 2017-10-30 2020-03-17 Qualcomm Incorporated Memory access management for low-power use cases of a system on chip via secure non-volatile random access memory

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106446658A (en) * 2016-08-30 2017-02-22 孙鸿鹏 Data center security protection method and system
CN111177112A (en) * 2019-12-06 2020-05-19 陕西上讯信息技术有限公司 Database blocking method and device based on operation and maintenance management system and electronic equipment

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
基于Java Applet的数据库连接与查询技术;杨军, 王凤贵;中国有线电视(07);全文 *
基于嵌入式Web服务器的远程视频监控系统开发;邓丽萍;;计算机时代(09);全文 *
铁路客票系统中缓存机制的应用模型研究;王红爱;朱建生;刘文韬;阎志远;;铁路计算机应用(02);全文 *

Also Published As

Publication number Publication date
CN111914032A (en) 2020-11-10

Similar Documents

Publication Publication Date Title
JP7389104B2 (en) Upgrading a database from a first version to a second version
US9785521B2 (en) Fault tolerant architecture for distributed computing systems
US9436556B2 (en) Customizable storage system for virtual databases
JP4762972B2 (en) System and method for a recovery unit in a database
US20160162283A1 (en) Dependency manager for databases
US20110191630A1 (en) Diagnosing a fault incident in a data center
US20120158662A1 (en) Backup and restore of data from any cluster node
TWI511046B (en) Dynamic cli mapping for clustered software entities
CN102737088A (en) Seamless upgrades in distributed database system
US20050055328A1 (en) Method and apparatus for data integration
CN112199356B (en) Fault processing method, device, server and storage medium
US20120036496A1 (en) Plug-in based high availability application management framework (amf)
US7478387B2 (en) System and method for creating a restartable non-native language routine execution environment
CN111914032B (en) Data processing device and method applied to automatic monitoring system of vehicle
CN116627721A (en) Cloud primary database recovery method, device and storage medium based on hybrid cloud
CN114443768A (en) Main/standby switching method and device of distributed database and readable storage medium
US9031969B2 (en) Guaranteed in-flight SQL insert operation support during an RAC database failover
CN111031126B (en) Cluster cache sharing method, system, equipment and storage medium
CN111966520A (en) Database high-availability switching method, device and system
CN115587141A (en) Database synchronization method and device
CN112395340B (en) Data asset management method and device
KR20200106124A (en) Test automation framework for dbms for analysis of bigdata and method of test automation
US20070055645A1 (en) Storage resource scan
CN114785789B (en) Database fault management method and device, electronic equipment and storage medium
CN114936026B (en) Method, system, storage medium and equipment for analyzing semi-structured data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant