CN115062012A - Data processing method, data processing device, storage medium and electronic equipment - Google Patents

Data processing method, data processing device, storage medium and electronic equipment Download PDF

Info

Publication number
CN115062012A
CN115062012A CN202210570993.0A CN202210570993A CN115062012A CN 115062012 A CN115062012 A CN 115062012A CN 202210570993 A CN202210570993 A CN 202210570993A CN 115062012 A CN115062012 A CN 115062012A
Authority
CN
China
Prior art keywords
data table
database
target data
storage module
operation instruction
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
CN202210570993.0A
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.)
China Automotive Innovation Corp
Original Assignee
China Automotive Innovation Corp
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 China Automotive Innovation Corp filed Critical China Automotive Innovation Corp
Priority to CN202210570993.0A priority Critical patent/CN115062012A/en
Publication of CN115062012A publication Critical patent/CN115062012A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • 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/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Landscapes

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

Abstract

The present disclosure relates to a data processing method, an apparatus, a storage medium, and an electronic device, which are applied to a persistent storage module applied to an adaptive platform automobile open system architecture, the persistent storage module including a key value storage module and a database access module, the method including: the key value storage module receives an operation instruction which is sent by an application program and generated based on a data table access handle; the key value storage module sends the operation instruction to the database access module; the database access module performs corresponding operation on the target data table based on the operation instruction to generate an operation result; the database access module sends an operation result to the key value storage module; and the key value storage module sends the operation result to the application program. The data of the application program in the self-adaptive platform automobile open system architecture are stored by the database, so that the persistent storage of the data and the stability of the data operation of the application program are ensured.

Description

Data processing method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of automatic driving, and in particular, to a data processing method and apparatus, a storage medium, and an electronic device.
Background
A persistent storage module of an Adaptive platform automobile open system Architecture (AP) provides a mechanism for applications and other functional sets of the AP to store information in non-volatile memory. The persistent storage module provides two storage modes of key value storage and file storage. The AP's applications and other programs may use a combination of multiple key value stores and file stores simultaneously, with different key value stores being independent of each other and stored separately. Fig. 1 shows a timing diagram of a conventional system using key value storage, and it can be seen that, each time a new key value storage file is opened, a block of memory space is applied for storing data, and data is synchronized from a local initial file to a memory. When the data is read, the data can be directly read from the memory, when the data is written, modified and deleted, the data in the memory is directly modified, and when the application calls the synchronous interface, the data in the memory is synchronized into the key value storage file. Since data is directly read from the memory, the data reading efficiency is high, but if the stored data is large, the program occupies a large amount of memory resources, and the data is stored in a lightweight data interchange format JavaScript Object Notation (Json) file, the data in the memory is written into the file again every time the data is synchronized into the file, and the process directly covers the original data, so that if the data is written in a failed manner, all the data may be lost.
Disclosure of Invention
In order to solve at least one technical problem presented above, the present disclosure proposes a data processing method, an apparatus, a storage medium, and an electronic device.
According to one aspect of the present disclosure, a data processing method is provided, which is applied to a persistent storage module applied to an adaptive platform automobile open system architecture, where the persistent storage module includes a key value storage module and a database access module, and the method includes:
the key value storage module receives an operation instruction which is sent by an application program and generated based on a data table access handle, wherein the data table access handle points to a target data table corresponding to the application program;
the key value storage module sends the operation instruction to the database access module;
the database access module performs corresponding operation on the target data table based on the operation instruction to generate an operation result;
the database access module sends the operation result to the key value storage module;
and the key value storage module sends the operation result to an application program.
In some possible embodiments, before the key-value storage module receives an operation instruction generated based on a data table access handle sent by an application program, the method further includes:
in response to the condition that a data table creating instruction sent by the application program is received, the key value storage module judges whether a target data table corresponding to the application program exists or not;
if the target data table exists, the key value storage module sends the data table access handle to the application program;
if the target data table does not exist, the key value storage module sends the data table creating instruction to the database access module;
the database access module responds to the condition of receiving the command for creating the data table, creates the target data table, and sends a data table access handle corresponding to the target data table to the key value storage module under the condition of successful creation;
and the key value storage module sends the data table access handle to the application program.
In some possible embodiments, the method further comprises:
in response to the condition that an initialization database instruction sent by the application program is received, the key value storage module sends a configuration database type instruction to the database access module;
the database access module receives the configuration database type instruction and configures the type of a target database, wherein the target database is a database corresponding to the application program;
the database access module acquires the database access handle according to the type of the target database;
the database access module judges whether the type of the target database is the same as the type of the database stored last time;
if not, all data in the database stored last time is migrated to the target database based on the database access handle;
the database access module sends the database access handle to the key value storage module.
In some possible embodiments, the operation instruction includes a write data operation instruction, and the performing, by the database access module, a corresponding operation on the target data table based on the operation instruction includes:
acquiring first target data and a first key corresponding to the first target data, wherein the first target data is data to be written into a target data table by the application program;
judging whether the first key exists in the target data table or not;
if yes, updating a key value corresponding to the first key in the target data table based on the first target data;
and if not, writing the first key and the first target data into the target data table.
In some possible embodiments, the operation instruction further includes a read data operation instruction, and the performing, by the database access module, a corresponding operation on the target data table based on the operation instruction further includes:
acquiring a second key, wherein the second key is a key corresponding to second target data to be read by the application program;
judging whether the second key exists in the target data table or not;
if yes, returning the second target data corresponding to the second key in the target data table;
if not, returning reading failure information.
In some possible embodiments, the operation instruction further includes a delete data operation instruction, and the performing, by the database access module, a corresponding operation on the target data table based on the operation instruction further includes:
acquiring a third key, wherein the third key is a key corresponding to third target data to be deleted of the application program;
and deleting the third target data corresponding to the third key in the target data table.
In some possible embodiments, the operation instruction further includes a delete key operation instruction, and the performing, by the database access module, a corresponding operation on the target data table based on the operation instruction further includes:
deleting all keys and key values corresponding to the keys in the target data table;
the operation instruction also comprises a data table deleting operation instruction;
the database access module performs corresponding operations on the target data table based on the operation instruction, and further includes:
and deleting the target data table.
According to a second aspect of the present disclosure, there is provided a data processing apparatus applied to a persistent storage module applied to an adaptive platform automobile open system architecture, the persistent storage module including a key value storage module and a database access module, the apparatus including:
an operation instruction receiving module, configured to receive, by the key value storage module, an operation instruction generated based on a data table access handle sent by an application program, where the data table access handle points to a target data table corresponding to the application program;
the operation instruction forwarding module is used for sending the operation instruction to the database access module by the key value storage module;
the operation execution module is used for performing corresponding operation on the target data table by the database access module based on the operation instruction to generate an operation result;
the operation result sending module is used for sending the operation result to the key value storage module by the database access module;
and the operation result forwarding module is used for sending the operation result to the application program by the key value storage module.
According to a third aspect of the present disclosure, there is provided an electronic device comprising at least one processor, and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor implements the data processing method according to any one of the first aspect by executing the instructions stored by the memory.
According to a fourth aspect of the present disclosure, there is provided a computer-readable storage medium having at least one instruction or at least one program stored therein, the at least one instruction or at least one program being loaded and executed by a processor to implement the data processing method according to any one of the first aspects.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
The implementation of the present disclosure has the following beneficial effects:
the application program in the self-adaptive platform automobile open system architecture stores data by using the database, so that the problem that all data may be lost when data is written into a file due to the fact that memory resources are occupied greatly when the amount of key value storage data is large in a persistent storage module can be solved, and the application program can stably write, modify and delete the data.
Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions and advantages of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present specification, and other drawings can be obtained by those skilled in the art without inventive efforts.
FIG. 1 is a schematic flow diagram of a data processing method of the prior art;
FIG. 2 shows a flow diagram of a data processing method according to an embodiment of the present disclosure;
FIG. 3 shows a schematic flow diagram for creating a data table according to an embodiment of the present disclosure;
FIG. 4 illustrates a flow diagram for initializing a database in accordance with an embodiment of the disclosure;
FIG. 5 illustrates a schematic diagram of an application accessing a database, according to an embodiment of the present disclosure;
FIG. 6 shows a schematic block diagram of a data processing apparatus according to an embodiment of the present disclosure;
FIG. 7 shows a block diagram of an electronic device in accordance with an embodiment of the disclosure;
fig. 8 shows a block diagram of another electronic device in accordance with an embodiment of the disclosure.
Detailed Description
The technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments in the present description, belong to the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or 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 server 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.
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.
According to one aspect of the disclosure, a data processing method is provided and applied to a persistent storage module, the persistent storage module is applied to an adaptive platform automobile open system architecture, and the persistent storage module comprises a key value storage module and a database access module.
The persistent storage module of the middleware self-adaptive platform automobile open system architecture of the automatic driving and intelligent networking automobile is additionally provided with a database access module, and the persistent storage module of the self-adaptive platform automobile open system architecture comprises a key value storage module and a database access module. The data of the self-adaptive platform automobile development system architecture is stored by using the database, so that the phenomenon that the stored data is too much and an application program occupies a large amount of memory resources can be avoided. The database is mainly divided into a relational database and a non-relational database, the format of the relational database is relatively fixed, each two-dimensional table can correspond to a key value storage, and the design idea of the key value storage of a persistent storage module is matched, so that the relational database is selected to be used, the mainstream relational database is related to a relational database management system MySQL, a lightweight relational database system SQLite, a relational database management system Oracle of Oracle and the like, certain differences exist among different databases, different databases can be installed in different systems, and the compatible use of a plurality of databases needs to be considered during implementation.
Fig. 2 is a schematic flow chart of a data processing method according to an embodiment of the present disclosure, as shown in fig. 3, the method includes:
s101, a key value storage module receives an operation instruction which is sent by an application program and generated based on a data table access handle, wherein the data table access handle points to a target data table corresponding to the application program;
the application program receives a data table access handle sent by the key value storage module, and generates an operation instruction based on the data table access handle, wherein the operation instruction comprises a data writing operation instruction, a data reading operation instruction, a data deleting operation instruction, a data table deleting operation instruction, a key value deleting operation instruction and a data modifying operation instruction, and the generation of the operation instruction mainly refers to that the application program calls a related operation function according to user requirements. The data table access handle specifies the target data table that the application is to operate on. The application program sends an operation instruction to the key value storage module, and the key value storage module receives the operation instruction.
S102, the key value storage module sends the operation instruction to the database access module;
and after receiving the operation instruction sent by the application program, the key value storage module forwards the operation instruction to the database access module.
S103, the database access module performs corresponding operation on the target data table based on the operation instruction to generate an operation result;
the database access module receives an operation instruction sent by the key value storage module, corresponding operation is carried out on a target data table based on the operation instruction, when the operation instruction is a data table writing operation instruction, the database access module carries out writing operation on the data table, if the writing operation is successful, the writing success is taken as an operation result, and if the writing operation is failed, the writing failure is taken as an operation result; when the operation instruction is a read data table operation instruction, if the reading is successful, the read data is used as a returned operation result, and if the reading is failed, the reading failure is used as an operation result; when the operation instruction is a data deleting operation instruction, if the data is deleted successfully, the data is deleted successfully as an operation result, and if the data is deleted unsuccessfully, the data is deleted unsuccessfully as an operation result; when the operation instruction is a data table deleting operation instruction, if the data table is deleted successfully, the data table is deleted successfully as an operation result, and if the data table is deleted unsuccessfully, the data table is deleted unsuccessfully as an operation result; and when the operation instruction is a delete key value operation instruction, if all the keys are deleted successfully, the delete key is successfully used as an operation result, and if the delete key is failed, the delete key is failed to be used as an operation result.
S104, the database access module sends an operation result to the key value storage module;
and after the database access module generates an operation result, the operation result is fed back to the key value storage module.
And S105, the key value storage module sends the operation result to the application program.
And after receiving the operation result, the key value storage module feeds the operation result back to the application program, and the application program receives the operation result. When the application program process is finished, sending a database connection closing request to the key value storage, forwarding the database connection closing request to the database access module by the key value storage, and closing the database connection by the database access module.
The application program in the self-adaptive platform automobile open system architecture stores data by using the database, so that the problem that all data may be lost when data is written into a file due to the fact that memory resources are occupied greatly when the amount of key value storage data is large in a persistent storage module can be solved, and the application program can stably write, modify and delete the data.
Referring to fig. 3, in an embodiment, before the key-value storage module receives an operation instruction generated based on a data table access handle sent by an application program, the method further includes:
s201, in response to the condition that a data table creating instruction sent by an application program is received, a key value storage module judges whether a target data table corresponding to the application program exists or not;
s202, if the target data table exists, the key value storage module sends a data table access handle to the application program;
s203, if the target data table does not exist, the key value storage module sends a data table creating instruction to the database access module;
s204, the database access module responds to the condition of receiving the command of creating the data table, creates a target data table, and sends a data table access handle corresponding to the target data table to the key value storage module under the condition of successful creation;
s205, the key value storage module sends the data table access handle to the application program.
The method comprises the steps that an application program sends a data table creating instruction to a key value storage module according to requirements, the data table creating instruction comprises a table name of a target data table to be created, the key value storage module receives the data table creating instruction sent by the application program, the key value storage module inquires whether the target data table exists in a target database according to the table name of the target data table, and if the target data table exists, a data table access handle is returned to the application program; if the target data table does not exist, the key value storage module sends a data table creating instruction to the database access module, the database access module creates the target data table after receiving the data table creating instruction, if the data table creating instruction is created successfully, a creating result of successful creation is returned to the key value storage module, and if the data table creating instruction is created unsuccessfully, a creating result of unsuccessful creation is returned to the key value storage module; if the key value storage module receives a creation result of the creation failure, the key value storage module sends the creation failure to the application program; and if the key value storage module receives a successful creation result sent by the database access module, sending a data table access handle to the application program, and performing corresponding operation on the target data table by the application program according to the data table access handle. When the application program performs corresponding operations on the target database, it is necessary to ensure that a corresponding target data table exists, which is convenient for writing data and performing other corresponding operations on the target data table.
Referring to fig. 4, in one embodiment, the method further includes:
s301, in response to the condition that an initialization database instruction sent by an application program is received, sending a configuration database type instruction to a database access module by a key value storage module;
s302, the database access module receives a database type configuration instruction, and configures the type of a target database, wherein the target database is a database corresponding to an application program;
s303, the database access module acquires a database access handle according to the type of the target database;
s304, the database access module judges whether the type of the target database is the same as the type of the database stored last time;
s305, if the data access handles are different, all data in the database stored last time are migrated to the target database based on the database access handles;
s306, the database access module sends the database access handle to the key value storage module.
Before storing key value pair data, an application program of the self-adaptive platform automobile open system framework calls an initialized database interface to transmit database type parameters to execute operation. Referring to fig. 5, an application program sends an initialization database command to a key value storage module, the key value storage module sends a configuration database type to a database access module after receiving the initialization database command, the database access module configures the type of a target database corresponding to the application program, the target database type is a mainstream relational database, and includes a relational database management system MySQL, a lightweight relational database system SQLite, a first-bone relational database management system Oracle and the like, MySQL is a relational database management system, and the relational database stores data in different tables instead of storing all data in a large database, so that speed is increased and flexibility is improved. The SQLite is a light database, is a compliance relational database management system, is embedded in design target, is already used in many embedded products, occupies very low resources, only needs hundreds of K of memories in embedded equipment, and has higher processing speed than the MySQL database management system. Oracle is a relational database management system of Oracle corporation, has good system portability, convenient use and strong function, is suitable for various large, medium and small microcomputer environments, and is a database scheme which has high efficiency, good reliability and is suitable for high throughput. And after the database access module is configured with the database type, the database access handle is acquired from the key value storage module according to the database type. The database access module compares the type of the database stored last time with the type of the target database, if the types are the same, the type of the target database is stored, and the database access handle is sent to the key value storage module. If the data in the database is different from the data in the database stored last time, migrating all the data in the database stored last time to the target database based on the database access handle, after the migration is successful, storing the type of the target database, and sending the database access handle to the key value storage module, if the database access module fails to migrate all the data in the database stored last time to the target database, sending initialization failure to the key value storage module, and forwarding the key value storage module to the application program. The database access module is added in the module for compatibly using various databases, provides a uniform interface for the key value storage module for connecting, creating and operating the databases, and different databases correspond to different implementations. When the application and other programs of the self-adaptive platform automobile open system architecture use key value storage, the database types can be configured for use, the database access module can be instantiated according to the configuration, a database access interface is provided, the expansibility is good, and more databases are supported. And the database access module can store the database type configured last time, judge whether to replace the database according to the current configuration information, if the database is replaced, the module can read all data from the database file stored last time during initialization, and store the data into the newly configured database file for continuous maintenance, thereby ensuring the persistent storage of the data.
In one embodiment, the operation instruction includes a write data operation instruction, and the database access module performs corresponding operation on the target data table based on the operation instruction includes:
acquiring first target data and a first key corresponding to the first target data, wherein the first target data is data to be written into a target data table by an application program;
judging whether a first key exists in the target data table or not;
if yes, updating a key value corresponding to the first key in the target data table based on the first target data;
if not, the first key and the first target data are written into the target data table.
When an application program has a requirement for writing data into a target database, a written data operation instruction is generated based on a data table access handle, the written data operation instruction is sent to a key value storage module, the key value storage module sends the written data operation instruction to a database access module, the database access module obtains first target data to be written and a first key corresponding to the first target data based on the written data operation instruction, the first key is searched in the target data table based on the data table access handle, and if the first key is searched in the target data table, the first target data is written into a key value area corresponding to the first key to cover the original key value. And if the corresponding key is not found in the target data table, adding the first key and the corresponding first target data thereof into the target data table to form a new record. The database is used for storing data, so that when an application program performs writing operation on the data, the stability of the operation is ensured, and the persistent storage of the data is ensured.
In one embodiment, the operation instruction further includes a read data operation instruction, and the performing, by the database access module, corresponding operations on the target data table based on the operation instruction further includes:
acquiring a second key, wherein the second key is a key corresponding to second target data to be read by the application program;
judging whether a second key exists in the target data table or not;
if yes, returning second target data corresponding to a second key in the target data table;
if not, returning reading failure information.
When an application program has a requirement for reading data from a target database, a data reading operation instruction is generated based on a data table access handle, the data reading operation instruction is sent to a key value storage module, the key value storage module sends the data reading operation instruction to a database access module, the database access module searches a second key in the target data table based on a second key corresponding to the key value which needs to be read by the data reading operation instruction, and if the second key is found in the target data table, the key value corresponding to the second key, namely second target data, is obtained. And the database access module sends the acquired second target data to the key value storage module, and the key value storage module forwards the second target data to the application program. And if the second key is not found in the target data table, sending reading failure information to the key value storage module, and sending the reading failure information to the application program by the key value storage module. The database is used for storing data, so that when an application program reads the data, the stability of operation is ensured, and the persistent storage of the data is ensured.
In one embodiment, the operation instruction further includes a delete data operation instruction, and the performing, by the database access module, corresponding operations on the target data table based on the operation instruction further includes:
acquiring a third key, wherein the third key is a key corresponding to third target data to be deleted by the application program;
and deleting the third target data corresponding to the third key in the target data table.
When the application program has a requirement for deleting data from the target database, a data deleting operation instruction is generated based on the data table access handle, the data deleting operation instruction is sent to the key value storage module, the key value storage module sends the data deleting operation instruction to the database access module, the database access module searches a third key in the target database based on a third key corresponding to a key value needing to be deleted by the data deleting operation instruction, and if the third key is found in the target database, the key value corresponding to the third key, namely third target data, is deleted. If the deletion is successful, returning the operation result of the successful deletion, and if the deletion is failed, returning the operation result of the failed deletion. And if the second key is not found in the target data table, sending deletion failure information to the key value storage module, and sending the deletion failure information to the application program by the key value storage module. The database is used for storing data, so that when the application program deletes the data, the stability of the operation is ensured, and the persistent storage of the data is ensured.
In one embodiment, the operation instruction further includes a delete key operation instruction, and the performing, by the database access module, corresponding operations on the target data table based on the operation instruction further includes:
deleting all keys and key values corresponding to the keys in the target data table;
the operation instruction also comprises a data table deleting operation instruction;
the database access module performs corresponding operations on the target data table based on the operation instruction, and the corresponding operations further include:
and deleting the target data table.
When an application program has a requirement for deleting key values from a target database, a deleting key value operation instruction is generated based on a data table access handle, the deleting key value operation instruction is sent to a key value storage module, the key value storage module sends the deleting key value operation instruction to a database access module, the database access module deletes the key values corresponding to all keys in the target database based on the deleting key value operation instruction, if the deleting is successful, an operation result of successful deleting is returned, and if the deleting is failed, an operation result of failed deleting is returned. The database is used for storing data, so that when an application program deletes key values of the data, the stability of operation is guaranteed, and the persistent storage of the data is guaranteed.
When an application program has a requirement for deleting a data table from a target database, a data table deleting operation instruction is generated based on a data table access handle, the data table deleting operation instruction is sent to a key value storage module, the key value storage module sends the data table deleting operation instruction to a database access module, the database access module obtains a table name of the target data table to be deleted based on the data table deleting operation instruction, the target data table in the target database is deleted according to the table name of the target data table, if the deletion is successful, an operation result of successful deletion is returned, and if the deletion is failed, an operation result of failed deletion is returned. The database is used for storing data, so that when the application program deletes the data table from the data, the stability of operation is guaranteed, and the persistent storage of the data is guaranteed.
Referring to fig. 6, according to a second aspect of the present disclosure, there is provided a data processing apparatus applied to a persistent storage module applied to an adaptive platform automobile open system architecture, where the persistent storage module includes a key value storage module and a database access module, the apparatus including:
an operation instruction receiving module 10, configured to receive, by the key value storage module, an operation instruction generated based on a data table access handle sent by the application program, where the data table access handle points to a target data table corresponding to the application program;
the operation instruction forwarding module 20 is used for the key value storage module to send the operation instruction to the database access module;
the operation execution module 30 is used for the database access module to perform corresponding operation on the target data table based on the operation instruction to generate an operation result;
an operation result sending module 40, configured to send the operation result to the key value storage module by the database access module;
and an operation result forwarding module 50, configured to send the operation result to the application program by the key value storage module.
In some embodiments, functions of or modules included in the apparatus provided in the embodiments of the present disclosure may be used to execute the method described in the above method embodiments, and specific implementation thereof may refer to the description of the above method embodiments, and for brevity, will not be described again here.
The embodiment of the present disclosure also provides a computer-readable storage medium, where at least one instruction or at least one program is stored in the computer-readable storage medium, and the at least one instruction or the at least one program is loaded by a processor and executed to implement the method. The computer readable storage medium may be a non-volatile computer readable storage medium.
An embodiment of the present disclosure further provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured as the method.
The electronic device may be provided as a terminal, server, or other form of device.
Fig. 7 shows a block diagram of an electronic device in accordance with an embodiment of the disclosure. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like terminal.
Referring to fig. 7, electronic device 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 806 provides power to the various components of the electronic device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.
The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and a user as described above. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of the touch or slide action but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 800 is in an operation mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the electronic device 800. For example, the sensor assembly 814 may detect an open/closed state of the electronic device 800, the relative positioning of components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, orientation or acceleration/deceleration of the electronic device 800, and a change in temperature of the electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 may access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the above-mentioned communication component 816 further comprises a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium, such as the memory 804, is also provided that includes computer program instructions executable by the processor 820 of the electronic device 800 to perform the above-described methods.
Fig. 8 shows a block diagram of another electronic device in accordance with an embodiment of the disclosure. For example, electronic device 1900 may be provided as a server. Referring to fig. 8, electronic device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the above-described method.
The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input/output (I/O) interface 1958. The electronic device 1900 may operate based on an operating system stored in memory 1932, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
In an exemplary embodiment, a non-transitory computer readable storage medium, such as the memory 1932, is also provided that includes computer program instructions executable by the processing component 1922 of the electronic device 1900 to perform the above-described methods.
The present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: 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), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembly instructions, Instruction Set Architecture (ISA) instructions, machine related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, 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/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The foregoing description of the embodiments of the present disclosure has been presented for purposes of illustration and description, but is not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (10)

1. A data processing method is applied to a persistent storage module, the persistent storage module is applied to an adaptive platform automobile open system architecture, the persistent storage module comprises a key value storage module and a database access module, and the method is characterized by comprising the following steps:
the key value storage module receives an operation instruction which is sent by an application program and generated based on a data table access handle, wherein the data table access handle points to a target data table corresponding to the application program;
the key value storage module sends the operation instruction to the database access module;
the database access module performs corresponding operation on the target data table based on the operation instruction to generate an operation result;
the database access module sends the operation result to the key value storage module;
and the key value storage module sends the operation result to an application program.
2. The method of claim 1, wherein before the key-value storage module receives an operation instruction generated based on a data table access handle sent by an application program, the method further comprises:
in response to the condition of receiving a data table creating instruction sent by the application program, the key value storage module judges whether a target data table corresponding to the application program exists or not;
if the target data table exists, the key value storage module sends the data table access handle to the application program;
if the target data table does not exist, the key value storage module sends the data table creating instruction to the database access module;
the database access module responds to the condition of receiving the command for creating the data table, creates the target data table, and sends a data table access handle corresponding to the target data table to the key value storage module under the condition of successful creation;
and the key value storage module sends the data table access handle to the application program.
3. The method of claim 1, further comprising:
in response to the condition that an initialization database instruction sent by the application program is received, the key value storage module sends a configuration database type instruction to the database access module;
the database access module receives the configuration database type instruction and configures the type of a target database, wherein the target database is a database corresponding to the application program;
the database access module acquires the database access handle according to the type of the target database;
the database access module judges whether the type of the target database is the same as the type of the database stored last time;
if not, all data in the database stored last time is migrated to the target database based on the database access handle;
the database access module sends the database access handle to the key value storage module.
4. The method of claim 1, wherein the operation instruction comprises a write data operation instruction, and wherein the database access module performing the corresponding operation on the target data table based on the operation instruction comprises:
acquiring first target data and a first key corresponding to the first target data, wherein the first target data is data to be written into a target data table by the application program;
judging whether the first key exists in the target data table or not;
if yes, updating a key value corresponding to the first key in the target data table based on the first target data;
and if not, writing the first key and the first target data into the target data table.
5. The method of claim 1, wherein the operation instruction further comprises a read data operation instruction, and wherein the database access module performing the corresponding operation on the target data table based on the operation instruction further comprises:
acquiring a second key, wherein the second key is a key corresponding to second target data to be read by the application program;
judging whether the second key exists in the target data table or not;
if yes, returning the second target data corresponding to the second key in the target data table;
if not, returning reading failure information.
6. The method of claim 1, wherein the operation instruction further comprises a delete data operation instruction, and wherein the database access module performing corresponding operation on the target data table based on the operation instruction further comprises:
acquiring a third key, wherein the third key is a key corresponding to third target data to be deleted of the application program;
and deleting the third target data corresponding to the third key in the target data table.
7. The method of claim 1, wherein the operation instruction further comprises a delete key operation instruction, and wherein the database access module performing the corresponding operation on the target data table based on the operation instruction further comprises:
deleting all keys and key values corresponding to the keys in the target data table;
the operation instruction also comprises a data table deleting operation instruction;
the database access module performs corresponding operations on the target data table based on the operation instruction, and further includes:
and deleting the target data table.
8. A data processing device is applied to a persistent storage module, the persistent storage module is applied to an adaptive platform automobile open system architecture, the persistent storage module comprises a key value storage module and a database access module, and the device comprises:
an operation instruction receiving module, configured to receive, by the key value storage module, an operation instruction generated based on a data table access handle sent by an application program, where the data table access handle points to a target data table corresponding to the application program;
the operation instruction forwarding module is used for sending the operation instruction to the database access module by the key value storage module;
the operation execution module is used for performing corresponding operation on the target data table by the database access module based on the operation instruction to generate an operation result;
the operation result sending module is used for sending the operation result to the key value storage module by the database access module;
and the operation result forwarding module is used for sending the operation result to the application program by the key value storage module.
9. A computer-readable storage medium, in which at least one instruction or at least one program is stored, which is loaded and executed by a processor to implement the data processing method according to any one of claims 1 to 7.
10. An electronic device comprising at least one processor, and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the at least one processor implementing the data processing method of any one of claims 1-7 by executing the instructions stored by the memory.
CN202210570993.0A 2022-05-24 2022-05-24 Data processing method, data processing device, storage medium and electronic equipment Pending CN115062012A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210570993.0A CN115062012A (en) 2022-05-24 2022-05-24 Data processing method, data processing device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210570993.0A CN115062012A (en) 2022-05-24 2022-05-24 Data processing method, data processing device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN115062012A true CN115062012A (en) 2022-09-16

Family

ID=83198775

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210570993.0A Pending CN115062012A (en) 2022-05-24 2022-05-24 Data processing method, data processing device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN115062012A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010019614A1 (en) * 2000-10-20 2001-09-06 Medna, Llc Hidden Link Dynamic Key Manager for use in Computer Systems with Database Structure for Storage and Retrieval of Encrypted Data
CN109542892A (en) * 2018-10-19 2019-03-29 北京全路通信信号研究设计院集团有限公司 Method, device and system for realizing relation of real-time database
CN110716947A (en) * 2019-10-24 2020-01-21 网易(杭州)网络有限公司 Data access method and device, computer equipment and storage medium
CN111131231A (en) * 2019-12-23 2020-05-08 北京蜂云科创信息技术有限公司 Method and equipment for accessing data of vehicle-mounted terminal into Internet of vehicles monitoring platform

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010019614A1 (en) * 2000-10-20 2001-09-06 Medna, Llc Hidden Link Dynamic Key Manager for use in Computer Systems with Database Structure for Storage and Retrieval of Encrypted Data
CN109542892A (en) * 2018-10-19 2019-03-29 北京全路通信信号研究设计院集团有限公司 Method, device and system for realizing relation of real-time database
CN110716947A (en) * 2019-10-24 2020-01-21 网易(杭州)网络有限公司 Data access method and device, computer equipment and storage medium
CN111131231A (en) * 2019-12-23 2020-05-08 北京蜂云科创信息技术有限公司 Method and equipment for accessing data of vehicle-mounted terminal into Internet of vehicles monitoring platform

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
高红等: "基于电动汽车云平台的大数据存储与管理", 《 电力信息与通信技术》, 15 April 2018 (2018-04-15), pages 45 - 49 *

Similar Documents

Publication Publication Date Title
US20160381629A1 (en) Virtual sim card for accessing operator network
EP3073379A1 (en) Firmware recovery method, device and terminal
CN108495168B (en) Bullet screen information display method and device
CN106991018B (en) Interface skin changing method and device
CN110737415A (en) Screen sharing method and device, computer equipment and storage medium
EP2950486B1 (en) Method and device for managing instant message
CN104767857A (en) Telephone calling method and device based on cloud name cards
CN110750226A (en) Central control equipment management method and device, computer equipment and storage medium
CN107463372B (en) Data-driven page updating method and device
CN111767006B (en) Data processing method and device
CN109962958B (en) Document processing method and device
CN109471714B (en) Platform deployment method, device, equipment and storage medium
CN107885464B (en) Data storage method, device and computer readable storage medium
CN111290843A (en) Process management method and device
CN109491655A (en) A kind of incoming event processing method and processing device
CN108549570B (en) User interface updating method and device
CN112131999B (en) Identity determination method and device, electronic equipment and storage medium
CN105607958B (en) Information input method and device
CN115062012A (en) Data processing method, data processing device, storage medium and electronic equipment
CN111290882B (en) Data file backup method, data file backup device and electronic equipment
CN108427568B (en) User interface updating method and device
CN110493298B (en) Information synchronization method and device
CN113238887A (en) Data processing method, device and storage medium
CN113360341B (en) Front-end application maintenance and loading method and device
CN111767249B (en) Method and device for determining self-running time of function

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