Data synchronization method, apparatus, device, medium, and autonomous vehicle
Patent Information
- Application Number
- CN202311181576.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-13
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2043-09-13
AI Technical Summary
[0019] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description.
Smart Images

Figure CN117271658B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, specifically to the field of information flow technology, and in particular to data synchronization methods, apparatus, devices, media, and autonomous vehicles. Background Technology
[0002] In vehicular environments, distributed network communication is used between multiple domains and hosts. Common communication middleware includes open-source FastRTPS and commercial RTIDDS. In the standard DDS protocol, inter-process data synchronization includes PDP synchronization and EDP synchronization. By default, PDP synchronization uses multicast and creates built-in Readers and Writers to receive and send subsequent EDP data. EDP synchronization generally uses unicast, sending the application's Reader and Writer information to other processes. Summary of the Invention
[0003] This disclosure provides a data synchronization method, apparatus, device, medium, and autonomous vehicle that can effectively avoid data redundancy and save resources.
[0004] According to a first aspect of this disclosure, a data synchronization method is provided, comprising:
[0005] In response to receiving the first verification information of the process to be synchronized, the second verification information of the current process is obtained, wherein both the first verification information and the second verification information include the operation type and the data definition identifier;
[0006] Based on the first verification information, the target data identifier is determined from the data definition identifier of the second verification information;
[0007] Based on the target data identifier and the correspondence between the operation type of the first verification information and the operation type of the second verification information, data is synchronized between the process to be synchronized and the current process.
[0008] According to a second aspect of this disclosure, a data synchronization apparatus is provided, comprising:
[0009] The acquisition module is configured to acquire the second verification information of the current process in response to receiving the first verification information of the process to be synchronized, wherein both the first verification information and the second verification information include the operation type and the data definition identifier;
[0010] The determination module is configured to determine the target data identifier from the data definition identifier of the second verification information based on the first verification information;
[0011] The synchronization module is configured to synchronize data between the process to be synchronized and the current process based on the target data identifier and the correspondence between the operation type of the first verification information and the operation type of the second verification information.
[0012] According to a third aspect of this disclosure, an electronic device is provided, comprising:
[0013] At least one processor; and
[0014] A memory that is communicatively connected to at least one processor; wherein,
[0015] The memory stores instructions that can be executed by at least one processor, such that the instructions are executed by at least one processor to enable the at least one processor to perform the method provided in the first aspect.
[0016] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing a computer to perform the method provided in the first aspect.
[0017] According to a fifth aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method provided according to the first aspect.
[0018] According to a sixth aspect of this disclosure, an autonomous vehicle is provided, comprising any one of the following: the apparatus provided in the second aspect; the electronic device provided in the third aspect; and the storage medium provided in the fourth aspect.
[0019] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0020] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0021] Figure 1 An exemplary system architecture diagram is shown that the data synchronization method of this disclosure can be applied;
[0022] Figure 2 A flowchart illustrating one embodiment of the data synchronization method according to this disclosure is shown;
[0023] Figure 3 This diagram illustrates a flowchart of obtaining second verification information in the data synchronization method of this disclosure.
[0024] Figure 4 This diagram illustrates the data synchronization method used in this disclosure for inter-process data synchronization.
[0025] Figure 5 A schematic diagram of one embodiment of a data synchronization apparatus according to the present disclosure is shown;
[0026] Figure 6 A block diagram of an electronic device used to implement the data synchronization method of this disclosure is shown. Detailed Implementation
[0027] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0028] In existing multi-process communication scenarios, assuming there are three processes A, B, and C, and each process has 10 data definitions (with the data name uniformly designated as Topic), then:
[0029] 1) Process A sends information about its 10 topics to processes B and C respectively;
[0030] 2) Process B sends its 10 Topic information to processes A and C respectively;
[0031] 3) Process C sends its 10 Topic information to processes A and B respectively.
[0032] Without considering network packet loss and retransmission, or packet merging, each process can receive 20 topics, which is the sum of topic information from all other processes.
[0033] Taking process A as an example, when process A starts, it sends its own Topic information (which may correspond to a Reader or Writer, i.e., receiver or sender information) to processes B and C. After receiving the data, process B or process C will match it with its own Reader or Writer. That is, A's Reader can match B's Writer, and A's Writer can match B's Reader. The matched Readers and Writers can then perform cross-process unicast communication. Overall, the process first receives Reader and Writer information and then performs matching. For processes without matching relationships, the above data synchronization will result in wasted resources. In other words, if process A has a communication relationship with process B but not with process C, then the data sent to C is redundant data.
[0034] It is evident that this cross-process data synchronization scheme generates a large amount of redundant data, causing CPU resources to be occupied by this redundant data, thus significantly reducing response speed. For example, in the initial stage of process startup, the initial topic information synchronization will momentarily occupy a large amount of CPU resources, causing the initialization speed to slow down; at the same time, a large number of instantaneous data packets will occupy a large amount of bandwidth, causing useful data packets to not be delivered in time, resulting in slow system response; furthermore, after any process restarts, the synchronization data packets of each process need to be resent, and when there are many processes, the data volume is large, further aggravating network congestion, causing resource waste and low data synchronization efficiency.
[0035] Another existing technology is a static configuration method, in which all the information corresponding to the above 30 topics is fixed and written in a configuration file. The file is loaded at startup, which can effectively reduce redundant data packets. However, the problems are complicated configuration, poor scalability, difficulty in troubleshooting, and poor maintenance. It is not suitable for medium and large-scale projects.
[0036] This disclosure provides a data synchronization method that can be used for cross-process communication. Before sending the data to be synchronized, verification information is constructed based on the data operation type and data definition identifier. If the verification information of the process to be synchronized matches that of the current process, the corresponding data is then sent between the process to be synchronized and the current process to complete the data synchronization. This method can achieve accurate and efficient communication between multiple processes, reduce network bandwidth usage, reduce CPU usage, and improve data synchronization efficiency and system response efficiency.
[0037] For example, the data synchronization method provided in this disclosure can be applied to the basic functional modules of an autonomous driving operating system.
[0038] Figure 1 An exemplary system architecture 100 is shown, to which embodiments of the data synchronization method or data synchronization apparatus of this disclosure may be applied.
[0039] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102, and a server 103. The network 102 is used to provide a communication link between the terminal device 101 and the server 103, and may include various connection types, such as wired communication links, wireless communication links, or fiber optic cables, etc.
[0040] Users can use terminal device 101 to interact with server 103 via network 102 to receive or send information, etc. Various client applications can be installed on terminal device 101.
[0041] Terminal device 101 can be hardware or software. When terminal device 101 is hardware, it can be various electronic devices, including but not limited to independent electronic devices such as smartphones, tablets, laptops, and desktop computers, as well as vehicle-mounted terminals and other vehicle-attached electronic devices. When terminal device 101 is software, it can be installed in the aforementioned electronic devices. It can be implemented as multiple software programs or software modules, or as a single software program or software module. No specific limitations are made here.
[0042] Server 103 can be either hardware or software. When server 103 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When server 103 is software, it can be implemented as multiple software programs or software modules (e.g., used to provide distributed services), or as a single software program or software module. No specific limitations are made here.
[0043] The data synchronization method provided in this embodiment is generally executed by terminal device 101 or server 103, and correspondingly, the data synchronization device is generally installed in terminal device 101 or server 103.
[0044] It should be noted that, Figure 1 The number of terminal devices 101, network 102, and server 103 shown is merely illustrative. Depending on implementation needs, any number of terminal devices 101, network 102, and server 103 can be included.
[0045] Figure 2 A flow 200 of one embodiment of the data synchronization method according to this disclosure is shown, with reference to Figure 2 As shown, this data synchronization method includes the following steps:
[0046] Step S201: In response to receiving the first verification information of the process to be synchronized, obtain the second verification information of the current process, wherein both the first verification information and the second verification information include the operation type and the data definition identifier.
[0047] In this embodiment of the disclosure, the entity executing the data synchronization method is, for example, Figure 1 The terminal device 101 or server 103 shown, after receiving the first verification information of the process to be synchronized, obtains the second verification information of the current process so as to determine whether there is a communication relationship between the process to be synchronized and the current process by verifying the first verification information and the second verification information, so as to avoid wasting resources by sending the data to be synchronized when there is no communication relationship.
[0048] In this embodiment, both the first verification information and the second verification information include an operation type and a data definition identifier. The operation type includes data operation types, such as at least one of read, write, and erase operations. The data definition identifier is not the data content that needs to be synchronized between different processes, but rather a data definition information corresponding to the data to be synchronized, determined comprehensively based on the data source, data type, and data purpose, or a simplified identifier information of the data definition information, such as an array.
[0049] For example, the aforementioned execution entity needs to verify the operation type and data definition identifier in the first and second verification information. Only after both the operation type and data definition identifier have passed verification will the corresponding data synchronization be performed between the process to be synchronized and the current process. This effectively avoids data redundancy, saves resources, and improves data synchronization efficiency and response efficiency.
[0050] In some optional implementations of the embodiments of this disclosure, the process to be synchronized and the current process are different processes within the same vehicle or processes between different vehicles.
[0051] For example, the process to be synchronized and the current process in this embodiment of the disclosure can be different processes in the same autonomous vehicle, such as different basic functional modules.
[0052] Furthermore, the process to be synchronized and the current process in this embodiment can also be the same type of process or different types of processes between different vehicles. For example, between different vehicles owned or used by the same user, the user can perform data synchronization between the same process or different processes in the different vehicles based on the data synchronization method of this disclosure.
[0053] Step S202: Determine the target data identifier from the data definition identifier of the second verification information based on the first verification information.
[0054] In this embodiment of the disclosure, the entity executing the data synchronization method is, for example, Figure 1 The terminal device 101 or server 103 shown determines the target data identifier from the data definition identifier of the second verification information based on the first verification information.
[0055] For example, the aforementioned execution entity determines a target data definition identifier that matches the data definition identifier in the data definition identifier in the first verification information, that is, it determines that the current process and the process to be synchronized can have a communication relationship regarding the data corresponding to the target data identifier, and thus can perform data synchronization accordingly.
[0056] In some optional implementations of the embodiments of this disclosure, determining the target data identifier from the data definition identifier of the second verification information based on the first verification information includes: in response to the operation type of the first verification information corresponding to the operation type of the second verification information, comparing the data definition identifier of the first verification information with the data definition identifier of the second verification information; and determining the target data identifier from the data definition identifier of the second verification information based on the comparison result.
[0057] In this implementation, the execution entity first determines the operation type of the first verification information and the operation type of the second verification information. If the operation types of the two are corresponding, for example, one is sending and the other is receiving, the data definition identifier of the first verification information is compared with the data definition identifier of the second verification information. Then, based on the comparison result, the target data identifier that matches the current process and the process to be synchronized is determined from the data definition identifier of the second verification information.
[0058] If the executing entity confirms that there is only a correspondence between the operation type and the first verification information and the second verification information, but no matching data definition identifier, then it considers that the verification between the first verification information and the second verification information has failed. That is, the current process and the process with synchronization do not have an effective communication relationship and cannot complete data synchronization. Therefore, it does not send the data to be synchronized to avoid generating redundant data.
[0059] Correspondingly, if the executing entity confirms that the operation types of the first verification information and the second verification information do not correspond, for example, both parties are either senders or both are receivers, it can directly confirm that there is no communication relationship between the current process and the process to be synchronized, and data synchronization cannot be performed. Therefore, it will not send the data to be synchronized, thus avoiding the generation of redundant data.
[0060] Therefore, the execution entity determines that the process to be synchronized and the current process have a valid communication relationship and can perform data synchronization only after determining that the first verification information and the second verification information have a corresponding communication relationship in terms of operation type and that their data definition identifiers have the same target data identifier. In this case, when the process that is the sender sends the data to be synchronized, it can effectively ensure that the sent data is received and synchronized by the process that is the receiver, thus effectively avoiding the generation of redundant data.
[0061] In this implementation, after determining that the first verification information and the second verification information have a corresponding communication relationship in terms of operation type, the executing entity compares the data definition identifiers of the two to determine the target data identifier with a communication relationship. This can effectively verify the communication relationship between the process to be synchronized and the current process, avoid sending data without a communication relationship, thus avoiding redundant data, saving resources, and improving data synchronization efficiency.
[0062] Step S203: Synchronize data between the process to be synchronized and the current process according to the target data identifier and the correspondence between the operation type of the first verification information and the operation type of the second verification information.
[0063] In this embodiment of the disclosure, the entity executing the data synchronization method is, for example, Figure 1 The terminal device 101 or server 103 shown synchronizes data between the process to be synchronized and the current process based on the target data identifier determined in step S202 and the correspondence between the operation type of the first verification information and the operation type of the second verification information.
[0064] Based on the correspondence between the operation type of the first verification information and the operation type of the second verification information, the data transmission and reception relationship between the process to be synchronized and the current process can be determined, that is, whether to synchronize the data of the current process to the process to be synchronized, or to synchronize the data in the process to be synchronized to the current process.
[0065] For example, the operation types in the first and second verification information are data operation types, including read and write operations. For communication to occur between the process to be synchronized and the current process, the operation types of the first and second verification information must be read on one side and write on the other.
[0066] In some optional implementations of the embodiments of this disclosure, data synchronization between the process to be synchronized and the current process is performed based on the target data identifier and the correspondence between the operation type of the first verification information and the operation type of the second verification information. This includes: in response to the operation type of the first verification information including a read operation and the operation type of the second verification information including a write operation, sending the data information corresponding to the target data identifier in the current process to the process to be synchronized; and in response to the operation type in the first verification information including a write operation and the operation type of the second verification information including a read operation, receiving the data information corresponding to the target data identifier in the process to be synchronized.
[0067] In this implementation, when the execution entity determines that the operation type of the first verification information is a read operation and the operation type of the second verification information is a write operation, it determines that the communication relationship between the process to be synchronized and the current process is that the current process sends data to the process to be synchronized. In this case, the execution entity only sends the data information corresponding to the target data identifier in the current process to the process to be synchronized, thereby completing the data synchronization between the two processes.
[0068] Accordingly, when the execution entity determines that the operation type of the first verification information is a write operation and the operation type of the second verification information is a read operation, it determines that the communication relationship between the process to be synchronized and the current process is that the current process receives the data sent by the process to be synchronized. In this case, the execution entity only sends the data information corresponding to the target data identifier in the process to be synchronized to the current process. That is, the data received by the current process is the data information corresponding to the target data identifier, thereby completing the data synchronization between the two processes.
[0069] In this scheme, the executing entity synchronizes only the data related to the target data identifier between the process to be synchronized and the current process based on the correspondence between the operation types of the first verification information and the second verification information. This effectively avoids data redundancy caused by sending data that does not have a corresponding relationship or is not corresponding to the target data identifier, thus saving resources and improving data synchronization efficiency and communication efficiency.
[0070] Based on the correspondence between operation types, the aforementioned execution entity receives specific data information corresponding to the target data identifier from the process to be synchronized, or sends specific data information corresponding to the target data identifier in the current process to the process to be synchronized, thereby completing the data synchronization between the process to be synchronized and the current process, and avoiding the sending of data other than the data information corresponding to the target data identifier, thus avoiding redundant data.
[0071] The solution provided in this embodiment verifies the first verification information of the process to be synchronized and the second verification of the current process. After determining that the operation types of the first verification information and the second verification information correspond and have matching target data identifiers, the data information corresponding to the target data identifier is sent or received according to the correspondence between their operation types. This completes the effective synchronization of relevant data with communication relationships between the process to be synchronized and the current process, while avoiding data redundancy caused by sending irrelevant data, effectively saving resources, and improving data synchronization efficiency and response efficiency.
[0072] It should be noted that the acquisition, storage, and application of user personal information involved in the technical solution disclosed herein all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0073] In the data synchronization method provided in this disclosure, the first verification information of the process to be synchronized and the second verification information of the current process have the same information structure and are determined in the same way. The following description uses the second verification information as an example to illustrate the method for determining the verification information corresponding to each process in this scheme.
[0074] Figure 3 A schematic diagram of a process 300 for obtaining second verification information in the data synchronization method provided in this disclosure is shown. (Refer to...) Figure 3 As shown, the second verification information is obtained through the following steps:
[0075] Step S301: Determine the operation types included in the current process.
[0076] In this embodiment of the disclosure, the entity executing the data synchronization method is, for example, Figure 1 The terminal device 101 or server 103 shown can obtain all operation types included in the current process.
[0077] For example, the operation type is a data operation type, such as a read operation, a write operation, an erase operation, etc.
[0078] Step S302: Save the data definition identifiers corresponding to different operation types in the current process as different operation type arrays.
[0079] In this embodiment of the disclosure, the entity executing the data synchronization method is, for example, Figure 1 The terminal device 101 or server 103 shown here, for different operation types of the current process, respectively process and save the data definition identifiers corresponding to each operation type as the corresponding operation type array.
[0080] In some optional implementations, for each read operation type, the executing entity processes all data definition identifiers corresponding to the read operation type in the current process and then saves them together as an array of operation types corresponding to that read operation type.
[0081] In some optional implementations, for each write operation type, the execution entity processes the identifiers of all data in the current process that correspond to the write operation type separately, and then saves them together as an array of operation types corresponding to that write operation type.
[0082] In some optional implementations of the embodiments of this disclosure, the data definition identifier is obtained through the following steps: determining the data definition information included in the current process, wherein the data definition information includes at least one of data source, data type and data purpose; and generating a data definition identifier based on the data definition information.
[0083] In this implementation, the aforementioned execution entity obtains the data definition information of the current process, including information such as the data source, data type, and data purpose corresponding to each group of data under each operation type in the current process; then, based on the obtained data definition information, it generates the data definition identifier corresponding to its data.
[0084] Since each process contains a large amount of specific data, meaning the data itself consumes a lot of resources, in this implementation, the executing entity generates corresponding data definition identifiers based on data definition information such as data source, data type, and data purpose, rather than generating data definition identifiers for the specific data content. This effectively simplifies the data definition identifiers, thereby simplifying the verification information and enabling the verification of communication relationships between different processes with fewer communication resources.
[0085] In some optional implementations of the embodiments of this disclosure, generating a data definition identifier based on data definition information includes: performing a hash value calculation on the data definition information to obtain the data definition identifier.
[0086] In this implementation, the execution entity performs hash value calculation on the data definition information obtained based on the data source, data type, and data purpose to obtain the corresponding data definition hash value. Then, the execution entity can directly use the data definition hash value as the corresponding data definition identifier, or it can map the data definition hash value into an array or other form according to a preset mapping relationship to obtain the corresponding data definition identifier.
[0087] This solution simplifies the data definition identifier by calculating the hash value of the data definition information, thereby simplifying the data type array in the verification information, simplifying the verification information, and saving the communication resources occupied by the verification information.
[0088] Step S303: Determine all operation type arrays as the second verification information.
[0089] In this embodiment of the disclosure, the entity executing the data synchronization method is, for example, Figure 1 The terminal device 101 or server 103 shown merges all the operation type arrays saved in step S302 into a multi-dimensional array, which serves as the second verification information for the current process.
[0090] In the solution provided by this embodiment, the executing entity calculates a hash value for the data definition information corresponding to each operation type in the current process, generates a corresponding data definition identifier, and saves it as an operation type array for each operation type. The operation type arrays are then merged to determine the second verification information. This solution effectively simplifies the data definition identifier by hashing the data definition information and mapping it to an array, thereby simplifying the operation type array and the second verification information, reducing the communication resources occupied by sending verification information, and achieving the effects of saving resources and avoiding data redundancy.
[0091] In some optional implementations of the embodiments of this disclosure, both the first verification information and the second verification information are two-dimensional arrays, which include a one-dimensional read operation array and a one-dimensional write operation array.
[0092] For example, each process can include a data receiver (Reader) and a data sender (Writer). The aforementioned execution entities respectively save the data definition identifier corresponding to the Reader as a corresponding read operation array and the data definition identifier corresponding to the Writer as a corresponding write operation array. Then, the read operation array and the write operation array are merged into a two-dimensional array as the second verification information. The read operation array may include the identifier data of the data definition identifier corresponding to the write operation, and may also include the identifier data corresponding to the read operation; the write operation array may include the identifier data of the data definition identifier corresponding to the write operation, and may also include the identifier data corresponding to the write operation.
[0093] Taking the current process as an example, for the data definition information such as data type, data source, and data purpose of each Topic data corresponding to the Reader in the current process, the corresponding hash value is calculated respectively (other algorithms can also be used, which are not limited here). Then, according to the preset mapping relationship, it is mapped to a 1024-bit (128-byte) one-dimensional array to obtain a one-dimensional read operation array with dimension [1]
[128] . Correspondingly, for the data definition information such as data type, data source, and data purpose of each Topic data corresponding to the Writer, the corresponding hash value is also calculated and mapped to a 1024-bit one-dimensional array to obtain a one-dimensional write operation array with dimension [1]
[128] . Then, the read operation array and the write operation array are merged to obtain a two-dimensional array with dimension [2]
[128] , which is the second verification information of the current process. For example, hash_value[0] in dimension [2] represents the receiver Reader, and hash_value[1] represents the sender Writer; the data at the corresponding position in dimension
[128] represents the data definition identifier corresponding to each position.
[0094] In some optional implementations of the embodiments of this disclosure, determining the target data identifier from the data definition identifier of the second verification information based on the first verification information includes: in response to the data in the same bit of the read operation array of the second verification information being the same as the data in the write operation array of the first verification information being the same, determining the data definition identifier corresponding to the same bit as the target data identifier; in response to the data in the same bit of the write operation array of the second verification information being the same as the data in the read operation array of the first verification information being the same, determining the data definition identifier corresponding to the same bit as the target data identifier.
[0095] In this implementation, the execution entity compares the read operation array of the second verification information with the write operation array of the first verification information. During the comparison, data at the same position is compared. If the data at a certain position is the same, the data definition identifier corresponding to that position is determined as the target data identifier. Correspondingly, the execution entity also compares the write operation array of the second verification information with the read operation array of the first verification information, again comparing the same positions within the arrays. If the data at a certain position is the same, the data calibrator identifier corresponding to that position is determined as the target data identifier.
[0096] In one exemplary implementation, when the process to be synchronized comes online, it sends its first verification information to other processes via the built-in Writer of a communication protocol (e.g., PDP protocol), that is, it sends the read operation array and write operation array of the process to be synchronized to other processes. After receiving the information, the current process obtains its own second verification information and compares the read operation array in the first verification information with the write operation array in the second verification information, and compares the write operation array in the first verification information with the read operation array in the second verification information. If the data at a certain corresponding bit in the compared read operation array and write operation array is the same, it indicates that the two have matched successfully and data synchronization can be performed between them. For example, if bit 0 of the hash_value[0][0] of the current process is 1, that is, the 0th bit of its read operation array is 1, and bit 0 of the hash_value[1][0] of the process to be synchronized is also 1, that is, the 0th bit of its write operation array is also 1, then the 0th bits of the two processes match successfully, that is, the data definition identifier corresponding to the 0th bit is used as the target data identifier, and the detailed data information (such as the data content information of the Topic, the UDP receiving port information, etc.) corresponding to the target data identifier of the process to be synchronized can be sent to the position corresponding to the target data identifier of the current process to perform data synchronization.
[0097] In this implementation, the executing entity matches the read operation array of the current process with the write operation array of the process to be synchronized, and matches the write operation array of the current process with the read operation array of the process to be synchronized. Then, it determines the corresponding target data identifier based on the fact that the same data is in the same position in the array. This allows for the accurate search of the target data identifier that has a communication relationship, and the data that can be communicated is sent accurately, effectively avoiding data redundancy and reducing resource waste.
[0098] The data synchronization method provided in this disclosure performs matching verification on the verification information of the current process and the process to be synchronized before sending the data to be synchronized. When the operation types in the verification information of the two processes correspond and the same target data identifier exists, the data information corresponding to the target data identifier is synchronized between the current process and the process to be synchronized according to the correspondence between the operation types of the two processes. Other data information is not synchronized, thereby effectively avoiding data redundancy, reducing resource consumption, and improving data synchronization efficiency.
[0099] Figure 4 A schematic diagram illustrating inter-process data synchronization using the data synchronization method of this disclosure is shown. (Refer to...) Figure 4 As shown in this scheme, after process A, which is the process to be synchronized, comes online, it sends its verification information (01001110). After receiving the verification information, processes B and C match it with the verification information of their current processes, and determine whether they have a communication relationship with process A and the location of the data with the communication relationship based on the matching result. Based on the data location, they perform precise synchronization of the corresponding specific data, which effectively avoids the waste of resources and network congestion caused by sending data without a communication relationship.
[0100] As an implementation of the methods shown in the above figures, Figure 5 An embodiment of a data synchronization device according to the present disclosure is shown. This data synchronization device 500 is... Figure 2 Corresponding to the method embodiments shown, this device can be applied to various electronic devices.
[0101] Reference Figure 5 As shown, the data synchronization device 500 provided in this embodiment includes: an acquisition module 501, a determination module 502, and a synchronization module 503. The acquisition module 501 is configured to acquire second verification information of the current process in response to receiving first verification information of the process to be synchronized, wherein both the first and second verification information include an operation type and a data definition identifier. The determination module 502 is configured to determine a target data identifier from the data definition identifier of the second verification information based on the first verification information. The synchronization module 503 is configured to synchronize data between the process to be synchronized and the current process based on the target data identifier and the correspondence between the operation types of the first and second verification information.
[0102] The specific processing of the acquisition module 501, the determination module 502, and the synchronization module 503 in the data synchronization device 500 of this disclosure, and the resulting technical effects, can be found in the following references: Figure 2 The relevant descriptions of steps S201-S203 in the corresponding embodiments will not be repeated here.
[0103] In some optional implementations of the embodiments of this disclosure, the determining module 502 is further configured to: in response to the operation type of the first verification information corresponding to the operation type of the second verification information, compare the data definition identifier of the first verification information with the data definition identifier of the second verification information; and determine the target data identifier from the data definition identifier of the second verification information based on the comparison result.
[0104] In some optional implementations of the embodiments of this disclosure, the operation type includes read operation and write operation; and the synchronization module 503 is further configured to: in response to the first verification information including a read operation and the second verification information including a write operation, send the data information corresponding to the target data identifier in the current process to the process to be synchronized; in response to the first verification information including a write operation and the second verification information including a read operation, receive the data information corresponding to the target data identifier in the process to be synchronized.
[0105] In some optional implementations of the embodiments of this disclosure, the second verification information is obtained through the following steps: determining the data operation types included in the current process; saving the data definition identifiers corresponding to different data operation types in the current process as different operation type arrays; and determining all operation type arrays as the second verification information.
[0106] In the data synchronization apparatus of this disclosure, the specific processing of the step of obtaining the second verification information and its resulting technical effects can be referred to respectively. Figure 3 The relevant descriptions of steps 3201-S303 in the corresponding embodiments will not be repeated here.
[0107] In some optional implementations of the embodiments of this disclosure, the data definition identifier is obtained through the following steps: determining the data definition information included in the current process, wherein the data definition information includes at least one of data source, data type and data purpose; and generating a data definition identifier based on the data definition information.
[0108] In some optional implementations of the embodiments of this disclosure, generating a data definition identifier based on data definition information includes: performing a hash value calculation on the data definition information to obtain the data definition identifier.
[0109] In some optional implementations of the embodiments of this disclosure, both the first verification information and the second verification information are two-dimensional arrays, which include a one-dimensional read operation array and a one-dimensional write operation array.
[0110] In some optional implementations of the embodiments of this disclosure, the determining module is further configured to: determine the data definition identifier corresponding to the same bit in the read operation array of the second verification information and the write operation array of the first verification information as the target data identifier in response to the data in the same bit in the read operation array of the second verification information and the data in the same bit in the read operation array of the first verification information as the target data identifier in response to the data in the same bit in the write operation array of the second verification information and the data in the read operation array of the first verification information as the target data identifier in response to the data in the same bit in the read operation array of the first verification information.
[0111] In some optional implementations of the embodiments of this disclosure, the process to be synchronized and the current process are different processes within the same vehicle or processes between different vehicles.
[0112] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, a computer program product, and an autonomous vehicle. The autonomous vehicle may include at least one of the data synchronization device, electronic device, and readable storage medium provided in the above embodiments.
[0113] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0114] like Figure 6 As shown, device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 602 or a computer program loaded from storage unit 608 into random access memory (RAM) 603. RAM 603 may also store various programs and data required for the operation of device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.
[0115] Multiple components in device 600 are connected to I / O interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of monitors, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0116] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as data synchronization methods. For example, in some embodiments, the data synchronization method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the data synchronization method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the data synchronization method by any other suitable means (e.g., by means of firmware).
[0117] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0118] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0119] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0120] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0121] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0122] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0123] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0124] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A data synchronization method, comprising: In response to receiving the first verification information of the process to be synchronized, the second verification information of the current process is obtained. The first verification information and the second verification information are both two-dimensional arrays, and the two-dimensional arrays include a one-dimensional read operation array and a one-dimensional write operation array. The first verification information and the second verification information both include operation type and data definition identifier. Based on the first verification information, the target data identifier is determined from the data definition identifier of the second verification information; Based on the target data identifier and the correspondence between the operation type of the first verification information and the operation type of the second verification information, data is synchronized between the process to be synchronized and the current process; The step of determining the target data identifier from the data definition identifier of the second verification information based on the first verification information includes: In response to the fact that the data in the same bit of the read operation array of the second verification information is the same as the data in the write operation array of the first verification information, the data definition identifier corresponding to the same bit is determined as the target data identifier; In response to the fact that the data in the same bit of the write operation array of the second verification information is the same as the data in the read operation array of the first verification information, the data definition identifier corresponding to the same bit is determined as the target data identifier; The second verification information is obtained through the following steps: Determine the types of operations included in the current process; Determine the data definition information included in the current process, wherein the data definition information includes at least one of data source, data type, and data purpose; The data definition information is hashed to obtain the data definition identifier; In the current process, the data definition identifiers corresponding to different operation types are saved as different operation type arrays; The array of all operation types is determined as the second verification information.
2. The method according to claim 1, wherein, The step of determining the target data identifier from the data definition identifier of the second verification information based on the first verification information includes: In response to the fact that the operation type of the first verification information corresponds to the operation type of the second verification information, the data definition identifier of the first verification information is compared with the data definition identifier of the second verification information; Based on the comparison results, the target data identifier is determined from the data definition identifier of the second verification information.
3. The method according to claim 1, wherein, The operation types include read operations and write operations; as well as The step of synchronizing data between the process to be synchronized and the current process based on the target data identifier and the correspondence between the operation type of the first verification information and the operation type of the second verification information includes: In response to the operation type of the first verification information including a read operation and the operation type of the second verification information including a write operation, the data information corresponding to the target data identifier in the current process is sent to the process to be synchronized. In response to the operation type in the first verification information including a write operation and the operation type in the second verification information including a read operation, the data information corresponding to the target data identifier in the process to be synchronized is received.
4. The method according to any one of claims 1-3, wherein, The process to be synchronized and the current process are different processes within the same vehicle or processes between different vehicles.
5. A data synchronization device, comprising: The acquisition module is configured to acquire the second verification information of the current process in response to receiving the first verification information of the process to be synchronized. The first verification information and the second verification information are both two-dimensional arrays, the two-dimensional arrays include a one-dimensional read operation array and a one-dimensional write operation array, and both the first verification information and the second verification information include an operation type and a data definition identifier. The determination module is configured to determine the target data identifier from the data definition identifier of the second verification information based on the first verification information; The synchronization module is configured to synchronize data between the process to be synchronized and the current process based on the target data identifier and the correspondence between the operation type of the first verification information and the operation type of the second verification information; The determining module is configured as follows: In response to the fact that the data in the same bit of the read operation array of the second verification information is the same as the data in the write operation array of the first verification information, the data definition identifier corresponding to the same bit is determined as the target data identifier; In response to the fact that the data in the same bit of the write operation array of the second verification information is the same as the data in the read operation array of the first verification information, the data definition identifier corresponding to the same bit is determined as the target data identifier; The device further includes a generation module for generating second verification information, the generation module being configured to: Determine the types of operations included in the current process; Determine the data definition information included in the current process, wherein the data definition information includes at least one of data source, data type, and data purpose; The data definition information is hashed to obtain the data definition identifier; In the current process, the data definition identifiers corresponding to different operation types are saved as different operation type arrays; The array of all operation types is determined as the second verification information.
6. The apparatus according to claim 5, wherein, The determining module is configured as follows: In response to the fact that the operation type of the first verification information corresponds to the operation type of the second verification information, the data definition identifier of the first verification information is compared with the data definition identifier of the second verification information; Based on the comparison results, the target data identifier is determined from the data definition identifier of the second verification information.
7. The apparatus according to claim 5, wherein, The operation types include read operations and write operations; and The synchronization module is configured as follows: In response to the operation type of the first verification information including a read operation and the operation type of the second verification information including a write operation, the data information corresponding to the target data identifier in the current process is sent to the process to be synchronized. In response to the operation type in the first verification information including a write operation and the operation type in the second verification information including a read operation, the data information corresponding to the target data identifier in the process to be synchronized is received.
8. The apparatus according to any one of claims 5-7, wherein, The process to be synchronized and the current process are different processes within the same vehicle or processes between different vehicles.
9. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4.
10. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-4.
11. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-4.
12. An autonomous vehicle, comprising any one of the following: The apparatus according to any one of claims 5-8; The electronic device according to claim 9; The storage medium according to claim 10.
Citation Information
Patent Citations
Data synchronization method and device, and computer readable storage medium
CN108833512A