CN117271658A - Data synchronization method, device, equipment, medium and automatic driving vehicle - Google Patents

Data synchronization method, device, equipment, medium and automatic driving vehicle Download PDF

Info

Publication number
CN117271658A
CN117271658A CN202311181576.8A CN202311181576A CN117271658A CN 117271658 A CN117271658 A CN 117271658A CN 202311181576 A CN202311181576 A CN 202311181576A CN 117271658 A CN117271658 A CN 117271658A
Authority
CN
China
Prior art keywords
data
verification information
identifier
information
operation type
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311181576.8A
Other languages
Chinese (zh)
Inventor
董雷
林晓东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202311181576.8A priority Critical patent/CN117271658A/en
Publication of CN117271658A publication Critical patent/CN117271658A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Hardware Redundancy (AREA)

Abstract

The disclosure provides a data synchronization method, a data synchronization device, data synchronization equipment, data synchronization medium and an automatic driving vehicle, and relates to the technical field of computers, in particular to the technical field of information flow. The specific implementation scheme is as follows: responding to the received first verification information of the process to be synchronized, and obtaining second verification information of the current process, wherein the first verification information and the second verification information both comprise operation types and data definition identifiers; determining a target data identifier from the data definition identifiers of the second verification information according to the first verification information; and synchronizing data between the process to be synchronized and the current process according to the target data identifier and the corresponding relation between the operation type of the first verification information and the operation type of the second verification information. According to the scheme, before the data to be synchronized are sent, verification information of the related process is verified, data synchronization is carried out according to the verification result, bandwidth occupation is effectively reduced, CPU occupation is reduced, resources are saved, and meanwhile data synchronization efficiency is improved.

Description

Data synchronization method, device, equipment, medium and automatic driving vehicle
Technical Field
The present disclosure relates to the field of computer technology, and in particular, to the field of information flow technology, and more particularly, to a data synchronization method, apparatus, device, medium, and autonomous vehicle.
Background
In a vehicle-mounted environment, distributed network communication is adopted among multiple domains and multiple hosts, and common communication middleware such as open-source FastTPS communication, commercial RTIDDS communication and the like is adopted. In the standard DDS protocol, the inter-process data synchronization comprises PDP synchronization and EDP synchronization, and the default PDP synchronization adopts a multicast mode, and a built-in Reader, writer is created for receiving and transmitting subsequent EDP data; EDP synchronization is typically a unicast mode, and transmits Reader, writer information on the application side to other processes.
Disclosure of Invention
The disclosure provides a data synchronization method, a device, equipment, a medium and an automatic driving vehicle, which can effectively avoid data redundancy and save resources.
According to a first aspect of the present disclosure, there is provided a data synchronization method, including:
responding to the received first verification information of the process to be synchronized, and obtaining second verification information of the current process, wherein the first verification information and the second verification information both comprise operation types and data definition identifiers;
determining a target data identifier from the data definition identifiers of the second verification information according to the first verification information;
and synchronizing data between the process to be synchronized and the current process according to the target data identifier and the corresponding relation between the operation type of the first verification information and the operation type of the second verification information.
According to a second aspect of the present disclosure, there is provided a data synchronization apparatus comprising:
the acquisition module is configured to respond to the received first verification information of the process to be synchronized, and acquire second verification information of the current process, wherein the first verification information and the second verification information both comprise an operation type and a data definition identifier;
a determining module configured to determine a target data identifier from the data definition identifiers of the second authentication information according to the first authentication information;
and the synchronization module is configured to synchronize data between the process to be synchronized and the current process according to the target data identifier and the corresponding relation between the operation type of the first verification information and the operation type of the second verification information.
According to a third aspect of the present disclosure, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method provided in the first aspect.
According to a fourth aspect of the present disclosure there is provided a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method as provided in the first aspect.
According to a fifth aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method provided according to the first aspect.
According to a sixth aspect of the present disclosure, there is provided an autonomous vehicle comprising any one of: the apparatus provided in the second aspect; the electronic device provided in the third aspect; the storage medium provided in the fourth aspect.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 illustrates an exemplary system architecture diagram to which the data synchronization methods of the present disclosure may be applied;
FIG. 2 illustrates a flow diagram of one embodiment of a data synchronization method according to the present disclosure;
FIG. 3 is a schematic flow chart of obtaining second verification information in the data synchronization method of the present disclosure;
FIG. 4 illustrates a schematic diagram of synchronizing data between processes using the data synchronization method of the present disclosure;
FIG. 5 illustrates a schematic diagram of one embodiment of a data synchronization device according to the present disclosure;
fig. 6 shows a block diagram of an electronic device for implementing the data synchronization method of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the multi-process communication scenario in the prior art, assuming that there are three processes A, B, C, there are 10 data definitions (the data names are unified as Topic) in each process, then:
1) The A process sends 10 Topic information of the A process to B, C processes respectively;
2) The B process respectively sends 10 Topic information of the B process to A, C processes;
3) The C process sends its own 10 Topic messages to the A, B process, respectively.
Under the condition of not considering network packet loss retransmission and packet combination, each process can receive 20 topics, namely the sum of Topic information of all other processes.
Taking the process a as an example, when the process a starts, the Topic information in the process itself (the Topic may correspond to a Reader or Writer, that is, the information of the receiver or the sender) is sent to the process B and the process C, after receiving the data, the process B or the process C may match Reader, writer of the process, that is, the Reader of the process a may match the Writer of the process B, the Writer of the process a may match the Reader of the process B, and the matched Reader, writer may perform cross-process unicast communication. Generally, reader, writer information is received first and then matched. For the data synchronization without matching relationship, resource waste occurs. That is, if the A process has a communication relationship with the B process, but has no communication relationship with the C process, then the data sent to the C is redundant data.
It can be seen that this cross-process data synchronization scheme generates a large amount of redundant data, resulting in occupation of CPU resources by the large amount of redundant data, and thus greatly reducing the response speed. For example, in the initial stage of process starting, the information synchronization of Topic in the early stage can instantaneously occupy a large amount of CPU resources, so that the initialization speed is slow; meanwhile, a large amount of data packets are instantaneously transmitted, so that a large amount of bandwidth can be occupied, useful data packets cannot be timely transmitted, and the system response is slow; and after any process is restarted, the synchronous data packet of each process needs to be retransmitted once again, and when the processes are more, the data volume is larger, so that network congestion is further aggravated, and resource waste and low data synchronization efficiency are caused.
In the prior art, the static configuration mode is adopted, namely, all the information corresponding to the 30 topics is solidified and written in the configuration file, and the file is loaded when started, so that redundant data packets can be effectively reduced, but the problems of troublesome configuration, poor expandability, difficult problem investigation, difficult maintenance and inapplicability to medium and large projects are brought.
The data synchronization method can be used for cross-process communication, verification information is formed based on the operation type of the data and the data definition identification before the data to be synchronized is sent, corresponding data is sent between the process to be synchronized and the current process under the condition that the process to be synchronized is matched with the verification information of the current process, data synchronization is completed, accurate and efficient communication among multiple processes can be achieved, network bandwidth occupation is reduced, CPU occupation is reduced, and data synchronization efficiency and system response efficiency are improved.
Illustratively, the data synchronization method provided by the present disclosure may be applied to a basic functional module of an autopilot operating system.
Fig. 1 illustrates an exemplary system architecture 100 in which embodiments of the data synchronization method or data synchronization apparatus of the present disclosure may be applied.
As shown in fig. 1, 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, for example, a wired communication link, a wireless communication link, or an optical fiber cable, etc.
A user can interact with the server 103 through the network 102 using the terminal device 101 to receive or transmit information or the like. Various client applications may be installed on the terminal device 101.
The terminal device 101 may be hardware or software. When the terminal device 101 is hardware, it may be various electronic devices including, but not limited to, a smart phone, a tablet computer, a laptop portable computer, a desktop computer, and the like, and may also include additional electronic devices on a vehicle such as an in-vehicle terminal. When the terminal apparatus 101 is software, it may be installed in the above-described electronic apparatus. Which may be implemented as a plurality of software or software modules, or as a single software or software module. The present invention is not particularly limited herein.
The server 103 may be hardware or software. When the server 103 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the server 103 is software, it may be implemented as a plurality of software or software modules (for example, to provide distributed services), or may be implemented as a single software or software module. The present invention is not particularly limited herein.
The data synchronization method provided by the embodiments of the present disclosure is generally performed by the terminal device 101 or the server 103, and accordingly, the data synchronization apparatus is generally provided in the terminal device 101 or the server 103.
It should be noted that the numbers of the terminal device 101, the network 102, and the server 103 in fig. 1 are merely illustrative. There may be any number of terminal devices 101, networks 102, and servers 103, as desired for implementation.
Fig. 2 illustrates a flow 200 of one embodiment of a data synchronization method according to the present disclosure, with reference to fig. 2, comprising the steps of:
step S201, in response to receiving the first verification information of the process to be synchronized, obtaining second verification information of the current process, wherein the first verification information and the second verification information both comprise operation types and data definition identifiers.
In the embodiment of the present disclosure, an execution body of the data synchronization method, for example, the terminal device 101 or the server 103 shown in fig. 1, acquires second verification information of a current process after receiving first verification information of a process to be synchronized, so as to determine whether a communication relationship exists between the process to be synchronized and the current process by verifying the first verification information and the second verification information, thereby avoiding resource waste caused by sending the data to be synchronized under the condition of no communication relationship.
In an embodiment of the present disclosure, the first authentication information and the second authentication information each include an operation type and a data definition identification. Wherein the operation type includes a data operation type, such as at least one of a read operation, a write operation, an erase operation, and the like. The data definition identifier is not the data content to be synchronized among different processes, but the data definition information corresponding to the data to be synchronized, which is comprehensively determined according to the data source, the data type, the data use and the like corresponding to the data to be synchronized, or the identification information after simplifying the data definition information, for example, the identification information can be in an array form.
For example, for the operation type and the data definition identifier in the first verification information and the second verification information, the execution subject needs to verify, and corresponding data synchronization is performed between the process to be synchronized and the current frequent only after the operation type and the data definition identifier pass the verification. Therefore, the data redundancy is effectively avoided, the resources are saved, and the data synchronization efficiency and the response efficiency are improved.
In some optional implementations of embodiments of the present disclosure, the process to be synchronized and the current process are different processes within the same vehicle or processes between different vehicles.
Illustratively, the process to be synchronized and the current process in the embodiments of the present disclosure may be different processes in the same autonomous vehicle, e.g., different basic functional modules.
In addition, the process to be synchronized and the current process in the embodiment of the present disclosure may be the same kind of process or different kinds of process between different vehicles. For example, a user may synchronize data between the same process or different processes of different vehicles owned or used by the same user based on the data synchronization method of the present disclosure.
Step S202, determining a target data identification from the data definition identifications of the second verification information according to the first verification information.
In the embodiment of the present disclosure, the execution subject of the data synchronization method, such as the terminal device 101 or the server 103 shown in fig. 1, determines the target data identifier from the data definition identifiers of the second authentication information according to the first authentication information.
For example, the executing body determines a target data definition identifier matched with the first verification information from the data definition identifiers of the second verification information according to the data definition identifiers in the first verification information, namely, determines that the current process and the process to be synchronized can have a communication relationship with respect to the data corresponding to the target data identifier, so that data synchronization can be performed according to the data definition identifier.
In some optional implementations of embodiments of the present disclosure, determining, from the data definition identifiers of the second authentication information, the target data identifier according to the first authentication information includes: comparing the data definition identifier of the first verification information with the data definition identifier of the second verification information in response to the operation type of the first verification information corresponding to the operation type of the second verification information; and determining a target data identifier from the data definition identifiers of the second verification information according to the comparison result.
In this implementation manner, the executing body first determines an operation type of the first verification information and an operation type of the second verification information, and if the two operation types correspond to each other, for example, one of the two operation types is transmitting, the other one of the two operation types is receiving, and then compares a data definition identifier of the first verification information with a data definition identifier of the second verification information; and then determining a target data identifier matched with the current process and the process to be synchronized from the data definition identifiers of the second verification information according to the comparison result.
If the execution main body confirms that only the operation type corresponds between the first verification information and the second verification information and no matched data definition identifier exists, the execution main body considers that the verification between the first verification information and the second verification information is not passed, namely the current process and the synchronous process do not have an effective communication relationship, and data synchronization cannot be completed, so that data to be synchronized is not sent, and redundant data is avoided.
Correspondingly, if the execution main body confirms that the operation types of the first verification information and the second verification information are not corresponding, for example, both the execution main body and the execution main body are senders or receivers, the execution main body can directly confirm that the current process and the process to be synchronized have no communication relationship, data synchronization cannot be performed, further, the data to be synchronized is not sent, and redundant data is avoided.
Therefore, the execution main body determines that the process to be synchronized and the current process have effective communication relation after determining that the first verification information and the second verification information have corresponding communication relation in operation type and have the same target data identification, and can perform data synchronization, in this case, the process serving as a sender resends the data to be synchronized, and the sent data can be effectively ensured to be received and synchronized by the process serving as a receiver, so that redundant data is effectively avoided.
In the implementation manner, after determining that the first verification information and the second verification information have corresponding communication relations in operation types, the execution main body compares the data definition identifiers of the first verification information and the second verification information to determine the target data identifier with the communication relations, so that the communication relations between the process to be synchronized and the current process can be effectively verified, redundant data generated by sending the data under the condition of no communication relations is avoided, resources are saved, and the data synchronization efficiency is improved.
Step S203, according to the target data identification and the corresponding relation between the operation type of the first verification information and the operation type of the second verification information, the data is synchronized between the process to be synchronized and the current process.
In the embodiment of the present disclosure, the execution body of the data synchronization method, such as the terminal device 101 or the server 103 shown in fig. 1, synchronizes data between the process to be synchronized and the current process according to the target data identifier determined in step S202 in combination with the correspondence between the operation type of the first authentication information and the operation type of the second authentication information.
According to the corresponding relation between the operation type of the first verification information and the operation type of the second verification information, the data receiving and transmitting relation between the process to be synchronized and the current process can be determined, namely whether the data of the current process are synchronized to the process to be synchronized or whether the data in the process to be synchronized are synchronized to the current process is determined.
Illustratively, the operation type in the first authentication information and the second authentication information is a data operation type including a read operation and a write operation. If communication is to be performed between the process to be synchronized and the current process, the operation types of the first authentication information and the second authentication information are necessarily read operation on one hand and write operation on the other hand.
In some optional implementations of the embodiments of the present disclosure, synchronizing data between a process to be synchronized and a current process according to a target data identifier and a correspondence between an operation type of the first authentication information and an operation type of the second authentication information, includes: responding 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, and transmitting data information corresponding to the target data identifier in the current process to the process to be synchronized; and receiving data information corresponding to the target data identifier in the process to be synchronized in response to the fact that the operation type in the first verification information comprises a writing operation and the operation type in the second verification information comprises a reading operation.
In this implementation manner, when the executing body 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, that is, it is determined 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 executing body only sends data information corresponding to the target data identifier in the current process to the process to be synchronized, so as to complete data synchronization between the two processes.
Correspondingly, when the execution main body determines that the operation type of the first verification information is writing operation and the operation type of the second verification information is reading operation, namely, the communication relationship between the process to be synchronized and the current process is determined to be that the current process receives data sent by the process to be synchronized, in this case, the execution main body only sends data information corresponding to the target data identifier in the process to be synchronized to the current process, namely, the data received by the current process is the data information corresponding to the target data identifier, so that data synchronization between the two processes is completed.
In the scheme, the execution main body only synchronizes the process to be synchronized with the current process according to the corresponding relation of the operation types between the first verification information and the second verification information and the data related to the target data identification, so that the data redundancy caused by the fact that the corresponding relation is not available or the data corresponding to the non-target data identification is sent can be effectively avoided, resources are effectively saved, and the data synchronization efficiency and the communication efficiency are improved.
The execution main body receives specific data information corresponding to the target data identifier from the process to be synchronized according to the corresponding relation between operation types, or sends the specific data information corresponding to the target data identifier in the current process to be synchronized, so that data synchronization between the process to be synchronized and the current process is completed, and data except the data information corresponding to the target data identifier can be prevented from being sent to generate redundant data.
According to the scheme provided by the embodiment of the disclosure, the first verification information of the process to be synchronized and the second verification of the current process are verified, after the operation type between the first verification information and the second verification information is determined to be corresponding and have the matched target data identification, the data information corresponding to the target data identification is sent or received according to the corresponding relation between the operation types, so that the effective synchronization of the related data with the communication relation between the process to be synchronized and the current process is completed, meanwhile, the data redundancy generated by the fact that irrelevant data is sent is avoided, resources are effectively saved, and the data synchronization efficiency and the response efficiency are improved.
It should be noted that, in the technical solution of the present disclosure, the acquisition, storage, application, etc. of the related personal information of the user all conform to the rules of the related laws and regulations, and do not violate the popular regulations of the public order.
In the data synchronization method provided by the disclosure, the first verification information of the process to be synchronized is identical to the second verification information of the current process, and the information structures of the first verification information and the second verification information are identical, so that the determination modes are identical. The method for determining the verification information corresponding to each process in the present solution is described below by taking the second verification information as an example.
Fig. 3 is a schematic diagram illustrating a process 300 of obtaining second verification information in the data synchronization method provided in the present disclosure. Referring to fig. 3, the second authentication information is obtained by:
in step S301, the operation type included in the current process is determined.
In the embodiment of the present disclosure, the execution subject of the data synchronization method, such as the terminal device 101 or the server 103 shown in fig. 1, acquires all operation types included in the current process.
Illustratively, the operation type is a data operation type, which may be, for example, a read operation, a write operation, an erase operation, or the like.
Step S302, data definition identifiers corresponding to different operation types in the current process are respectively stored as different operation type arrays.
In the embodiment of the present disclosure, the execution body of the data synchronization method, for example, the terminal device 101 or the server 103 shown in fig. 1, processes and stores the data definition identifier corresponding to each operation type as a corresponding operation type array for different operation types of the current process.
In some optional implementations, for a read operation type, after the execution body processes all data definition identifiers corresponding to the read operation type in the current process respectively, the data definition identifiers are stored together as an operation type array corresponding to the read operation type.
In some alternative implementations, for a write operation type, the execution body processes all data definition identifiers corresponding to the write operation type in the current process respectively, and then stores the data definition identifiers together as an operation type array corresponding to the write operation type.
In some optional implementations of embodiments of the present disclosure, the data definition identifier is obtained by: determining data definition information included in the current process, wherein the data definition information comprises at least one of a data source, a data type and a data use; and generating a data definition identifier according to the data definition information.
In this implementation manner, the executing body obtains data definition information included in the current process, including obtaining information such as a data source, a data type, a data use, and the like corresponding to each group of data under each operation type in the current process; and then generating a data definition identifier corresponding to the data according to the acquired data definition information.
Because the specific data content of each process is more, namely the data occupies more resources, in the implementation manner, the execution main body generates the corresponding data definition identifier according to the data definition information such as the data source, the data type, the data use and the like, rather than generating the data definition identifier for the specific data content, the data definition identifier can be effectively simplified, so that the verification information is simplified, and the verification of the communication relationship among different processes by using fewer communication resources is realized.
In some optional implementations of embodiments of the present disclosure, generating the data definition identifier from the data definition information includes: and carrying out hash value calculation on the data definition information to obtain a data definition identifier.
In this implementation manner, the execution body performs hash value calculation on the data definition information obtained according to the data source, the data type, the data use, and the like, to obtain the corresponding data definition hash value. Then, the execution body may directly use the data definition hash value as a corresponding data definition identifier, or may map the data definition hash value into a plurality of groups or other forms according to a preset mapping relationship, so as to obtain the corresponding data definition identifier.
According to the scheme, the hash value of the data definition information is calculated, so that the data definition identification is further simplified, the effect of simplifying the data type array in the verification information is achieved, the verification information is simplified, and the communication resources occupied by the verification information are saved.
Step S303, determining the whole operation type array as second verification information.
In the embodiment of the present disclosure, the execution body of the data synchronization method, such as the terminal device 101 or the server 103 shown in fig. 1, combines all the operation type combinations saved in step S302 into a multidimensional array as the second verification information of the current process.
In the scheme provided by the embodiment of the disclosure, the execution body calculates hash values of the data definition information corresponding to each operation type according to each operation type in the current process to generate corresponding data definition identifiers, so as to respectively store the data definition identifiers as operation type arrays corresponding to each operation type, and the operation type arrays are combined and determined to be second verification information. According to the scheme, the data definition information is subjected to hash calculation and mapped into the array, so that the data definition identification is effectively simplified, the operation type array and the second verification information are simplified, communication resources occupied by sending the verification information are reduced, and the effects of saving resources and avoiding data redundancy are achieved.
In some optional implementations of embodiments of the present disclosure, the first verification information and the second verification information are two-dimensional arrays, the two-dimensional arrays including a one-dimensional read operation array and a one-dimensional write operation array.
Illustratively, each process may include a data receiving party Reader and a data sending party Writer, where the execution subject stores a corresponding read operation array for a data definition identifier corresponding to the Reader and a corresponding write operation array for a data definition identifier corresponding to the Writer respectively; the read operation array and the write operation array are then combined into a two-dimensional array as second verification information. The read operation array may include identification data of a data definition identifier corresponding to the write operation, and may further include identification data corresponding to the read operation; the write operation array may include identification data of a data definition identifier corresponding to the write operation, and may further include identification data corresponding to the write operation.
Taking the current process as an example, respectively calculating corresponding hash values (other algorithms can be adopted, and the method is not limited here) according to data definition information such as data types, data sources, data purposes and the like corresponding to each Topic data corresponding to a Reader in the current process, and then mapping the hash values to a 1024-bit (128-byte) one-dimensional array according to a preset mapping relation to obtain a one-dimensional read operation array with the dimension of [1] [128 ]; correspondingly, for data definition information such as data types, data sources, data purposes and the like corresponding to each Topic data corresponding to the Writer, corresponding hash values are calculated respectively and then mapped to a 1024-bit one-dimensional array to obtain a one-dimensional write operation array with the dimension of [1] [128 ]; and combining the read operation array and the write operation array to obtain a two-dimensional array with the dimension of [2] [128], namely the second verification information of the current process. Illustratively, hash_value [0] in dimension [2] represents the receiver Reader, and hash_value [1] represents the sender Writer; the data for the corresponding location of dimension 128 represents the data definition identifier for each location.
In some optional implementations of embodiments of the present disclosure, determining, from the data definition identifiers of the second authentication information, the target data identifier according to the first authentication information includes: responding to the fact that the read operation array of the second verification information is the same as the data of the same bit in the write operation array of the first verification information, and determining the data definition identifier corresponding to the same bit as the target data identifier; and in response to the write operation array of the second verification information being the same as the data of the same bit in the read operation array of the first verification information, determining the data definition identifier corresponding to the same bit as the target data identifier.
In this implementation manner, the executing body compares the read operation array of the second verification information with the write operation array of the first verification information, and in the comparison process, compares the data on the same bit, and if the data on some same bit is the same, determines the data definition identifier corresponding to the same bit as the target data identifier. Correspondingly, the execution main body also compares the write operation array of the second verification information with the read operation array of the first verification information, and compares the same bits in the arrays, if the data on the same bit is the same, the data calibration instrument identifier corresponding to the same bit is determined to be the target data identifier.
In one exemplary implementation, when a process to be synchronized is online, it sends the first verification information of the process to be synchronized to other processes through a built-in Writer of a communication protocol (such as PDP protocol), that is, sends a read operation array and a write operand array of the process to be synchronized to other processes; after the current process receives the second verification information of the current process, the read operation array in the first verification information is compared with the write operation array in the second verification information, and the write operation array in the first verification information is compared with the read operation array in the second verification information; if the data on the same bit in the read operation array and the write operation array which are compared with each other are the same, the data synchronization can be carried out between the read operation array and the write operation array if the data on the same bit is successfully matched with the read operation array and the write operation array. For example, bit0 of the hash_value [0] [0] of the current process is 1, that is, bit0 of the read operation array thereof is 1, bit0 of the hash_value [1] [0] of the process to be synchronized is also 1, that is, bit0 of the write operation array thereof is also 1, at this time, the matching of the bit0 of the two is successful, that is, the data definition identifier corresponding to the bit0 is taken as the target data identifier, and detailed data information (for example, data content information of Topic, UDP receiving port information and the like) 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 for data synchronization.
In the implementation manner, the execution main body matches the read operation array of the current process with the write operation array of the process to be synchronized, matches the write operation array of the current process with the read operation array of the process to be synchronized, and then determines the corresponding target data identification according to the same data in the same bits in the arrays, so that the target data identification with the communication relationship is accurately searched, the data capable of being communicated is accurately sent, the data redundancy is effectively avoided, and the resource waste is reduced.
According to the data synchronization method provided by the embodiment of the disclosure, before the data to be synchronized is sent, the verification information of the current process and the verification information of the process to be synchronized are matched and verified, when the operation types in the verification information of the current process and the verification information of the process to be synchronized are corresponding 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 corresponding relation between the operation types of the two operation types, and other data information is not synchronized, so that data redundancy is effectively avoided, resource occupation is reduced, and data synchronization efficiency is improved.
FIG. 4 illustrates a schematic diagram of synchronizing data between processes using the data synchronization method of the present disclosure. Referring to fig. 4, in this scheme, after a process a, which is a process to be synchronized, is online, verification information (01001110) of the process a is sent out, after the verification information is received, a process B and a process C match with verification information of their current process, determine whether each process a has a communication relationship and a data location having a communication relationship according to a matching result, and perform accurate synchronization of corresponding specific data according to the data location, so as to effectively avoid resource waste and network congestion caused by that data without a communication relationship is also sent.
As an implementation of the method shown in the above figures, fig. 5 shows an embodiment of a data synchronization device according to the present disclosure. The data synchronization device 500 corresponds to the method embodiment shown in fig. 2, and the device can be applied to various electronic devices.
Referring to fig. 5, a data synchronization apparatus 500 provided in an embodiment of the present disclosure includes: an acquisition module 501, a determination module 502 and a synchronization module 503. Wherein the obtaining module 501 is configured to obtain, in response to receiving first verification information of a process to be synchronized, second verification information of a current process, where the first verification information and the second verification information both include an operation type and a data definition identifier; the determining module 502 is configured to determine a target data identity from the data definition identities of the second authentication information according to the first authentication information; the synchronization module 503 is configured to 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 authentication information and the operation type of the second authentication information.
In the data synchronization device 500 of the embodiment of the present disclosure, the specific processes of the acquiring module 501, the determining module 502 and the synchronizing module 503 and the technical effects thereof may refer to the related descriptions of steps S201 to S203 in the corresponding embodiment of fig. 2, and are not repeated herein.
In some optional implementations of embodiments of the present disclosure, the determination module 502 is further configured to: comparing the data definition identifier of the first verification information with the data definition identifier of the second verification information in response to the operation type of the first verification information corresponding to the operation type of the second verification information; and determining a target data identifier from the data definition identifiers of the second verification information according to the comparison result.
In some alternative implementations of embodiments of the present disclosure, the types of operations include read operations and write operations; and the synchronization module 503 is further configured to: responding 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, and transmitting data information corresponding to the target data identifier in the current process to the process to be synchronized; and receiving data information corresponding to the target data identifier in the process to be synchronized in response to the fact that the operation type in the first verification information comprises a writing operation and the operation type in the second verification information comprises a reading operation.
In some optional implementations of embodiments of the present disclosure, the second authentication information is obtained by: determining the data operation type included in the current process; respectively storing data definition identifiers corresponding to different data operation types in the current process as different operation type arrays; all operation type arrays are determined as second authentication information.
In the data synchronization device of the embodiment of the present disclosure, the specific processing of the step of obtaining the second verification information and the technical effects thereof may refer to the description of steps 3201 to S303 in the corresponding embodiment of fig. 3, and are not described herein.
In some optional implementations of embodiments of the present disclosure, the data definition identifier is obtained by: determining data definition information included in the current process, wherein the data definition information comprises at least one of a data source, a data type and a data use; and generating a data definition identifier according to the data definition information.
In some optional implementations of embodiments of the present disclosure, generating the data definition identifier from the data definition information includes: and carrying out hash value calculation on the data definition information to obtain a data definition identifier.
In some optional implementations of embodiments of the present disclosure, the first verification information and the second verification information are two-dimensional arrays, the two-dimensional arrays including a one-dimensional read operation array and a one-dimensional write operation array.
In some optional implementations of embodiments of the present disclosure, the determining module is further configured to: responding to the fact that the read operation array of the second verification information is the same as the data of the same bit in the write operation array of the first verification information, and determining the data definition identifier corresponding to the same bit as the target data identifier; and in response to the write operation array of the second verification information being the same as the data of the same bit in the read operation array of the first verification information, determining the data definition identifier corresponding to the same bit as the target data identifier.
In some optional implementations of embodiments of the present disclosure, the process to be synchronized and the current process are different processes within the same vehicle or processes between different vehicles.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, a computer program product, and an autonomous vehicle. Wherein, the automatic driving vehicle can comprise at least one of the data synchronization device, the electronic equipment and the readable storage medium provided by the above embodiment.
Fig. 6 illustrates a schematic block diagram of an example electronic device 600 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 6, the apparatus 600 includes a computing unit 601 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 602 or a computer program loaded from a storage unit 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 may also be stored. The computing unit 601, ROM 602, and RAM 603 are connected to each other by a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Various components in the device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, mouse, etc.; an output unit 607 such as various types of displays, speakers, and the like; a storage unit 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The computing unit 601 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 601 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized 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 respective methods and processes described above, such as a data synchronization method. For example, in some embodiments, the data synchronization method may be implemented as a computer software program tangibly embodied on 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 onto the device 600 via the ROM 602 and/or the communication unit 609. When a computer program is loaded into RAM 603 and executed by 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 in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These 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 the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel or sequentially or in a different order, provided that the desired results of the technical solutions of the present disclosure are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (22)

1. A method of data synchronization, comprising:
acquiring second verification information of a current process in response to receiving first verification information of a process to be synchronized, wherein the first verification information and the second verification information both comprise an operation type and a data definition identifier;
determining a target data identifier from the data definition identifiers of the second verification information according to the first verification information;
and synchronizing data between the process to be synchronized and the current process according to the target data identifier and the corresponding relation between the operation type of the first verification information and the operation type of the second verification information.
2. The method of claim 1, wherein the determining the target data identification from the data definition identifications of the second authentication information according to the first authentication information comprises:
comparing the data definition identifier of the first verification information with the data definition identifier of the second verification information in response to the operation type of the first verification information corresponding to the operation type of the second verification information;
and determining a target data identifier from the data definition identifiers of the second verification information according to the comparison result.
3. The method of claim 1, wherein the operation types include read operations and write operations; and
the step of synchronizing data between the process to be synchronized and the current process according to the target data identifier and the corresponding relation between the operation type of the first verification information and the operation type of the second verification information comprises the following steps:
responding 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, and sending data information corresponding to the target data identifier in the current process to the process to be synchronized;
And receiving data information corresponding to the target data identifier in the process to be synchronized in response to the fact that the operation type in the first verification information comprises a writing operation and the operation type in the second verification information comprises a reading operation.
4. A method according to any of claims 1-3, wherein the second authentication information is obtained by:
determining the operation type included in the current process;
respectively storing data definition identifiers corresponding to different operation types in the current process as different operation type arrays;
and determining the whole operation type array as the second verification information.
5. The method of claim 4, wherein the data definition identifier is obtained by:
determining data definition information included in the current process, wherein the data definition information comprises at least one of a data source, a data type and a data use;
and generating a data definition identifier according to the data definition information.
6. The method of claim 4, wherein the generating a data definition identifier from the data definition information comprises:
and carrying out hash value calculation on the data definition information to obtain the data definition identifier.
7. The method of claim 4, wherein the first verification information and the second verification information are each two-dimensional arrays including a one-dimensional read operation array and a one-dimensional write operation array.
8. The method of claim 7, wherein the determining, from the data definition identifications of the second authentication information, the target data identification according to the first authentication information comprises:
determining a data definition identifier corresponding to the same bit as the target data identifier in response to the read operation array of the second verification information being the same as the data of the same bit in the write operation array of the first verification information;
and in response to the write operation array of the second verification information being identical to the data of the same bit in the read operation array of the first verification information, determining the data definition identifier corresponding to the same bit as the target data identifier.
9. The method according to any of claims 1-8, wherein the process to be synchronized and the current process are different processes within the same vehicle or processes between different vehicles.
10. A data synchronization apparatus, comprising:
the acquisition module is configured to respond to receiving first verification information of a process to be synchronized, and acquire second verification information of a current process, wherein the first verification information and the second verification information both comprise an operation type and a data definition identifier;
A determining module configured to determine a target data identifier from the data definition identifiers of the second authentication information according to the first authentication information;
and the synchronization module is configured to synchronize data between the process to be synchronized and the current process according to the target data identifier and the corresponding relation between the operation type of the first verification information and the operation type of the second verification information.
11. The apparatus of claim 10, wherein the determination module is configured to:
comparing the data definition identifier of the first verification information with the data definition identifier of the second verification information in response to the operation type of the first verification information corresponding to the operation type of the second verification information;
and determining a target data identifier from the data definition identifiers of the second verification information according to the comparison result.
12. The apparatus of claim 10, wherein the operation types include read operations and write operations; and
the synchronization module is configured to:
responding 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, and sending data information corresponding to the target data identifier in the current process to the process to be synchronized;
And receiving data information corresponding to the target data identifier in the process to be synchronized in response to the fact that the operation type in the first verification information comprises a writing operation and the operation type in the second verification information comprises a reading operation.
13. The apparatus of any of claims 10-12, wherein the second authentication information is obtained by:
determining the data operation type included in the current process;
respectively storing data definition identifiers corresponding to different data operation types in the current process as different operation type arrays;
and determining the whole operation type array as the second verification information.
14. The apparatus of claim 13, wherein the data definition identifier is obtained by:
determining data definition information included in the current process, wherein the data definition information comprises at least one of a data source, a data type and a data use;
and generating a data definition identifier according to the data definition information.
15. The apparatus of claim 13, wherein the generating a data definition identifier from the data definition information comprises:
and carrying out hash value calculation on the data definition information to obtain the data definition identifier.
16. The apparatus of claim 13, wherein the first verification information and the second verification information are each a two-dimensional array comprising a one-dimensional array of read operations and a one-dimensional array of write operations.
17. The apparatus of claim 16, wherein the determination module is configured to:
determining a data definition identifier corresponding to the same bit as the target data identifier in response to the read operation array of the second verification information being the same as the data of the same bit in the write operation array of the first verification information;
and in response to the write operation array of the second verification information being identical to the data of the same bit in the read operation array of the first verification information, determining the data definition identifier corresponding to the same bit as the target data identifier.
18. The apparatus of any of claims 10-17, wherein the process to be synchronized and the current process are different processes within a same vehicle or processes between different vehicles.
19. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-9.
20. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-9.
21. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-9.
22. An autonomous vehicle comprising any of the following:
the apparatus of any one of claims 10-18;
the electronic device of claim 19;
the storage medium of claim 20.
CN202311181576.8A 2023-09-13 2023-09-13 Data synchronization method, device, equipment, medium and automatic driving vehicle Pending CN117271658A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311181576.8A CN117271658A (en) 2023-09-13 2023-09-13 Data synchronization method, device, equipment, medium and automatic driving vehicle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311181576.8A CN117271658A (en) 2023-09-13 2023-09-13 Data synchronization method, device, equipment, medium and automatic driving vehicle

Publications (1)

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

Family

ID=89205479

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311181576.8A Pending CN117271658A (en) 2023-09-13 2023-09-13 Data synchronization method, device, equipment, medium and automatic driving vehicle

Country Status (1)

Country Link
CN (1) CN117271658A (en)

Similar Documents

Publication Publication Date Title
CN110365491B (en) Service processing method, device, equipment, storage medium and data sharing system
US10116746B2 (en) Data storage method and network interface card
CN108696589B (en) Block chain data transmission method, device, equipment and storage medium
EP3447631A1 (en) Writing trajectory synchronization method and system for multiple clients
CN111510466B (en) Data updating method and device for client, electronic equipment and readable medium
US10621124B2 (en) Method, device and computer program product for enabling SR-IOV functions in endpoint device
CN105302486A (en) Virtual offline desktop block device storage synchronization method
CN116070285A (en) Asynchronous consensus method, device, server and medium based on Bayesian fault tolerance
CN109714337B (en) Data encryption transmission method and equipment
CN111416851A (en) Method for session synchronization among multiple load balancers and load balancer
CN117271658A (en) Data synchronization method, device, equipment, medium and automatic driving vehicle
CN113420275B (en) Data connection processing method, related device and computer program product
US20170169239A1 (en) Method for file synchronization, the receiver equipment and systems
CN109309583B (en) Information acquisition method and device based on distributed system, electronic equipment and medium
CN113726885A (en) Method and device for adjusting flow quota
CN111416852A (en) Method for session synchronization among multiple load balancers and load balancer
CN113691937A (en) Method for determining position information, cloud mobile phone and terminal equipment
CN113765972A (en) Data request response method, device, system, server and storage medium
CN114202947B (en) Internet of vehicles data transmission method and device and automatic driving vehicle
CN115118727B (en) Data transmission method, device, equipment and storage medium of distributed computing architecture
US11973744B2 (en) Systems and methods for establishing consensus in distributed communications
CN114793234B (en) Message processing method, device, equipment and storage medium
CN109150612B (en) Detection method based on distributed system for unmanned vehicle and electronic equipment
CN109714410B (en) Data transmission method, device, equipment and storage medium
WO2021189253A1 (en) Data transmission method and apparatus

Legal Events

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