Data management method, device and electronic controller

By determining changes in the target file in the first process and sending data change instructions to the associated second process, the problems of low database management efficiency and unreliable data in the prior art are solved, and efficient data management and reliable database are achieved. operate.

CN112988706BActive Publication Date: 2024-09-03GUANGZHOU XIAOPENG MOTORS TECH CO LTD
View PDF 17 Cites 0 Cited by

Patent Information

Application Number
CN202110257229.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-09
Publication Date
2024-09-03
Estimated Expiration
2041-03-09

AI Technical Summary

Technical Problem

Existing database management technology cannot effectively notify applications of data changes, resulting in low data management efficiency and inability to guarantee data reliability, especially in in-vehicle products where database reading and writing efficiency and resource usage requirements are high.

Method used

By determining whether the target file has changed in the first process, obtaining the changed key-value pairs, determining the second process associated with the first process, and sending data change instructions to the second process, including the key-value pairs, so that the user can conveniently Manage data and improve data management efficiency.

Benefits of technology

It improves the efficiency of data management, ensures the reliability of data and the efficiency of reading and writing databases, meets the resource usage requirements of in-vehicle products, and avoids the destruction of user data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112988706B
    Figure CN112988706B
Patent Text Reader

Abstract

The embodiment of the present application provides a data management method, device and electronic controller, which relate to the field of vehicle technology. The method includes: determining whether the data contained in the target file has changed, and the target file belongs to the first process; when the data contained in the target file has changed, obtaining the key-value pair corresponding to the changed data, and determining the second process associated with the first process; sending a data change instruction to the second process, and the data change instruction includes the key-value pair. The data management method provided by the embodiment of the present application can improve the efficiency of data management to a certain extent by sending the changed data to the second process when it is determined that the target file of the first process has changed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle technology, and in particular to a data management method, device and electronic controller. Background Art

[0002] With the continuous development and application of technologies such as cloud computing and the Internet of Things, massive amounts of data are constantly generated in the fields of production and operation, business activities, social life, etc. People are in the information age. Some countries have even elevated data management to the national strategic level, and many companies have also regarded data management as an important means to improve their competitiveness. It can be seen that the management of data is affecting people's work and life, which makes the management of databases particularly important.

[0003] Application Contents

[0004] In view of the above problems, the embodiments of the present application provide a data management method, device and electronic controller to solve the above technical problems.

[0005] The embodiment of the present application is implemented by adopting the following technical solutions:

[0006] In a first aspect, some embodiments of the present application provide a data management method, the method comprising: determining whether data contained in a target file has changed, the target file belonging to a first process; when the data contained in the target file has changed, obtaining a key-value pair corresponding to the changed data, and determining a second process associated with the first process; sending a data change instruction to the second process, the data change instruction including the key-value pair.

[0007] In a second aspect, some embodiments of the present application further provide a data management device, the device comprising a determination module, an acquisition module and a sending module. The determination module is used to determine whether the data contained in the target file has changed, and the target file belongs to the first process. The acquisition module is used to obtain the key-value pair corresponding to the changed data when the data contained in the target file has changed, and determine the second process associated with the first process. The sending module is used to send a data change instruction to the second process, and the data change instruction includes the key-value pair.

[0008] In a third aspect, some embodiments of the present application further provide an electronic controller, comprising a processor and a memory, wherein the memory stores computer program instructions, and the computer program instructions, when called by the processor, execute any of the above-mentioned data management methods.

[0009] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which computer program instructions are stored, and the computer program code can be called by a processor to execute any of the above-mentioned data management methods.

[0010] The data management method, device and electronic controller provided by the embodiment of the present application can improve the efficiency of data management by sending the data changed in the first process to the second process. Specifically, first determine whether the data contained in the target file has changed, wherein the target file belongs to the first process, when it is determined that the data contained in the target file has changed, obtain the key-value pair corresponding to the changed data, and then determine the second process associated with the first process, and finally send a data change instruction to the second process, wherein the data change instruction may include a key-value pair. When the present application determines that the target file located in the first process has changed, it can send the data change instruction to the second process, so that the user can manage the data conveniently and improve the efficiency of data management to a certain extent.

[0011] These and other aspects of the present application will become more clearly understood in the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0013] Figure 1 A flow chart of a data management method provided in an embodiment of the present application is shown.

[0014] Figure 2 A flow chart of step S120 in a data management method provided in an embodiment of the present application is shown.

[0015] Figure 3 A flow chart of a data management method provided in another embodiment of the present application is shown.

[0016] Figure 4 A flow chart showing other steps in a data management method provided in another embodiment of the present application is shown.

[0017] Figure 5 A flow chart showing other steps in a data management method provided in another embodiment of the present application is shown.

[0018] Figure 6 A workflow diagram of a data management method provided in another embodiment of the present application is shown.

[0019] Figure 7 A schematic diagram of a process of reading a file in a data management method provided in another embodiment of the present application is shown.

[0020] Figure 8 A schematic diagram of the process of writing a file in a data management method provided in another embodiment of the present application is shown.

[0021] Fig. 9 A flow chart of a data management method provided in yet another embodiment of the present application is shown.

[0022] Fig.10 A schematic diagram of table configuration data format in a data management method provided in yet another embodiment of the present application is shown.

[0023] Fig.11 A module block diagram of a data management device provided in an embodiment of the present application is shown.

[0024] Fig.12 A module block diagram of an electronic controller provided in an embodiment of the present application is shown.

[0025] Fig.13 A schematic structural diagram of a vehicle provided in an embodiment of the present application is shown.

[0026] Fig.14 A module block diagram of a computer-readable storage medium provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0027] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.

[0028] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.

[0029] In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.

[0030] With the continuous development and application of technologies such as cloud computing and the Internet of Things, massive amounts of data are constantly generated in the fields of production and operation, business activities, social life, etc. People are in the information age. Some countries have even elevated data management to the national strategic level, and many companies have also regarded data management as an important means to improve their competitiveness. It can be seen that the management of data is affecting people's work and life, especially the management of databases. In addition, existing embedded systems usually need to design a middle layer (Middle-Layer), which mainly serves the general business requests of the upper-layer APP (APPlication). For example, log management, IPC (Inter-Progress Communication) and database storage services. Compared with in-vehicle products, the read and write efficiency of the database and the use of resources are particularly important, so the requirements for the read and write of the database and the use of resources are small.

[0031] In addition, as the application version continues to iterate, the data structure of the table will also change continuously. In this change, the user's usage data is likely to be destroyed, and the existing technology cannot guarantee the reliability of data when managing the database. Among the existing database selections, Sqlite is more common, but Sqlite cannot meet customized requirements. When the data corresponding to one application changes, it will not notify other applications.

[0032] In order to solve the above technical problems, the applicant has proposed a data management method, device and electronic controller in the embodiment of the present application after long-term research. The data management method can improve the efficiency of data management by sending the changed data in the first process to the second process. Specifically, first determine whether the data contained in the target file has changed, wherein the target file belongs to the first process. When it is determined that the data contained in the target file has changed, obtain the key-value pair corresponding to the changed data, and then determine the second process associated with the first process, and finally send a data change instruction to the second process, wherein the data change instruction may include a key-value pair. When the present application determines that the target file located in the first process has changed, it can send the data change instruction to the second process, which can facilitate the user's management of the data and improve the efficiency of data management to a certain extent.

[0033] like Figure 1 As shown, Figure 1 The flowchart of the data management method provided by the embodiment of the present application is schematically shown. The method may include the following steps S110 to S130.

[0034] Step S110: Determine whether data included in a target file has changed, the target file belonging to the first process.

[0035] As a method, the embodiment of the present application can be applied to an electronic device, which can be configured with a data management module, which is mainly used to manage the database in the electronic device. In the implementation of the present application, the database can be a mapping table based on Key-Value (key-value pair), which is mainly stored in a file. In the version iteration, the user adds, modifies or deletes a Key, and the corresponding database file also needs to update this Key, and will not affect the Value corresponding to other Keys. The database file here can be used as the target file. It can be seen that the target file can include multiple different data, which can be vehicle-related control parameters, which can include temperature, humidity, version number, vehicle speed, and de-parameters.

[0036] As another way, the target file may belong to the first process, which may be a running activity of a program in a computer on a certain data set, and is the basic unit for resource allocation and scheduling of the system. In addition, the first process may also be a process corresponding to a preset application, that is, different applications may have different corresponding processes. For example, the process corresponding to the first application may be called the first process, and the process corresponding to the second application may be called the second process.

[0037] In some embodiments, the electronic device can obtain a target file corresponding to a target application, and then determine whether the data contained in the target file has changed. The target file can be composed of multiple key-value pairs. When one or more of the key-value pairs change, it can be determined that the data contained in the target file has changed. In an embodiment of the present application, determining whether the data contained in the target file has changed can be determining whether the key (Key) in the target file has changed, or determining whether the value (Value) in the target file has changed, or determining whether both the key (Key) and the value (Value) in the target file have changed, etc.

[0038] In other embodiments, the change in determining whether the data contained in the target file has changed may be a situation where a key value has been added to the target file, wherein the key value may be composed of a key Key and a value value. For example, if there is no Key3 in the original target file, and the user inputs Key3 through the application program interface, then it can be determined that the target file has changed, and the changed data is "Key3 has been added". In addition, the change may also be a situation where a key value has been reduced in the target file, or if there is Key4 in the original file, and the user deletes Key4 through the application program interface, then it can be determined that the target file has changed, and the changed data is "Key3 has been deleted". The change may also be a situation where a key value has been replaced in the target file, such as if there is Key5 in the original target file, and the user inputs Key6 through the application program, and replaces the Key5 with the Key6. The change in determining whether the data in the target file has changed may also be other situations, and the specific ones will not be described one by one here.

[0039] In summary, determining whether the data included in the target file has changed may be determining whether the target file belonging to the first process has changed. If it is determined that the data included in the target file has changed, the embodiment of the present application may obtain the key-value pair corresponding to the changed data, i.e., proceed to step S120. If it is determined that the target file has not changed, then re-monitoring whether the data included in the target file has changed. The embodiment of the present application may monitor once every preset time period, or may monitor once when it is determined that the data input by the user is received, etc.

[0040] Step S120: When the data included in the target file changes, a key-value pair corresponding to the changed data is obtained, and a second process associated with the first process is determined.

[0041] In some embodiments, when the electronic device determines that the data contained in the target file has changed, it can determine the key-value pair corresponding to the changed data, and the changed data can be the data that has changed in the target file. In addition, when determining that the data contained in the target file has changed, the embodiment of the present application can also first locate the position information of the changed data in the target file, and the changed data can be quickly located through the position information. By obtaining the key-value pair corresponding to the changed data, the embodiment of the present application can determine what the changed data is, such as the key Key may change, the value Value may change, or both the key Key and the value Value may change, etc.

[0042] In the embodiment of the present application, the changed data can be used as the target data. After obtaining the key-value pair corresponding to the target data, the electronic device can determine the second process associated with the first process, and then send the data change instruction to the second process, that is, enter step S130.

[0043] In some other embodiments, see Figure 2 , step S120 may include step S121 to step S122.

[0044] Step S121: Acquire historical data corresponding to each of the processes, and determine whether the process corresponding to each of the historical data is related to the first process.

[0045] In some implementations, the historical data corresponding to a process may include tag information input by a user, and the electronic device may obtain the tag information corresponding to each process, and the tag information may be description information input by a user, and the description information is used to describe information of other processes related to the first process. For example, the description information corresponding to process A is "processes related to this process include process B and process C", and in this case, process B and process C can be referred to as processes related to process A.

[0046] As a method, the second process associated with the first process may be the one that has a higher frequency of data interaction with the first process, or the importance between the first process and the second process, and the importance may be the influence of the second process on the first process, or the influence of the first process on the second process. In addition, the importance between the first process and the second process may also be set by the user according to his own needs. For example, if the user feels that the change of the data of the first process will greatly affect the operation of the second process, then user A can set the second process as a process associated with the first process.

[0047] As another way, the second process related to the first process in the electronic device can be one or more. When the second process related to the first process is one, the embodiment of the present application can directly send the data change instruction to the second process. When the second process related to the first process is multiple, the embodiment of the present application can also send the data change instruction to the second process at the same time.

[0048] As another way, when there are multiple second processes related to the first process, the embodiment of the present application can also first obtain the frequency of data interaction between each second process and the first process, and then sort the multiple processes from high to low according to the frequency of data interaction to obtain a frequency sorting result. Then, the data change instruction is sent to the second process according to the order of the frequency sorting result.

[0049] As another way, when there are multiple second processes related to the first process, the embodiment of the present application can also monitor which process among the multiple second processes is about to be run, and send the data change instruction to the second process when it is determined that the process is about to be run, and the time of the sending operation is between the time when it is determined that the target file in the first process has changed, and the time when the second process is first opened.

[0050] As an example, the first process and the second process may be processes corresponding to different applications. When it is determined that the data of the first application process has changed, the electronic device may determine the second application process associated with the first application process, and send the changed data to the second application process. By sending the data, the second application process may know which data of the first application process has changed, the location of the changed data in the target file, and what the data has changed to, etc.

[0051] Step S122: If relevant, the relevant process is taken as the second process.

[0052] In some implementations, when it is determined based on historical data that the corresponding process is related to the first process, the embodiment of the present application can use the related process as the second process. There can be multiple second processes, that is, when it is determined that there are multiple processes related to the first process, all of the multiple processes can be used as the second process.

[0053] In addition, when it is determined that there are multiple processes related to the first process, the embodiment of the present application can also determine whether there are weakly related processes among the multiple processes, and the weakly related process refers to a process that is related to the first process but has a lower degree of association. When it is determined that there are weakly related processes among the multiple processes, the embodiment of the present application can use other processes except the weakly related process as the second process, so as to reduce unnecessary power consumption caused by data transmission to the electronic device.

[0054] Step S130: Send a data change instruction to the second process, wherein the data change instruction includes the key-value pair.

[0055] In some embodiments, after determining the second process associated with the first process, the embodiment of the present application may send a data change instruction to the second process. The data change instruction may also be referred to as change prompt information, and the data change instruction is used to prompt the second process "which data of the first process has changed". In addition, the data change instruction may include a key-value pair of the changed data, and sending the key-value pair of the changed data to the second process may prompt the second process. In other words, the data change instruction may prompt the second process "which data of the first process has changed" and what the data has changed to.

[0056] In addition, the data change instruction may also include the address of the changed data in the target file. Through the data change instruction, the second process can quickly locate the location of the changed data, so that the second process can further monitor the changed data.

[0057] It should be noted that the changed data in the embodiment of the present application may include multiple sub-change data, and these sub-change data may be data that has changed within a preset time period, and the preset time period may be the time after the last time the data change instruction was sent. For example, the last time the data change instruction was sent was 14:00 on March 5, 2021, and the preset duration is 1 hour, that is, the embodiment of the present application counts the data that has changed from 14:00 on March 5, 2021 to 15:00 on March 5, 2021. It is confirmed that the keys of the data that have changed are Key1 and Key2. At this time, Key1 and Key2 can be collectively referred to as changed data.

[0058] In addition, the first process may be a process of interest to the second process, that is, the second process can achieve a preset goal by analyzing the data process of the first process. For example, the second process determines the user's usage habits by analyzing the usage data of the first process, and then recommends different advertisements to the user based on the usage habits.

[0059] The data management method provided by the embodiment of the present application can improve the efficiency of data management by sending the changed data in the first process to the second process. Specifically, first determine whether the data contained in the target file has changed, wherein the target file belongs to the first process, and when it is determined that the data contained in the target file has changed, obtain the key-value pair corresponding to the changed data, and then determine the second process associated with the first process, and finally send a data change instruction to the second process, wherein the data change instruction may include a key-value pair. When the present application determines that the target file located in the first process has changed, it can send the data change instruction to the second process, which can facilitate the user's management of the data and improve the efficiency of data management to a certain extent.

[0060] like Figure 3 As shown, another embodiment of the present application provides a data management method, which may include the following steps S210 to S250.

[0061] Step S210: Acquire a target file, and store the target file in the first partition of the disk.

[0062] As a method, after obtaining the target file, the embodiment of the present application can store the target file in the first partition of the disk, and then obtain the backup file based on the target file, and store the backup file in the second partition of the disk, that is, enter step S220.

[0063] Step S220: Acquire a backup file according to the target file, and store the backup file in the second partition of the disk.

[0064] In the embodiment of the present application, the disk of the electronic device can be dual-partitioned. In order to improve the reliability of data management, the database file corresponding to the electronic device can adopt a dual-partition design, that is, the target file can be protected by a dual-partition backup strategy. Figure 4 , obtaining a backup file according to the target file, and storing the backup file in the second partition of the disk may include steps S221 to S222.

[0065] Step S221: Determine whether the target file has changed.

[0066] Step S222: If the target file is changed, the changed data is determined, and the backup file is updated based on the changed data.

[0067] As a way to ensure data security, the embodiment of the present application stores the target file in partitions. When the target file stored in the first partition changes, the backup file stored in the second partition can also change accordingly. It can be seen that the data stored in the first partition and the data stored in the second partition are basically changed at the same time, so that when an abnormality occurs in the data in the first partition, the data stored in the second partition is the latest.

[0068] See also Figure 5 , obtaining a backup file according to the target file, and storing the backup file in the second partition of the disk may also include steps S223 to S224.

[0069] Step S223: Determine whether the target file is formatted.

[0070] In other implementations, when it is determined that an abnormality occurs in the target file, such as when the target file is formatted, the data in the first partition is lost. At this time, the backup file in the second partition can be used to restore the target file in the first partition, that is, entering step 224.

[0071] Step S224: if the target file is formatted, restoring the target file in the first partition according to the backup file in the second partition.

[0072] In order to more clearly understand the dual partition data protection strategy, the present application embodiment provides the following Figure 6 The process diagram is shown. Figure 6 The main database file in is the target file, and the standby database file can be a backup file. The target file and the backup file can be stored in partitions. When performing data management, the embodiment of the present application can monitor whether the main database file exists. When it is determined that the main database exists, the electronic device can further determine whether the standby database file exists. If both the main database file and the standby database file exist, the database file size is obtained to determine whether the structure of the database has changed. If it has changed, the main database file is traversed, the current configuration is synchronized, and the default configuration is updated. If the standby database file has not changed, the main and standby file handles are opened at the same time, and the initialization is completed.

[0073] In addition, through Figure 6 It can be known that when it is determined that the standby database file does not exist, the embodiment of the present application can recover the standby database from the main database file, that is, obtain the backup file according to the target file. When it is determined that the main database file does not exist, the embodiment of the present application can further determine whether the standby database file exists. If the standby database exists, the main database file is created and the main database is recovered from the standby database file. If the standby database does not exist, the main and standby database files are created based on the default data structure. Among them, the main database file does not exist usually because the data is formatted, or the data is in a read-only format, etc.

[0074] Step S230: Determine whether data included in a target file has changed, the target file belonging to the first process.

[0075] Step S240: When the data included in the target file changes, a key-value pair corresponding to the changed data is obtained, and a second process associated with the first process is determined.

[0076] Step S250: Send a data change instruction to the second process, wherein the data change instruction includes the key-value pair.

[0077] In some implementations, after obtaining the target file, the embodiment of the present application can read and write the data in the target file, and the reading and writing process can include a read-write lock or a mutex lock. In order to more clearly understand the reading and writing process, the embodiment of the present application provides the following Figure 7 and Figure 8 The flowchart shown in FIG. Figure 7 For the reading process, Figure 8 This is the writing process. Figure 7It can be known that in the process of reading a file, the embodiment of the present application can first determine whether the type and length of the target file meet the preset length, that is, check the type and length of the target file. When the check conditions are met, the file lock can be used for read lock and lock, and the thread lock can be locked. Then find the file offset corresponding to the key, adjust the file handle to point to the offset and copy the data, then unlock the file lock-read lock, and finally finish the reading.

[0078] In addition, through Figure 8 It can be known that in the process of writing a file, the embodiment of the present application can first determine whether the type and length of the target file meet the preset length, that is, check the type and length of the target file. When the check conditions are met, the file lock can be used to write and lock, and the thread lock can be locked. Then find the file offset corresponding to the Key, adjust the file handle to point to the offset and copy the data, then unlock the file lock-write lock, unlock the thread lock, and when it is determined that the content of the database (DB) has changed, initiate an IPC notification APP, and finally end the writing. It can be seen that when the content of the database is determined to have changed, the present application can use inter-process communication to send the changed data to other processes.

[0079] The data management method provided by the embodiment of the present application can improve the efficiency of data management by sending the data changed in the first process to the second process. Specifically, first determine whether the data contained in the target file has changed, wherein the target file belongs to the first process, when it is determined that the data contained in the target file has changed, obtain the key-value pair corresponding to the changed data, and then determine the second process associated with the first process, and finally send the data change instruction to the second process, wherein the data change instruction may include the key-value pair. When the present application determines that the target file located in the first process has changed, it can send the data change instruction to the second process, so that the user can manage the data conveniently, and the efficiency of data management can be improved to a certain extent. In addition, in order to improve the reliability of data management, the embodiment of the present application partitions the target file for storage, which can ensure the security of the database file to a certain extent.

[0080] like Fig. 9 As shown, another embodiment of the present application provides a data management method, which may include the following steps S310 to S360.

[0081] Step S310: receiving table configuration data, wherein the table configuration data includes a data name, a data type, a maximum length of stored data, and a default value.

[0082] As a method, the embodiment of the present application can receive table configuration data input by the user, and the table data is used to construct the structure of the database, that is, the embodiment of the present application can generate structured text through the table configuration data. Among them, the table configuration data may include data name, data type, maximum length of stored data and default value. The format of the table configuration data is as follows: Fig.10 As shown. Fig.10 It can be seen that the table configuration data consists of Key Name, Type, Max Size and Default Value, where Key Name is the data name, which can be the key of the corresponding data, and Key Name is unique; Type is the data type, which is the data type stored in the current entry; Max Size is the maximum length of the specified stored data, which is only valid for data types String or Binary, and for known data types, the length is fixed. For example, u32 is fixed to 4 bytes, and the user-configured Max Size is not effective; Default Value is the default value. When neither the target file nor the backup file exists, the embodiment of the present application will recreate the primary and backup files based on the default value.

[0083] In the embodiment of the present application, the default value can be set according to the empirical value, and the corresponding default value is different for different Key Names. For example, if the Key Name is the address of the NTP1 server, the corresponding default value is ntp1.aliyun.com; if the Key Name is the address of the NTP2 server, the corresponding default value is ntp2.aliyun.com.

[0084] Step S320: Generate a target table according to the table configuration data, use the target table as a target file, and store the target file in the first partition of the disk.

[0085] As a method, generating a target table according to the table configuration data, using the target table as a target file, and storing the target file in the first partition of the disk may include: determining whether a data creation instruction sent by an application program interface is received. If a data creation instruction sent by the application program interface is received, updating the target table using the data creation instruction to obtain the target file.

[0086] In the embodiment of the present application, the user can update the data table through different application program interfaces, and then obtain the target file. The query of the target file can adopt the KEY-VALUE method and is type-related. The type-related refers to the type of data, that is, the size of the space occupied by the data type in the database file is related, such as uint8_t is fixed to occupy 1 byte, while the string type is variable length. In order to better understand the application program interface, the present application provides a list of application program interfaces as shown in Table 1 below.

[0087] Table 1

[0088]

[0089] Table 1 shows different application interfaces, which may include an application read interface, an application write interface, and descriptions of different interfaces, wherein the description portion mainly describes the type of the interface. From Table 1, it can be seen that the type of the application interface in the embodiment of the present application can be char type, Unsigned char type, short type, int type, string type, and binary data, etc. These interfaces make the database operation interface more complete, and the database is based on file design and simple to operate, and can be easily ported to other projects.

[0090] Step S330: Acquire a backup file according to the target file, and store the backup file in the second partition of the disk.

[0091] Step S340: Determine whether data included in a target file has changed, the target file belonging to the first process.

[0092] Step S350: When the data included in the target file changes, a key-value pair corresponding to the changed data is obtained, and a second process associated with the first process is determined.

[0093] Step S360: Send a data change instruction to the second process, wherein the data change instruction includes the key-value pair.

[0094] The data management method provided by the embodiment of the present application can improve the efficiency of data management by sending the data changed in the first process to the second process. Specifically, first determine whether the data contained in the target file has changed, wherein the target file belongs to the first process, when it is determined that the data contained in the target file has changed, obtain the key-value pair corresponding to the changed data, and then determine the second process associated with the first process, and finally send the data change instruction to the second process, wherein the data change instruction may include the key-value pair. When the target file located in the first process is determined to have changed, the data change instruction can be sent to the second process, so that the user can manage the data conveniently, and the efficiency of data management can be improved to a certain extent. In addition, the embodiment of the present application can manage the database simply and effectively by utilizing a complete database interface, and the embodiment of the present application can realize the customized requirements for the database through the configuration table, which can improve the user's experience.

[0095] like Fig.11 As shown, the embodiment of the present application further provides a data management device 400 , which includes: a determination module 410 , an acquisition module 420 and a sending module 430 .

[0096] The determination module 410 is used to determine whether data included in a target file has changed, and the target file belongs to the first process.

[0097] The acquisition module 420 is used to acquire the key-value pair corresponding to the changed data when the data included in the target file changes, and determine the second process associated with the first process.

[0098] Furthermore, the acquisition module 420 is further configured to acquire the historical data corresponding to each of the processes, and determine whether the corresponding process is related to the first process according to each of the historical data; if so, the related process is used as the second process.

[0099] Furthermore, before determining whether the data contained in the target file has changed, the data management device 400 is also used to obtain the target file and store the target file in the first partition of the disk; obtain a backup file based on the target file, and store the backup file in the second partition of the disk.

[0100] Furthermore, after obtaining a backup file based on the target file and storing the backup file in the second partition of the disk, the data management device 400 is also used to determine whether the target file has changed; if the target file has changed, the changed data is determined, and the backup file is updated based on the changed data.

[0101] Furthermore, after obtaining a backup file based on the target file and storing the backup file in the second partition of the disk, the data management device 400 is also used to determine whether the target file is formatted; if the target file is formatted, the target file in the first partition is restored based on the backup file in the second partition.

[0102] Furthermore, the data management device 400 is also used to receive table configuration data, which includes data name, data type, maximum length of stored data and default value; generate a target table according to the table configuration data, and use the target table as a target file.

[0103] Furthermore, the data management device 400 is also used to determine whether a data creation instruction sent by the application program interface is received; if the data creation instruction sent by the application program interface is received, the target table is updated using the data creation instruction to obtain a target file.

[0104] The data management device provided by the embodiment of the present application can improve the efficiency of data management by sending the changed data in the first process to the second process. Specifically, first determine whether the data contained in the target file has changed, wherein the target file belongs to the first process. When it is determined that the data contained in the target file has changed, obtain the key-value pair corresponding to the changed data, and then determine the second process associated with the first process, and finally send a data change instruction to the second process, wherein the data change instruction may include a key-value pair. When the present application determines that the target file located in the first process has changed, it can send the data change instruction to the second process, which can facilitate the user's management of the data and improve the efficiency of data management to a certain extent.

[0105] like Fig.12 As shown, the embodiment of the present application also provides an electronic controller 500, which includes a processor 510 and a memory 520, and the memory 520 stores computer program instructions, and the computer program instructions are called by the processor 510 to execute the above-mentioned data management method.

[0106] The processor 510 may include one or more processing cores. The processor 510 uses various interfaces and lines to connect various parts of the entire electronic controller, and executes various functions of the electronic controller and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 520, and calling data stored in the memory 520. Optionally, the processor 510 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 510 can integrate one or a combination of a central processing unit 510 (CPU), a graphics processing unit 510 (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 510, but may be implemented separately through a communication chip.

[0107] The memory 520 may include a random access memory 520 (Random Access Memory, RAM), and may also include a read-only memory 520 (Read-Only Memory). The memory 520 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 520 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function, instructions for implementing the above-mentioned various method embodiments, etc. The data storage area may also store data created by the electronic controller during use, etc.

[0108] like Fig.13 As shown, the embodiment of the present application further provides a vehicle 600, which includes a vehicle body 610 and an electronic controller 620. The electronic controller 620 is disposed in the vehicle body 610, and the electronic controller 620 is used to manage data.

[0109] like Fig.14 As shown, an embodiment of the present application further provides a computer-readable storage medium 700, in which computer program instructions 710 are stored. The computer program instructions 710 can be called by a processor to execute the method described in the above embodiment.

[0110] The computer readable storage medium can be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium includes a non-transitory computer-readable storage medium. The computer readable storage medium 700 has storage space for program codes that execute any method steps in the above method. These program codes can be read from or written to one or more computer program products. The program code can be compressed, for example, in an appropriate form.

[0111] The above are only preferred embodiments of the present application, and are not intended to limit the present application in any form. Although the present application has been disclosed as above with preferred embodiments, it is not intended to limit the present application. Any technical personnel in the field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present application. However, any brief modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present application without departing from the content of the technical solution of the present application are still within the scope of the technical solution of the present application.

Claims

1. A data management method, characterized in that: The method comprises: Obtaining a target file, and storing the target file in a first partition of a disk; Acquire a backup file according to the target file, and store the backup file in the second partition of the disk; Determine whether the target file has changed; If the target file changes, determining the changed data, and updating the backup file based on the changed data; Determine whether data contained in a target file has changed, the target file belonging to the first process; When the data contained in the target file changes, obtaining a key-value pair corresponding to the changed data, and determining a second process associated with the first process; A data change instruction is sent to the second process so that the second process analyzes the changed data according to the data change instruction, wherein the data change instruction includes the key-value pair.

2. The method according to claim 1, characterized in that The method is applied to an electronic controller, the electronic controller includes a plurality of processes, and the determining of a second process associated with the first process includes: Acquire historical data corresponding to each of the processes, and determine, based on each of the historical data, whether the process corresponding to the process is related to the first process; If relevant, the relevant process is taken as the second process.

3. The method according to claim 1, characterized in that After obtaining a backup file according to the target file and storing the backup file in the second partition of the disk, the method further includes: Determine whether the target file is formatted; If the target file is formatted, the target file in the first partition is restored according to the backup file in the second partition.

4. The method according to claim 1, characterized in that: The obtaining of the target file comprises: Receive table configuration data, the table configuration data including data name, data type, maximum length of stored data and default value; A target table is generated according to the table configuration data, and the target table is used as a target file.

5. The method according to claim 4, characterized in that The step of generating a target table according to the table configuration data and using the target table as a target file includes: Determining whether a data creation instruction sent by an application program interface is received; If a data creation instruction sent by the application program interface is received, the target table is updated using the data creation instruction to obtain a target file.

6. A data management device, characterized in that: The device comprises: a determination module, used to determine whether data contained in a target file has changed, the target file belonging to the first process; an acquisition module, configured to acquire a key-value pair corresponding to the changed data when the data contained in the target file changes, and determine a second process associated with the first process; a sending module, configured to send a data change instruction to the second process, so that the second process analyzes the changed data according to the data change instruction, wherein the data change instruction includes the key-value pair; The data management device is also used to obtain a target file and store the target file in a first partition of the disk; obtain a backup file based on the target file and store the backup file in a second partition of the disk; determine whether the target file has changed; if the target file has changed, determine the changed data and update the backup file based on the changed data.

7. An electronic controller, characterized in that: include: one or more processors; Memory; One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, and the program codes can be called by a processor to execute the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Heterogeneous database synchronization method and application system

    CN104572672A

  • Repairing method and device of data partition, and terminal

    CN105868047A

  • Terminal data processing method and system

    CN106021027A

  • Data synchronization method and device

    CN106469158A

  • Configuration information updating method, system, client and server

    CN106990979A