CN117041215A - Network card communication configuration method, device, equipment and storage medium - Google Patents

Network card communication configuration method, device, equipment and storage medium Download PDF

Info

Publication number
CN117041215A
CN117041215A CN202311010369.6A CN202311010369A CN117041215A CN 117041215 A CN117041215 A CN 117041215A CN 202311010369 A CN202311010369 A CN 202311010369A CN 117041215 A CN117041215 A CN 117041215A
Authority
CN
China
Prior art keywords
address
network card
target
local network
networking
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
CN202311010369.6A
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.)
Shenzhen Launch Technology Co Ltd
Original Assignee
Shenzhen Launch 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 Shenzhen Launch Technology Co Ltd filed Critical Shenzhen Launch Technology Co Ltd
Priority to CN202311010369.6A priority Critical patent/CN117041215A/en
Publication of CN117041215A publication Critical patent/CN117041215A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5046Resolving address allocation conflicts; Testing of addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a network card communication configuration method, device, equipment and storage medium, and relates to the technical field of computers. The method comprises the following steps: acquiring a first IP address corresponding to a networking network card and a second IP address corresponding to a local network card; the networking network card is a network card for connecting with the Internet, and the local network card is a network card except the networking network card; judging whether the first IP address and the second IP address are in the same network segment or not; if the network is in the same network segment, selecting a corresponding target IP address for the local network card; the target IP address and the first IP address are in different network segments; and configuring the local network card according to the target IP address so that the local network card can communicate according to the target IP address, and the networking network card can communicate according to the corresponding configuration parameters. The IP address of the local network card is changed to other network segments by dynamically modifying the IP address of the local network card, so that the problem of address conflict is solved, the smooth and normal operation of remote diagnosis is ensured, and the stability of the remote diagnosis is improved.

Description

Network card communication configuration method, device, equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for configuring network card communication.
Background
At present, when the automobile is remotely diagnosed, the situation that different types of network cards conflict in the same network segment exists, so that the remote diagnosis cannot be normally performed due to abnormal networking, and the stability of the remote diagnosis is reduced. Therefore, how to solve the conflict between different types of network cards in the vehicle diagnosis process is a current urgent need to be solved.
Disclosure of Invention
Accordingly, the present application is directed to a network card communication configuration method, device, equipment and medium, which can ensure that remote diagnosis is performed smoothly and normally, and improve the stability of remote diagnosis. The specific scheme is as follows:
in a first aspect, the present application discloses a network card communication configuration method, which is applied to a vehicle communication interface device, and includes:
acquiring a first IP address corresponding to a networking network card and a second IP address corresponding to a local network card; the networking network card is a network card for connecting with the Internet, and the local network card is a network card except the networking network card;
judging whether the first IP address and the second IP address are in the same network segment or not;
if the network is in the same network segment, selecting a corresponding target IP address for the local network card; the target IP address and the first IP address are in different network segments;
and configuring the local network card according to the target IP address so that the local network card can communicate according to the target IP address, and the networking network card can communicate according to the corresponding configuration parameters.
Optionally, the selecting a corresponding target IP address for the local network card includes:
selecting a corresponding target IP address for the local network card, and sending a network detection message to all devices corresponding to a target network segment where the target IP address is located in a broadcasting mode according to an address resolution protocol;
judging whether the target IP address is used or not according to the received response corresponding to the network detection message;
if yes, the step of selecting the corresponding target IP address for the local network card is re-executed until the unused target IP address is selected.
Optionally, the selecting a corresponding target IP address for the local network card includes:
determining an original network segment in which the first IP address and the second IP address are located;
and randomly selecting an IP address from any network segment except the original network segment as the target IP address for the local network card.
Optionally, the determining whether the first IP address and the second IP address are after the same network segment further includes:
if the network is not in the same network segment, the local network card and the networking network card directly communicate according to the current configuration parameters.
Optionally, the obtaining the first IP address corresponding to the networking network card and the second IP address corresponding to the local network card includes:
and when the vehicle communication interface equipment receives the remote diagnosis instruction, acquiring a first IP address corresponding to the networking network card and a second IP address corresponding to the local network card.
Optionally, the configuring the local network card according to the target IP address includes:
stopping the dynamic host configuration protocol service, and setting the IP address of the local network card as the target IP address by modifying a configuration file corresponding to the dynamic host configuration protocol service;
restarting the dynamic host configuration protocol service.
Optionally, after the configuring the local network card according to the target IP address, the method further includes:
and reallocating the IP address for the networking network card according to the network segment where the first IP address is located, wherein the newly allocated IP address and the first IP address are in the same network segment.
In a second aspect, the present application discloses a network card communication configuration device, which is applied to a vehicle communication interface device, and includes:
the address acquisition module is used for acquiring a first IP address corresponding to the networking network card and a second IP address corresponding to the local network card; the networking network card is a network card for connecting with the Internet, and the local network card is a network card except the networking network card;
the judging module is used for judging whether the first IP address and the second IP address are in the same network segment or not;
the target IP address selecting module is used for selecting a corresponding target IP address for the local network card if the target IP address is in the same network segment; the target IP address and the first IP address are in different network segments;
and the configuration module is used for configuring the local network card according to the target IP address so that the local network card can communicate according to the target IP address, and the networking network card can communicate according to the corresponding configuration parameters.
In a third aspect, the present application discloses an electronic device, comprising:
a memory for storing a computer program;
and the processor is used for executing the computer program to realize the network card communication configuration method.
In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; the computer program is executed by the processor to realize the network card communication configuration method.
In the application, a first IP address corresponding to a networking network card and a second IP address corresponding to a local network card are obtained; the networking network card is a network card for connecting with the Internet, and the local network card is a network card except the networking network card; judging whether the first IP address and the second IP address are in the same network segment or not; if the network is in the same network segment, selecting a corresponding target IP address for the local network card; the target IP address and the first IP address are in different network segments; and configuring the local network card according to the target IP address so that the local network card can communicate according to the target IP address, and the networking network card can communicate according to the corresponding configuration parameters. Therefore, the problem of IP address conflict is solved, the smooth and normal remote diagnosis is ensured, and the stability of remote diagnosis is improved by checking whether the IP addresses of the networking network card and the local network card are in the same network segment and dynamically modifying the IP address of the local network card in the background through the vehicle communication interface equipment end when the networking network card and the local network card are in the same network segment.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a network card communication configuration method provided by the application;
fig. 2 is a flowchart of a specific network card communication configuration method provided by the present application;
fig. 3 is a schematic structural diagram of a network card communication configuration device provided by the present application;
fig. 4 is a block diagram of an electronic device according to the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In the prior art, when the remote diagnosis is carried out on the automobile, the situation that the network cards of different types conflict in the same network segment exists, so that the remote diagnosis cannot be normally carried out due to abnormal networking, and the stability of the remote diagnosis is reduced. In order to overcome the technical problems, the application provides a network card communication configuration method which can ensure that remote diagnosis is smoothly and normally carried out and improve the stability of the remote diagnosis.
The embodiment of the application discloses a network card communication configuration method which is applied to vehicle communication interface equipment, and is shown in fig. 1, and the method can comprise the following steps:
step S11: acquiring a first IP (Internet protocol) address corresponding to a networking network card and a second IP address corresponding to a local network card; the networking network card is a network card for connecting with the Internet, and the local network card is a network card except the networking network card.
In this embodiment, the IP address corresponding to the networking network card is first obtained as the first IP address, and the IP address corresponding to the local network card is second IP address, where the networking network card is a network card for connecting to the internet, and the local network card is a network card other than the networking network card, that is, the two types of network cards are substantially identical, and in this embodiment, the networking network card and the local network card are distinguished by functions, which may affect internet access if they are located in the same network segment. Namely a networking network card or wifi is a networking network card. The local network card may be an ethernet card for performing vehicle diagnosis communication through TCP/IP (Transmission Control Protocol/Internet Protocol ) and ethernet based on UDS (Unified Diagnostic Services, unified diagnostic service) for dopp (Diagnostic over Internet Protocol), or a USB (Universal Serial Bus, serial communication bus) virtual network card, wifi, ethernet card for J2534 (one pair of upper receiving application software, and a programming interface driven by a lower receiving host computer) communication, or may be added to a bridge, and IP is uniformly distributed to the outside of the bridge, where the local network card may be the IP of the bridge, and the added bridge or each network card may be independently distributed with IP, which is not limited herein.
In this embodiment, the obtaining the first IP address corresponding to the networking network card and the second IP address corresponding to the local network card may include: and when the vehicle communication interface equipment receives the remote diagnosis instruction, acquiring a first IP address corresponding to the networking network card and a second IP address corresponding to the local network card. When entering the vehicle remote diagnosis flow, the IP addresses corresponding to the networking network card and the local network card are obtained first.
The present embodiment may be applied to a vehicle communication interface device (VCI-vehicle communication interface) that is primarily used for communication, has a specific software interface, and is programmed to implement diagnostic services, in fact even if the computer is in communication with the vehicle. For example, the vehicle diagnostic system shown in fig. 2 is a schematic structural diagram of a vehicle diagnostic system, in which the b\c terminal connector is a vehicle communication interface device, which is connected to a router or a hotspot of a client through ethernet, wifi, and performs remote diagnosis through Internet interactive data. When DOIP remote diagnosis is carried out, the C end distributes IP to the vehicle through another network card to communicate with the vehicle. And the end B applies IP to the diagnostic instrument through another network card, and communicates with the diagnostic instrument after being distributed to the IP. When J2534 remote is carried out, the B-end connector is connected with the PC through the USB, and IP is distributed to the PC through a USB virtual network card (wifi or Ethernet) and communication is carried out.
Step S12: and judging whether the first IP address and the second IP address are in the same network segment.
In this embodiment, after the first IP address and the second IP address are obtained, whether the first IP address and the second IP address are in the same network segment is determined, that is, whether the first IP address and the second IP address are in the same network segment is determined according to the existing network segment division condition of the network segment. It can be understood that the router or the IP of the hotspot is set by the user, and the IP of the vehicle communication interface device is set by the vehicle communication interface device, so that the local network card and the networking network card are inevitably in the same network segment, thereby causing conflict, failing to normally network, and causing the situation that remote diagnosis cannot be performed.
In this embodiment, the determining whether the first IP address and the second IP address are after the same network segment may further include: if the network is not in the same network segment, the local network card and the networking network card directly communicate according to the current configuration parameters. If the first IP address and the second IP address are not in the same network segment, namely the local network card and the networking network card cannot influence each other, the two network cards can directly communicate according to the current address.
Step S13: if the network is in the same network segment, selecting a corresponding target IP address for the local network card; the target IP address and the first IP address are in different network segments.
In this embodiment, if the first IP address and the second IP address are in the same network segment, a new IP address is selected for the local network card, and the new IP address and the first IP address are in different network segments, i.e. the IP address of the local network card is modified to other network segments, so that the IP address of the networking network card and the IP address of the local network card do not collide.
In this embodiment, the selecting a corresponding target IP address for the local network card may include: determining an original network segment in which the first IP address and the second IP address are located; and randomly selecting an IP address from any network segment except the original network segment as the target IP address for the local network card. When the target IP address is selected for the local network card, one IP address is selected randomly from any network segment except the network segment where the first IP address is located, namely, the networking network card and the local network card are ensured not to be in the same network segment. In this case, only the target IP address is selected, but the address is actually put into use.
In this embodiment, the selecting a corresponding target IP address for the local network card may include: selecting a corresponding target IP address for the local network card, and sending a network detection message to all devices corresponding to a target network segment where the target IP address is located in a broadcasting mode according to an address resolution protocol; judging whether the target IP address is used or not according to the received response corresponding to the network detection message; if yes, the step of selecting the corresponding target IP address for the local network card is re-executed until the unused target IP address is selected. It can be understood that if the selected target IP address is already used, it cannot be provided to the local network card for use, if the target IP address is directly and easily conflicted, so after the target IP address is selected, it is detected first whether the IP address is occupied, if not, it can be used, if so, it needs to be selected again, and it is detected again until the target IP address which is not occupied and is different from the first IP address is selected. The detection of the target IP address may be performed by sending a network detection message, specifically, the network detection message may be sent to all devices corresponding to the target network segment where the target IP address is located by broadcasting according to an address resolution protocol (ARP, address Resolution Protocol), and if a certain IP address is occupied, a corresponding response may be fed back, so that whether the target IP address is occupied may be determined according to the received response.
Step S14: and configuring the local network card according to the target IP address so that the local network card can communicate according to the target IP address, and the networking network card can communicate according to the corresponding configuration parameters.
In this embodiment, after the target IP address is determined, the configuration for the local network card is performed based on the target IP address, and after the configuration, the local network card can communicate through the target IP address, so that the local network card and the networking network card perform remote diagnosis on the vehicle according to the configuration parameters.
In this embodiment, the configuring the local network card according to the target IP address may include: stopping the dynamic host configuration protocol service, and setting the IP address of the local network card as the target IP address by modifying a configuration file corresponding to the dynamic host configuration protocol service; restarting the dynamic host configuration protocol service. Specifically, the dynamic host configuration protocol service (DHCP, dynamic Host Configuration Protocol) is stopped, the configuration file corresponding to the dynamic host configuration protocol service is modified to set the IP address of the local network card as the target IP address, and then the dynamic host configuration protocol service is restarted, so that the address configuration is successful.
In this embodiment, after the configuring the local network card according to the target IP address, the method may further include: and reallocating the IP address for the networking network card according to the network segment where the first IP address is located, wherein the newly allocated IP address and the first IP address are in the same network segment. It can be understood that, because the networking network card and the local network card are in the same network segment when the previous network segments collide, the route is likely to go to the local network card at this time, the networking network card is unchanged at this time and may influence the internet surfing, and the gateway of the networking network card is certain to go to ensure the normal internet surfing by applying for the system reconfiguration route in the original network segment again.
In this embodiment, a specific vehicle remote diagnosis procedure is as follows:
1. entering a remote diagnosis;
2. reading the IP address of the local network card;
3. reading the IP address of the networking network card;
4. comparing whether the network is in the same network segment, if not, ending the process, and performing remote diagnosis;
5. selecting an IP address of one other network segment;
6. the local network card sends an Arp message, detects whether the IP is occupied, if so, executes the step 5, and does not occupy the step 7;
7. stopping the DHCP service and updating the configuration file of the DHCP service;
8. setting a local network card IP;
9. starting a DHCP service;
10. the networking network card reappears the IP address;
11. remote diagnosis is performed.
That is, in this embodiment, after entering the remote diagnosis, it is checked whether the IP addresses of the networking network card and the local network card are in the same network segment, if so, the IP of the local network card is modified to other network segments, and then an APR message is sent to inquire whether the IP is used, if not, the local network card is used, and the DHCP service is restarted, thereby solving the problem of IP address collision.
As can be seen from the above, in this embodiment, a first IP address corresponding to a networking network card and a second IP address corresponding to a local network card are obtained; the networking network card is a network card for connecting with the Internet, and the local network card is a network card except the networking network card; judging whether the first IP address and the second IP address are in the same network segment or not; if the network is in the same network segment, selecting a corresponding target IP address for the local network card; the target IP address and the first IP address are in different network segments; and configuring the local network card according to the target IP address so that the local network card can communicate according to the target IP address, and the networking network card can communicate according to the corresponding configuration parameters. Therefore, the problem of IP address conflict is solved, the smooth and normal remote diagnosis is ensured, and the stability of remote diagnosis is improved by checking whether the IP addresses of the networking network card and the local network card are in the same network segment and dynamically modifying the IP address of the local network card in the background through the vehicle communication interface equipment end when the networking network card and the local network card are in the same network segment.
Correspondingly, the embodiment of the application also discloses a network card communication configuration device, which is shown in fig. 3, and comprises the following steps:
the address acquisition module 11 is configured to acquire a first IP address corresponding to the networking network card and a second IP address corresponding to the local network card; the networking network card is a network card for connecting with the Internet, and the local network card is a network card except the networking network card;
a judging module 12, configured to judge whether the first IP address and the second IP address are in the same network segment;
the target IP address selecting module 13 is configured to select a corresponding target IP address for the local network card if the target IP address is in the same network segment; the target IP address and the first IP address are in different network segments;
and the configuration module 14 is configured to configure the local network card according to the target IP address, so that the local network card communicates according to the target IP address, and the networking network card communicates according to the corresponding configuration parameters.
As can be seen from the above, in this embodiment, a first IP address corresponding to a networking network card and a second IP address corresponding to a local network card are obtained; the networking network card is a network card for connecting with the Internet, and the local network card is a network card except the networking network card; judging whether the first IP address and the second IP address are in the same network segment or not; if the network is in the same network segment, selecting a corresponding target IP address for the local network card; the target IP address and the first IP address are in different network segments; and configuring the local network card according to the target IP address so that the local network card can communicate according to the target IP address, and the networking network card can communicate according to the corresponding configuration parameters. Therefore, the problem of IP address conflict is solved, the smooth and normal remote diagnosis is ensured, and the stability of remote diagnosis is improved by checking whether the IP addresses of the networking network card and the local network card are in the same network segment and dynamically modifying the IP address of the local network card in the background through the vehicle communication interface equipment end when the networking network card and the local network card are in the same network segment.
In some specific embodiments, the destination IP address selecting module 13 may specifically include:
a network detection message sending unit, configured to select a corresponding target IP address for the local network card, and send a network detection message to all devices corresponding to a target network segment where the target IP address is located by broadcasting according to an address resolution protocol;
an address usage judging unit, configured to judge whether the target IP address has been used according to a response corresponding to the received network detection message;
and the execution unit is used for re-executing the step of selecting the corresponding target IP address for the local network card until the unused target IP address is selected if the judgment result of the address use judgment unit is yes.
In some specific embodiments, the destination IP address selecting module 13 may specifically include:
an original network segment determining unit, configured to determine an original network segment in which the first IP address and the second IP address are located;
and the target IP address selecting unit is used for randomly selecting an IP address for the local network card from any network segment except the original network segment as the target IP address.
In some specific embodiments, the network card communication configuration device may specifically include:
and the communication unit is used for directly communicating the local network card and the networking network card according to the current configuration parameters after judging whether the first IP address and the second IP address are in the same network segment or not and if not.
In some specific embodiments, the address obtaining module 11 may specifically include:
and the monitoring unit is used for acquiring a first IP address corresponding to the networking network card and a second IP address corresponding to the local network card when the vehicle communication interface equipment receives the remote diagnosis instruction.
In some embodiments, the configuration module 14 may specifically include:
the configuration modification unit is used for stopping the dynamic host configuration protocol service and setting the IP address of the local network card as the target IP address by modifying a configuration file corresponding to the dynamic host configuration protocol service;
and the service restarting unit is used for restarting the dynamic host configuration protocol service.
In some specific embodiments, the network card communication configuration device may specifically include:
and the networking network card address allocation unit is used for reallocating the IP address for the networking network card according to the network segment where the first IP address is located, and the newly allocated IP address and the first IP address are in the same network segment.
Further, the embodiment of the application also discloses an electronic device, and referring to fig. 4, the content in the drawing should not be considered as any limitation on the application scope of the application.
Fig. 4 is a schematic structural diagram of an electronic device 20 according to an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input output interface 25, and a communication bus 26. The memory 22 is configured to store a computer program, where the computer program is loaded and executed by the processor 21 to implement relevant steps in the network card communication configuration method disclosed in any of the foregoing embodiments.
In this embodiment, the power supply 23 is configured to provide an operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and the communication protocol to be followed is any communication protocol applicable to the technical solution of the present application, which is not specifically limited herein; the input/output interface 25 is used for acquiring external input data or outputting external output data, and the specific interface type thereof may be selected according to the specific application requirement, which is not limited herein.
The memory 22 may be a carrier for storing resources, such as a read-only memory, a random access memory, a magnetic disk, or an optical disk, and the resources stored thereon include an operating system 221, a computer program 222, and data 223 including a target IP address, and the storage may be temporary storage or permanent storage.
The operating system 221 is used for managing and controlling various hardware devices on the electronic device 20 and the computer program 222, so as to implement the operation and processing of the processor 21 on the mass data 223 in the memory 22, which may be Windows Server, netware, unix, linux, etc. The computer program 222 may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the network card communication configuration method performed by the electronic device 20 disclosed in any of the foregoing embodiments.
Further, the embodiment of the application also discloses a computer storage medium, wherein the computer storage medium stores computer executable instructions, and when the computer executable instructions are loaded and executed by a processor, the steps of the network card communication configuration method disclosed in any embodiment are realized.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above detailed description of the network card communication configuration method, device, equipment and medium provided by the present application applies specific examples to illustrate the principle and implementation of the present application, and the above description of the embodiments is only used to help understand the method and core idea of the present application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. A network card communication configuration method, characterized by being applied to a vehicle communication interface device, comprising:
acquiring a first IP address corresponding to a networking network card and a second IP address corresponding to a local network card; the networking network card is a network card for connecting with the Internet, and the local network card is a network card except the networking network card;
judging whether the first IP address and the second IP address are in the same network segment or not;
if the network is in the same network segment, selecting a corresponding target IP address for the local network card; the target IP address and the first IP address are in different network segments;
and configuring the local network card according to the target IP address so that the local network card can communicate according to the target IP address, and the networking network card can communicate according to the corresponding configuration parameters.
2. The network card communication configuration method according to claim 1, wherein selecting a corresponding target IP address for the local network card includes:
selecting a corresponding target IP address for the local network card, and sending a network detection message to all devices corresponding to a target network segment where the target IP address is located in a broadcasting mode according to an address resolution protocol;
judging whether the target IP address is used or not according to the received response corresponding to the network detection message;
if yes, the step of selecting the corresponding target IP address for the local network card is re-executed until the unused target IP address is selected.
3. The network card communication configuration method according to claim 1, wherein selecting a corresponding target IP address for the local network card includes:
determining an original network segment in which the first IP address and the second IP address are located;
and randomly selecting an IP address from any network segment except the original network segment as the target IP address for the local network card.
4. The network card communication configuration method according to claim 1, wherein the determining whether the first IP address and the second IP address are after the same network segment further comprises:
if the network is not in the same network segment, the local network card and the networking network card directly communicate according to the current configuration parameters.
5. The network card communication configuration method according to claim 1, wherein the obtaining a first IP address corresponding to a networking network card and a second IP address corresponding to a local network card includes:
and when the vehicle communication interface equipment receives the remote diagnosis instruction, acquiring a first IP address corresponding to the networking network card and a second IP address corresponding to the local network card.
6. The network card communication configuration method according to claim 1, wherein the configuring the local network card according to the target IP address includes:
stopping the dynamic host configuration protocol service, and setting the IP address of the local network card as the target IP address by modifying a configuration file corresponding to the dynamic host configuration protocol service;
restarting the dynamic host configuration protocol service.
7. The network card communication configuration method according to any one of claims 1 to 6, further comprising, after the configuring the local network card according to the target IP address:
and reallocating the IP address for the networking network card according to the network segment where the first IP address is located, wherein the newly allocated IP address and the first IP address are in the same network segment.
8. A network card communication configuration apparatus, characterized by being applied to a vehicle communication interface device, comprising:
the address acquisition module is used for acquiring a first IP address corresponding to the networking network card and a second IP address corresponding to the local network card; the networking network card is a network card for connecting with the Internet, and the local network card is a network card except the networking network card;
the judging module is used for judging whether the first IP address and the second IP address are in the same network segment or not;
the target IP address selecting module is used for selecting a corresponding target IP address for the local network card if the target IP address is in the same network segment; the target IP address and the first IP address are in different network segments;
and the configuration module is used for configuring the local network card according to the target IP address so that the local network card can communicate according to the target IP address, and the networking network card can communicate according to the corresponding configuration parameters.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the network card communication configuration method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program; wherein the computer program when executed by a processor implements the network card communication configuration method according to any of claims 1 to 7.
CN202311010369.6A 2023-08-10 2023-08-10 Network card communication configuration method, device, equipment and storage medium Pending CN117041215A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311010369.6A CN117041215A (en) 2023-08-10 2023-08-10 Network card communication configuration method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311010369.6A CN117041215A (en) 2023-08-10 2023-08-10 Network card communication configuration method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117041215A true CN117041215A (en) 2023-11-10

Family

ID=88627585

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311010369.6A Pending CN117041215A (en) 2023-08-10 2023-08-10 Network card communication configuration method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117041215A (en)

Similar Documents

Publication Publication Date Title
US20120124242A1 (en) Server and method for testing pxe function of network interface card
JP2004048649A (en) Method, program for managing network device and network controller
CN112055066B (en) Communication method, communication device, diagnosis device, and computer-readable storage medium
CN111273924B (en) Software updating method and device
CN112769652A (en) Node service monitoring method, device, equipment and medium
US6385648B1 (en) Method for initializing a box on a data communications network
CN115314540A (en) Request response timeout processing method, device, equipment and medium
CN110493055B (en) FPGA card configuration method, device and system and readable storage medium
CN117041215A (en) Network card communication configuration method, device, equipment and storage medium
US8260942B2 (en) Cluster view performance
CN115333933B (en) Automatic management method, medium and equipment for servers on machine room
CN113347287B (en) Host discovery and addition method, device, equipment and medium in data center
CN106445599B (en) Application program upgrading method and device and terminal
CN112702441B (en) Container-based access data processing method, device, system and storage medium
CN112272244B (en) Router WAN end IPv6 internet mode configuration method and device
CN114866515A (en) IP address configuration method, device, electronic equipment and storage medium
CN114185804A (en) Interface testing method and device and terminal equipment
KR100397468B1 (en) Network management device and method using mib name server
CN113079036A (en) Method and device for determining management VLAN (virtual local area network) of access point equipment and access point equipment
CN110636146B (en) User address allocation method and device
JP2022538080A (en) A method of interacting with a computer on a vehicle's on-board bus
CN113472599B (en) Data communication method and system of network node
CN111131287B (en) Method for starting remote service of equipment, server and storage medium
CN115633015A (en) IP address application method, device, equipment and medium
CN111988153B (en) Network exception handling method and device and household electrical appliance

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