Data redundancy protection method, device, computer equipment and storage medium
By obtaining the Internet Protocol address and port information of the programming interface in vehicle communication and using time stamp and reception time for data redundancy protection, the problem of low reliability of vehicle communication data transmission is solved, and data integrity and timeliness are guaranteed when the physical link is disconnected.
Patent Information
- Application Number
- CN202211203050.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-29
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2042-09-29
AI Technical Summary
In-vehicle communication data is difficult to transmit when the physical link is disconnected, resulting in the loss of important data. In addition, delays are likely to occur when the physical link is switched, reducing the reliability of data transmission.
By obtaining the Internet Protocol address and port information of each programming interface, and using the time identifier and receiving time to perform redundant protection on the data, it ensures the synchronous transmission and repeated data processing of data across multiple physical links.
It improves the reliability of vehicle communication data transmission, reduces the delay during physical link switching, and ensures the integrity and timeliness of data transmission.
Smart Images

Figure CN115694747B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle-mounted communication technology, and in particular to a data redundancy protection method, device, computer equipment, and storage medium. Background Art
[0002] With the development of in-vehicle communication technology, Ethernet communication, as a leading method, has gradually been adopted in vehicle applications. However, with the popularization of automobiles and the development of smart cars, the amount of data transmitted in in-vehicle communication is also increasing. For important data, when the physical link is disconnected, the data cannot be transmitted, which can easily lead to loss of important data. Currently, data can be retransmitted by switching the physical link, but this physical link switching is prone to delays, which reduces the reliability of data transmission. Summary of the Invention
[0003] Based on this, a data redundancy protection method, device, computer equipment and storage medium are provided to solve the problem of low reliability of vehicle-mounted communication data transmission when communication failure occurs in the prior art.
[0004] In one aspect, a data redundancy protection method is provided, the method comprising:
[0005] Obtaining Internet Protocol addresses and port information corresponding to each programming interface, wherein the Internet Protocol addresses corresponding to each programming interface are in corresponding network segments and the port information is the same;
[0006] Obtaining data corresponding to each programming interface and a time when the data is received according to the Internet Protocol address and the port information, wherein the data includes a time identifier;
[0007] The data corresponding to each programming interface is transmitted according to the time identifier and the receiving time.
[0008] In one embodiment, the data corresponding to each programming interface is transmitted according to the time identifier and the receiving time, including: determining whether the time identifiers of the data corresponding to each programming interface are the same; if so, selectively processing the data corresponding to each programming interface according to the receiving time to obtain the selected data; and transmitting the selected data.
[0009] In one embodiment, if so, the data corresponding to each programming interface is selectively processed based on the receiving time to obtain the data after selective processing, including: comparing the receiving time of the data corresponding to each programming interface to obtain a comparison result; based on the comparison result, the data corresponding to each programming interface is selectively processed to obtain the data after selective processing.
[0010] In one embodiment, data corresponding to each programming interface and the reception time of the data are obtained according to the Internet Protocol address and the port information, wherein the data includes a time identifier, including: obtaining data to be sent according to the Internet Protocol address and the port information, wherein the data includes the time identifier; copying the data to be sent according to each programming interface to obtain data corresponding to each programming interface; sending the data corresponding to each programming interface to obtain the reception time corresponding to each data.
[0011] In one embodiment, based on the comparison result, the data corresponding to each programming interface is selectively processed to obtain the data after selective processing, including: based on the comparison result, determining the data corresponding to the minimum receiving time to obtain the data after selective processing.
[0012] In one embodiment, before determining whether the time identifiers of the data corresponding to the respective programming interfaces are the same, it includes: determining the connection status of the physical links corresponding to the respective programming interfaces; if the connection status is that the number of connected physical links is greater than or equal to a physical link threshold, determining whether the time identifiers of the data corresponding to the respective programming interfaces are the same.
[0013] In one embodiment, determining the connection status of the physical links corresponding to the respective programming interfaces further includes: if the number of the physical links whose connection status is disconnected is less than the physical link threshold, transmitting the data.
[0014] In another aspect, a data redundancy protection device is provided, comprising:
[0015] a connection module, configured to obtain the Internet Protocol address and port information corresponding to each programming interface, wherein the Internet Protocol address corresponding to each programming interface is in a corresponding network segment and the port information is the same;
[0016] a data acquisition module, configured to obtain data corresponding to each programming interface and a time when the data is received according to the Internet Protocol address and the port information, wherein the data includes a time identifier;
[0017] The data transmission module is used to transmit the data corresponding to each programming interface according to the receiving time.
[0018] On the other hand, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: obtaining the Internet Protocol address and port information corresponding to each programming interface, wherein the Internet Protocol address corresponding to each programming interface is in a corresponding network segment, and the port information is the same; obtaining data corresponding to each programming interface and the reception time of the data based on the Internet Protocol address and the port information, wherein the data includes a time identifier; and transmitting the data corresponding to each programming interface based on the time identifier and the reception time.
[0019] On the other hand, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: obtaining the Internet Protocol address and port information corresponding to each programming interface, wherein the Internet Protocol address corresponding to each programming interface is in the corresponding network segment, and the port information is the same; according to the Internet Protocol address and the port information, obtaining the data corresponding to each programming interface and the reception time of the data, wherein the data includes a time identifier; and transmitting the data corresponding to each programming interface according to the time identifier and the reception time.
[0020] The above-mentioned data redundancy protection method, device, computer equipment and storage medium obtain the Internet Protocol address and port information corresponding to each programming interface, wherein the Internet Protocol address corresponding to each programming interface is in the corresponding network segment and the port information is the same; based on the Internet Protocol address and port information, the data corresponding to each programming interface and the reception time of the data are obtained, wherein the data includes a time identifier; based on the time identifier and the reception time, the data corresponding to each programming interface is transmitted, thereby solving the problem of low reliability of vehicle-mounted communication data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A diagram illustrating an application environment of a data redundancy protection method according to an embodiment;
[0022] Figure 2 1 is a flow chart of a data redundancy protection method according to an embodiment;
[0023] Figure 3 A schematic diagram of the structure of data redundancy protection for in-vehicle communication in one embodiment;
[0024] Figure 4 is a structural block diagram of a data redundancy protection device in one embodiment;
[0025] Figure 5 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0027] The data redundancy protection method provided in this application can be applied to Figure 1 In the application environment shown, the terminal 102 communicates with the server 104 via a network. With the development of in-vehicle communication technology, Ethernet communication, as a relatively superior method in in-vehicle communication technology, has gradually been put into vehicle applications. However, with the popularization of automobiles and the development of smart cars, the amount of data transmitted by in-vehicle communication is also increasing. For more important data, when the physical link is disconnected, the data is difficult to transmit, which can easily cause the loss of important data. Currently, data can be retransmitted by switching the physical link. However, when the physical link is switched, delays are easily generated, thereby reducing the reliability of data transmission. In this application, the server 104 obtains the Internet Protocol address and port information corresponding to each programming interface. The Internet Protocol address corresponding to each programming interface is located in a corresponding network segment, and each network segment is different. Based on the Internet Protocol address and port information, the data corresponding to each programming interface and the data reception time are obtained. The data includes a time stamp. Based on the time stamp and reception time, the data corresponding to each programming interface is transmitted, thereby improving the reliability of data transmission. The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0028] In one embodiment, Figure 2 As shown, a data redundancy protection method is provided, which is applied to Figure 1 The following steps are used as an example to illustrate the terminal in the figure:
[0029] Step 201: Acquire the Internet Protocol address and port information corresponding to each programming interface, wherein the Internet Protocol address corresponding to each programming interface is in a corresponding network segment and the port information is the same;
[0030] Step 202: Obtain data corresponding to each programming interface and the time the data is received based on the Internet Protocol address and port information, wherein the data includes a time identifier;
[0031] Step 203: Transmit the data corresponding to each programming interface according to the time identifier and the receiving time.
[0032] In the above-mentioned data redundancy protection method, data redundancy protection is performed by obtaining the Internet Protocol addresses and port information corresponding to each programming interface of the same network node, wherein the Internet Protocol addresses corresponding to each programming interface are in corresponding network segments, and each network segment is different. Based on the Internet Protocol addresses and port information, the data corresponding to each programming interface and the reception time of the data are obtained, wherein the data includes a time identifier. Based on the time identifier and the reception time, the data corresponding to each programming interface is transmitted, thereby improving the reliability of data transmission.
[0033] At present, the main mode of vehicle communication is Ethernet communication, and socket is an abstract layer between the network application layer and the transport layer in the communication. It abstracts the complex operations in the network communication into a simple interface for the network application layer to call the communication of the implemented network process. The central gateway and the regional gateway are important nodes for data transmission in vehicle communication. When the physical link between them is disconnected, it is easy to cause data loss between the central gateway and the regional gateway, thereby limiting the development of current vehicle communication technology. Therefore, data protection of the central gateway and the regional gateway is particularly important. In step 201, it is exemplified that the Internet Protocol address and port information corresponding to each programming interface are obtained, wherein the Internet Protocol address corresponding to each programming interface is in the corresponding network segment, and the port information is the same. For example, in order to protect the data in the vehicle communication, a data redundancy protection method can be provided. The method sets the programming interface at the socket layer, that is, sets multiple physical links at each network node that requires data redundancy protection, and binds an Internet Protocol (Internet Protocol) to each physical link. Protocol, IP) address and port information. At the same time, in order to reduce the interference of data transmission delay when the physical link is disconnected, it is necessary to reduce the possibility of delay caused by switching the transmission path. Therefore, each IP address can be set in each corresponding network segment, and each network segment is different. Furthermore, in order to achieve the effect of data redundancy, the port information can be set to the same. Here, we take setting two physical links as an example. Figure 3As shown, for example, two network ports can be set up on the central gateway and the regional gateway respectively and connected, namely network port 1 and network port 2. At the same time, the network ports of the central gateway and the regional gateway are physically linked through network cables or wiring harnesses. Network port 1 corresponds to a socket, namely socket1_sever, and network port 2 corresponds to a socket, namely socket2_sever. The static IP address of network port 1 of the central gateway is configured as 192.168.100.1, and the static IP address of network port 2 is configured as 10.10.2.1. The IP address of network port 1 of the regional gateway is 192.168.100.2, and the static IP address of network port 2 is configured as 10.10.2.2. The port information is both 10000. A socket service (sever) end is created on the central gateway, port 10000 is listened to, and the regional gateway is waited for to connect.
[0034] In step 202, it is exemplified that the data corresponding to each programming interface and the receiving time of the data are obtained according to the Internet Protocol address and port information, wherein the data includes a time stamp. For example, after obtaining the IP address and port information, network nodes can communicate through sockets to obtain corresponding data. Since there are multiple physical links to transmit data, duplicate data will be received when receiving data. In order to avoid receiving multiple duplicate data, the received duplicate data can be processed when receiving. In some implementation processes, the data can be time stamped before sending the data. The duplicate data has the same time stamp. Therefore, it can be preliminarily determined whether the data is duplicated based on the time stamp, and the duplicate data can be further processed.
[0035] In step 203, it is exemplified that the data corresponding to each programming interface is transmitted according to the time identifier and the receiving time. For example, in order to avoid receiving multiple duplicate data, the received duplicate data can be processed when receiving. In some implementation processes, the data can be marked with a time identifier before sending the data. The duplicate data has the same time identifier. Therefore, it can be preliminarily determined whether the data is duplicated based on the time identifier, so that the duplicate data can be further processed. Furthermore, the duplicate data can be further processed based on the receiving time. For example, the data that arrives first can be received and the data that arrives later can be discarded according to the principle of first come first served and last arrived data can be discarded. Figure 3For example, after the central gateway is successfully connected to the regional gateway, the central gateway adds a time stamp to the data when sending it to the adapter layer through the Scalable Service-Oriented Middleware over IP (SOME / IP), and then sends two frames of exactly the same data with the time stamp to socket1_sever and socket2_sever at the same time. When the adapter layer of the regional gateway receives two data with the same time stamp, it selects the two data with the same time stamp according to the receiving time and reports them to the SOME / IP protocol stack of the regional gateway for processing. In some implementation processes, in order to further ensure the accuracy of duplicate data processing, in addition to determining whether the time stamps are the same, it is also possible to determine whether the data packets are the same. If the time stamps and data packets are the same, it is duplicate data. When the regional gateway sends data to the central gateway, it can also refer to the above steps for processing, which will not be repeated here.
[0036] As a specific implementation method of step 203, the data corresponding to each programming interface is transmitted according to the time identifier and the receiving time, including: determining whether the time identifiers of the data corresponding to each programming interface are the same; if so, selectively processing the data corresponding to each programming interface according to the receiving time to obtain the selected and processed data; and transmitting the selected and processed data.
[0037] It should be noted that in order to perform redundant protection on the data, the data can be time-stamped before being sent. The time-stamp can be determined based on the sending time. Then, based on the number of physical links set, the data with the time-stamp can be copied and sent synchronously through each socket. The data and the corresponding receiving time are obtained at other network nodes that receive the data, and it is determined whether the time stamps of the obtained data are the same. If they are the same, it means that the obtained data is duplicate data. The receiving times corresponding to these duplicate data are compared, and the data corresponding to a receiving time is determined as the data that needs to be reported after selection, while the other duplicate data are discarded.
[0038] As an implementation method of the above embodiment, if yes, the data corresponding to each programming interface is selectively processed according to the receiving time to obtain the selected and processed data, including: comparing the receiving time of the data corresponding to each programming interface to obtain a comparison result; based on the comparison result, the data corresponding to each programming interface is selectively processed to obtain the selected and processed data.
[0039] It should be noted that, preferably, the receiving time can be compared according to the principle of first come first served and last arrived data discarded, that is, the data that arrives first is the data that needs to be reported and transmitted, and the data that arrives later is discarded to ensure the timeliness of the data. On the contrary, if the principle of last come first served is followed, the data needs to be stored and waited until all duplicate data are received before it can be transmitted, which can easily lead to delays in data transmission and reduce the reliability of data transmission.
[0040] As a specific implementation method of step 202, according to the Internet Protocol address and port information, the data corresponding to each programming interface and the receiving time of the data are obtained, wherein the data includes a time identifier, including: according to the Internet Protocol address and port information, the data to be sent is obtained, wherein the data includes a time identifier; according to each programming interface, the data to be sent is copied to obtain the data corresponding to each programming interface; the data corresponding to each programming interface is sent to obtain the receiving time corresponding to each data.
[0041] It should be noted that the same number of copies can be made according to the number of programming interfaces, that is, sockets, in the network node, and then the data can be sent to the two programming interfaces synchronously. Figure 3 As shown in the example, the Adapter layer of the central gateway and / or regional gateway copies the data and sends it to the corresponding sockets synchronously.
[0042] As an implementation method of the above embodiment, the data corresponding to each programming interface is selectively processed according to the comparison result to obtain the selected and processed data, including: determining the data corresponding to the minimum receiving time according to the comparison result to obtain the selected and processed data.
[0043] As an implementation method of the above embodiment, before determining whether the time identifiers of the data corresponding to each programming interface are the same, it includes: determining the connection status of the physical link corresponding to each programming interface; if the connection status is that the number of connected physical links is greater than or equal to the physical link threshold, then determining whether the time identifiers of the data corresponding to each programming interface are the same.
[0044] It should be noted that the premise of data redundancy protection is that there are multiple physical links for connection, that is, when there are multiple physical links for connection, there will be multiple duplicate data that need to be selected and processed when receiving, otherwise it will lead to the situation of receiving multiple duplicate data. However, when there is no need to process the duplicate data or there is no duplicate data processing, in order to further improve the efficiency of data transmission, the duplicate data can be not processed. In some implementation processes, the physical link threshold can be set according to the number of connected physical links to determine the data processing. When the connection status is that the number of connected physical links is greater than or equal to the physical link threshold, there is a lot of duplicate data and the duplicate data needs to be processed. When the connection status is that the number of connected physical links is less than the physical link threshold, the duplicate data does not need to be processed.
[0045] As an implementation of the above embodiment, determining the connection status of the physical links corresponding to the respective programming interfaces further includes: if the number of disconnected physical links is less than a physical link threshold, transmitting the data.
[0046] In some implementations, the physical link threshold can be set to 2. This is because when the number of connected physical links is less than 2, it means that only one physical link can transmit data at this moment, and there is no duplicate data. Therefore, there is no need for selective processing, thereby improving the efficiency of data transmission.
[0047] It should be understood that although Figure 2 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 2 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0048] In one embodiment, Figure 4 As shown, a data redundancy protection device is provided, comprising: a connection module, a data acquisition module and a data transmission module, wherein:
[0049] A connection module is used to obtain the Internet Protocol address and port information corresponding to each programming interface, wherein the Internet Protocol address corresponding to each programming interface is in a corresponding network segment and the port information is the same;
[0050] A data acquisition module, configured to obtain data corresponding to each programming interface and the time the data is received based on the Internet protocol address and port information, wherein the data includes a time identifier;
[0051] The data transmission module is used to transmit the data corresponding to each programming interface according to the time identifier and the receiving time.
[0052] Optionally, the data transmission module is also used to determine whether the time identifiers of the data corresponding to each programming interface are the same; if so, the data corresponding to each programming interface is selectively processed according to the receiving time to obtain the selected and processed data; and the selected and processed data is transmitted.
[0053] Optionally, the data transmission module is further used to compare the reception time of the data corresponding to each programming interface to obtain a comparison result; based on the comparison result, the data corresponding to each programming interface is selectively processed to obtain the processed data.
[0054] Optionally, the data acquisition module is also used to obtain the data to be sent based on the Internet Protocol address and port information, where the data includes a time identifier; copy the data to be sent according to each programming interface to obtain the data corresponding to each programming interface; send the data corresponding to each programming interface to obtain the receiving time corresponding to each data.
[0055] Optionally, the data transmission module is further configured to determine the data corresponding to the minimum receiving time based on the comparison result, and obtain the data after selected reception and processing.
[0056] Optionally, the data transmission module is also used to determine the connection status of the physical links corresponding to each programming interface; if the connection status is that the number of connected physical links is greater than or equal to the physical link threshold, then determine whether the time identifiers of the data corresponding to each programming interface are the same.
[0057] Optionally, the data transmission module is further configured to determine the connection status of the physical links corresponding to the respective programming interfaces; if the number of disconnected physical links is less than a physical link threshold, the data is transmitted.
[0058] The specific definition of the data redundancy protection device can be found in the definition of the data redundancy protection method above and will not be repeated here. Each module in the aforementioned data redundancy protection device may be implemented in whole or in part via software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in hardware form, or may be stored in a memory in the computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0059] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a data redundancy protection method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0060] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0061] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are performed:
[0062] Obtaining the Internet Protocol address and port information corresponding to each programming interface, wherein the Internet Protocol address corresponding to each programming interface is in a corresponding network segment and the port information is the same;
[0063] According to the Internet Protocol address and port information, obtain the data corresponding to each programming interface and the time when the data is received, wherein the data includes a time identifier;
[0064] According to the time identifier and the receiving time, the data corresponding to each programming interface is transmitted.
[0065] In one embodiment, when the processor executes the computer program, it also implements the following steps: determining whether the time identifiers of the data corresponding to each programming interface are the same; if so, selectively processing the data corresponding to each programming interface based on the receiving time to obtain the selected and processed data; and transmitting the selected and processed data.
[0066] In one embodiment, when the processor executes the computer program, it also implements the following steps: comparing the receiving time of the data corresponding to each programming interface to obtain a comparison result; based on the comparison result, selectively processing the data corresponding to each programming interface to obtain the selected and processed data.
[0067] In one embodiment, when the processor executes the computer program, it also implements the following steps: obtaining data to be sent based on the Internet Protocol address and port information, wherein the data includes a time identifier; copying the data to be sent according to each programming interface to obtain data corresponding to each programming interface; sending the data corresponding to each programming interface to obtain the receiving time corresponding to each data.
[0068] In one embodiment, when the processor executes the computer program, the following steps are further implemented: according to the comparison result, the data corresponding to the minimum receiving time is determined, and the data after the selected reception is obtained.
[0069] In one embodiment, when the processor executes the computer program, it also implements the following steps: determining the connection status of the physical links corresponding to each programming interface; if the connection status is that the number of connected physical links is greater than or equal to the physical link threshold, determining whether the time identifiers of the data corresponding to each programming interface are the same.
[0070] In one embodiment, when the processor executes the computer program, the processor further implements the following steps: if the number of physical links in disconnected state is less than a physical link threshold, transmitting the data.
[0071] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0072] Obtaining the Internet Protocol address and port information corresponding to each programming interface, wherein the Internet Protocol address corresponding to each programming interface is in a corresponding network segment and the port information is the same;
[0073] According to the Internet Protocol address and port information, obtain the data corresponding to each programming interface and the time when the data is received, wherein the data includes a time identifier;
[0074] According to the time identifier and the receiving time, the data corresponding to each programming interface is transmitted.
[0075] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining whether the time identifiers of the data corresponding to each programming interface are the same; if so, selectively processing the data corresponding to each programming interface based on the reception time to obtain the selected and processed data; and transmitting the selected and processed data.
[0076] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: comparing the receiving time of the data corresponding to each programming interface to obtain a comparison result; based on the comparison result, selectively processing the data corresponding to each programming interface to obtain the selected and processed data.
[0077] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining data to be sent based on the Internet Protocol address and port information, wherein the data includes a time identifier; copying the data to be sent according to each programming interface to obtain data corresponding to each programming interface; sending the data corresponding to each programming interface to obtain the corresponding receiving time of each data.
[0078] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: based on the comparison result, the data corresponding to the minimum receiving time is determined, and the data after selected reception and processing is obtained.
[0079] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining the connection status of the physical links corresponding to each programming interface; if the connection status is that the number of connected physical links is greater than or equal to the physical link threshold, determining whether the time identifiers of the data corresponding to each programming interface are the same.
[0080] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: if the number of physical links in disconnected state is less than a physical link threshold, data is transmitted.
[0081] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0082] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0083] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A method for protecting application layer data redundancy, said method being applied to the adapter layer, characterized in that: The adapter layer is provided between the socket layer and the application layer, the programming interface is provided at the socket layer, and each network node requiring data redundancy protection is provided with multiple physical links, wherein each physical link is respectively bound to an Internet Protocol address and port information. The method includes: Obtaining Internet Protocol addresses and port information corresponding to each programming interface, wherein the Internet Protocol addresses corresponding to each programming interface are in corresponding network segments and the port information is the same; Obtaining data corresponding to each programming interface and a time when the data is received based on the Internet Protocol address and the port information, wherein the data includes a time identifier, and the time identifier is determined based on a time when the data is sent; Determine the connection status of the physical links corresponding to each programming interface. If the number of connected physical links is less than the physical link threshold, report the data to the application layer for processing. If the number of connected physical links in the connection state is greater than or equal to the physical link threshold, determine whether the time identifiers of the data corresponding to each programming interface are the same, and determine whether the data packets of the data corresponding to each programming interface are the same; if the time identifiers and data packets are the same, compare the receiving times of the data corresponding to each programming interface to obtain a comparison result, and based on the comparison result, determine the data corresponding to the minimum receiving time, obtain the data after selected processing, and report the selected processed data to the application layer for processing.
2. The data redundancy protection method according to claim 1, wherein: Obtaining data corresponding to each programming interface and a time when the data is received based on the Internet Protocol address and the port information, wherein the data includes a time identifier, including: Obtaining data to be sent according to the Internet Protocol address and the port information, wherein the data includes the time identifier; According to each programming interface, the data to be sent is copied to obtain data corresponding to each programming interface; The data corresponding to each programming interface is sent, and the receiving time corresponding to each data is obtained.
3. A data redundancy protection device, characterized in that: The adapter layer is located between the socket layer and the application layer. The programming interface is set at the socket layer. Each network node that requires data redundancy protection is set up with multiple physical links, each of which is bound to an Internet Protocol address and port information. The adapter layer includes: A connection module, configured to obtain the Internet Protocol address and port information corresponding to each programming interface, wherein the Internet Protocol address corresponding to each programming interface is in a corresponding network segment, the port information is the same, and the programming interface is set at the socket layer; a data acquisition module, configured to obtain data corresponding to each programming interface and a time when the data is received based on the Internet Protocol address and the port information, wherein the data includes a time identifier, and the time identifier is determined based on a time when the data is sent; The data transmission module is used to determine the connection status of the physical links corresponding to each programming interface. If the connection status is that the number of connected physical links is less than the physical link threshold, the data is reported to the application layer for processing; if the connection status is that the number of connected physical links is greater than or equal to the physical link threshold, it is determined whether the time identifiers of the data corresponding to each programming interface are the same, and whether the data packets of the data corresponding to each programming interface are the same; if the time identifiers and data packets are the same, the receiving time of the data corresponding to each programming interface is compared to obtain a comparison result. According to the comparison result, the data corresponding to the minimum receiving time is determined, the data after selected processing is obtained, and the selected processed data is reported to the application layer for processing.
4. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 2 are implemented.
5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 2 are implemented.
Citation Information
Patent Citations
Vehicle communication method and communication device
CN112585931A
Data transmission method and device, electronic device and storage medium
CN114070495A