Routing rule processing method and apparatus, and computer-readable storage medium and vehicle
By receiving and parsing the routing requirement packets of the vehicle controller in the gateway controller and dynamically updating the routing rules in the fixed memory, the problem of low processing efficiency of traditional gateway controllers is solved, and efficient routing rules processing and dynamic updates are achieved.
Patent Information
- Application Number
- PCT/CN2024/106024
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-21
- Filing Date
- 2024-07-17
- Publication Date
- 2025-03-27
AI Technical Summary
The routing rules processing efficiency of traditional gateway controllers is low, which affects the normal driving of vehicles and software upgrades, and no effective solutions have been proposed in the existing technology.
By receiving the routing requirement message sent by the vehicle controller, the target routing rules are parsed and matched with the preset routing rules. If the target routing rule is not stored in fixed memory, it is added to the fixed memory and forward the message based on the target routing rule.
Dynamic update of routing rules is realized, routing rules processing efficiency is improved, and the need for synchronous update of vehicle controller software and routing rules is avoided, thereby improving the efficiency of normal driving of the vehicle and software upgrade.
Smart Images

Figure CN2024106024_27032025_PF_FP_ABST
Abstract
Description
Routing rule processing method and device, computer-readable storage medium, and vehicle
[0001] This disclosure claims priority to a Chinese patent application filed with the Patent Office of China on September 21, 2023, with priority number 202311226760X and invention name “Routing rule processing method and device, computer-readable storage medium and vehicle”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present disclosure relates to the field of smart cars, and more particularly, to a routing rule processing method and device, a computer-readable storage medium, and a vehicle. Background Art
[0003] At present, the gateway controller is a central node used to manage and control network traffic. It can determine the transmission path of data packets based on routing rules, and plays an important role in the normal driving of the vehicle, software upgrades and other functions. Traditional gateway controllers are pre-configured. If the routing requirements change, the controller software and routing rules need to be updated synchronously. After the routing rules are configured, the software in the gateway controller is updated, resulting in low processing efficiency of the routing rules, affecting the normal driving of the vehicle.
[0004] To address the above-mentioned problems, no effective solutions have been proposed so far.
[0005] Summary of the Invention
[0006] The embodiments of the present disclosure provide a routing rule processing method and apparatus, a computer-readable storage medium, and a vehicle, to at least solve the technical problem of low routing rule processing efficiency in related technologies.
[0007] According to one aspect of an embodiment of the present disclosure, a routing rule processing method is provided, including: receiving a routing request message sent by a vehicle controller; parsing the routing request message to obtain a target routing rule of the routing request message; matching the target routing rule with a preset routing rule to determine whether the target routing rule is stored in a fixed memory; in response to the target routing rule not being stored in the fixed memory, adding the target routing rule to the fixed memory, and forwarding the message sent by the vehicle controller based on the target routing rule.
[0008] Optionally, matching the target routing rule with the preset routing rule and determining whether the target routing rule is stored in the fixed memory includes: in response to a successful match between the target routing rule and the preset routing rule, determining that the target routing rule is stored in the fixed memory; in response to a failure to match between the target routing rule and the preset routing rule, determining that the target routing rule is not stored in the fixed memory.
[0009] Optionally, matching the target routing rule with the preset routing rule to determine whether the target routing rule is stored in the fixed memory includes: reading the preset routing rule stored in the fixed memory in response to receiving a power-on signal; loading the preset routing rule into the running memory; matching the target routing rule with the preset routing rule in the running memory to determine whether the target routing rule is stored in the fixed memory.
[0010] Optionally, loading the preset routing rules into the running memory includes: generating a first verification code corresponding to the preset routing rules; determining whether the preset routing rules are valid based on the first verification code; ignoring the preset routing rules in response to the preset routing rules being invalid; and loading the preset routing rules into the running memory in response to the preset routing rules being valid.
[0011] Optionally, based on the first verification code, determining whether the preset routing rule is valid includes: reading a preset verification code corresponding to the preset routing rule stored in a fixed memory; in response to the first verification code being consistent with the preset verification code, determining that the preset routing rule is valid; in response to the first verification code being inconsistent with the preset verification code, determining that the preset routing rule is invalid.
[0012] Optionally, adding the target routing rule to the fixed memory includes: generating a second verification code for the target routing rule; and storing the target routing rule and the second verification code in the fixed memory correspondingly.
[0013] Optionally, in response to the target routing rule being stored in the fixed memory, the message sent by the vehicle controller is forwarded based on the target routing rule.
[0014] According to another aspect of an embodiment of the present disclosure, a routing rule processing device is also provided, including: a receiving module, configured to receive a routing requirement message sent by a vehicle controller; a parsing module, configured to parse the routing requirement message to obtain a target routing rule of the routing requirement message; a determination module, configured to match the target routing rule with a preset routing rule to determine whether the target routing rule is stored in a fixed memory; a forwarding module, configured to add the target routing rule to the fixed memory in response to the target routing rule not being stored in the fixed memory, and forward the message sent by the vehicle controller based on the target routing rule.
[0015] According to another aspect of the embodiments of the present disclosure, a computer-readable storage medium is further provided, which includes a stored program, wherein when the program is run, the processor of the device where the program is located is controlled to execute the routing rule processing method of any one of the above embodiments.
[0016] According to another aspect of an embodiment of the present disclosure, a vehicle is also provided, comprising: one or more processors; a storage device for storing one or more programs; and when the one or more programs are executed by one or more processors, the one or more processors execute the routing rule processing method of any one of the above embodiments.
[0017] In the embodiment of the present disclosure, a routing request message sent by a vehicle controller is received; the routing request message is parsed to obtain the target routing rule of the routing request message; the target routing rule is matched with the preset routing rule to determine whether the target routing rule is stored in a fixed memory; in response to the target routing rule not being stored in the fixed memory, the target routing rule is added to the fixed memory, and the message sent by the vehicle controller is forwarded based on the target routing rule. It should be noted that after determining that the target routing rule is not stored in the fixed memory, the target routing rule is promptly added to the fixed memory so that the routing rule in the fixed memory can be updated in real time. That is, when the vehicle controller changes the routing requirement, only the routing rule corresponding to the vehicle controller needs to be updated, and there is no need to synchronize the vehicle controller software and the routing rule. This achieves the purpose of improving the efficiency of routing rule processing, thereby realizing the technical effect of dynamic updating of routing rules, and further solving the technical problem of low routing rule processing efficiency in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The exemplary embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation of the present disclosure. In the drawings:
[0019] FIG1 is a flowchart of a routing rule processing method according to one embodiment of the present disclosure;
[0020] FIG2 is a schematic diagram of optional routing rules according to one embodiment of the present disclosure;
[0021] FIG3 is a flow chart of an optional routing rule verification method according to one embodiment of the present disclosure;
[0022] FIG4 is a flowchart of an optional routing rule processing method according to one embodiment of the present disclosure;
[0023] FIG5 is a schematic diagram of a routing rule processing device according to one embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the embodiments described are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present disclosure.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] Example 1
[0027] According to an embodiment of the present disclosure, an embodiment of a routing rule processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0028] FIG1 is a flow chart of a method for processing routing rules according to an embodiment of the present disclosure. As shown in FIG1 , the method includes the following steps:
[0029] Step S102: receiving a routing request message sent by a vehicle controller.
[0030] The vehicle controller described above can be a device or system used to control various vehicle functions and operations, capable of receiving and sending messages. Upon power-up, the vehicle controller combines the messages it needs to receive and the messages it needs to send into a routing request message and sends the routing request message to the gateway.
[0031] The aforementioned routing request message can be a message format used to exchange information between routers, a data message used to discover and exchange routing information. It contains the network address information of the sender and receiver, as well as other routing-related parameters. When a router needs to request routing information from another router, it sends a routing request message. The message contains information such as the router's network address and subnet mask, as well as the requested target network address. The routing request message is then used to determine how to forward the message.
[0032] In an optional embodiment, after the vehicle controller establishes communication with the gateway, the vehicle controller sends a routing request message to the gateway. The vehicle controller and the gateway may communicate via a physical or wireless connection. If the routing request message is not received from the vehicle controller, the data packet is forwarded according to the routing rules stored in the running memory.
[0033] Step S104: parsing the routing request message to obtain a target routing rule of the routing request message.
[0034] The target routing rule can be the routing rule for the current vehicle controller or a set of rules that specify the transmission path and processing method for data packets within the network, determining how data packets are forwarded. These rules are formulated based on specific network traffic distribution strategies and requirements. Routing rules consist of a series of matching conditions and corresponding actions, which determine the next hop for a data packet.
[0035] In an optional embodiment, the data message carried in the routing request message, such as the network address information of the sender and the receiver, is parsed, the data message is matched with the stored routing rules, and the routing rule that matches the controller is determined as the target routing rule.
[0036] In another optional embodiment, information such as the source address (Internet Protocol, IP), destination IP address, and protocol type is extracted from the routing request message, and a routing table is searched based on the destination IP address in the message. The routing table may be a table that records routing rules for each subnet in the network, including information such as the destination IP address range, next-hop address, and outbound interface. A match is performed in the routing table based on the destination IP address, and the routing rule that best matches the destination IP address is found and determined as the target routing rule.
[0037] Step S106 : Match the target routing rule with the preset routing rule to determine whether the target routing rule is stored in the fixed memory.
[0038] The aforementioned preset routing rules may be routing rules pre-stored in a fixed memory.
[0039] The fixed memory mentioned above may be a type of computer main memory, also known as non-volatile memory (NVM), which can continue to store data after power failure.
[0040] In an optional embodiment, the target routing rule is matched with the preset routing rule to determine whether the target routing rule has been stored in the fixed memory. The preset routing rule can be matched according to the destination IP address and source address corresponding to the target routing rule, or it can be matched with the preset routing rule according to the conditions in the target routing rule. The conditions can specify which conditions must be met before the routing rule can be used, and can include but are not limited to: protocol type, port number. If the target routing rule successfully matches the preset routing rule, it is determined that the target routing rule has been stored in the fixed memory; if the target routing rule fails to match the preset routing rule, it is determined that the target routing rule is not stored in the fixed memory.
[0041] In another optional embodiment, the target routing rule is matched with the preset routing rule to determine a match result. If the match result is a successful match, verification is performed based on the match result and the data in the routing table to obtain a verification result. If the verification result is correct, it is determined that the target routing rule has been stored in the fixed memory; if the verification result is incorrect, it is determined that the target routing rule is not stored in the fixed memory. If the match result is a failed match, it is determined that the target routing rule is not stored in the fixed memory.
[0042] Step S108 , in response to the target routing rule not being stored in the fixed memory, adding the target routing rule to the fixed memory, and forwarding the message sent by the vehicle controller based on the target routing rule.
[0043] In an optional embodiment, if the target routing rule is not stored in a fixed memory, a second check code corresponding to the target routing rule is calculated, wherein the second check code can be a check code for determining the integrity and accuracy of the target routing rule. The target routing rule and the second check code are added to the fixed memory for storage so that they can be loaded and used the next time the vehicle controller is powered on, thereby realizing dynamic updating of the routing rule. When the vehicle controller changes its routing requirements, only the routing rule corresponding to the vehicle controller needs to be changed, and the software in the gateway does not need to be modified or updated, thereby avoiding the technical problem that when the routing requirements change, the controller software and routing rules that make the requirements must be changed synchronously.
[0044] In another optional embodiment, if the target routing rule is not stored in a fixed memory, the target routing rule is first added to the Random Access Memory (RAM) to take effect, wherein the Random Access Memory can be a hardware device used by the computer to temporarily store data and instructions, and is used to store currently running programs and data for the CPU to read and write operations, which can provide faster data access and processing speeds, thereby improving the performance of the computer. The second check code corresponding to the target routing rule is further calculated. The target routing rule and the second check code are thereby added and saved in the fixed memory, and the routing table is updated synchronously for easy search, so that it can be read and used the next time the vehicle controller is powered on. After the target routing rule is updated to the fixed memory, the message sent by the vehicle controller is forwarded according to the target routing rule.
[0045] Through the above steps, it is possible to receive the routing request message sent by the vehicle controller; parse the routing request message to obtain the target routing rule of the routing request message; match the target routing rule with the preset routing rule to determine whether the target routing rule is stored in the fixed memory; in response to the target routing rule not being stored in the fixed memory, add the target routing rule to the fixed memory, and forward the message sent by the vehicle controller based on the target routing rule. It should be noted that after determining that the target routing rule is not stored in the fixed memory, the target routing rule is promptly added to the fixed memory so that the routing rule in the fixed memory can be updated in real time. That is, when the vehicle controller changes the routing requirement, it is only necessary to update the routing rule corresponding to the vehicle controller, and there is no need to synchronize the vehicle controller software and routing rules. This achieves the purpose of improving the efficiency of routing rule processing, thereby realizing the technical effect of dynamic updating of routing rules, and further solving the technical problem of low routing rule processing efficiency in related technologies.
[0046] It should be noted that Figure 2 is a schematic diagram of an optional routing rule according to an embodiment of the present disclosure. As shown in Figure 2, it includes the payload type (Payload Type, abbreviated as PT) in the source address and destination address transmission protocol and the attribute (Information, abbreviated as INFO) of the session description protocol information and the corresponding message identification number (Identity Document, abbreviated as ID), wherein the message identification number includes 0x92, 0x94, 0x105, 0x112, 0x220, 0x232, and 0x260. The gateway includes a source address bus and a destination address bus, the source address bus connects the controller 1 bus and the controller 2 bus, and the destination address bus connects the controller 3 bus. Controller 1's bus includes receive message IDs (0x112, 0x220, 0x232) and transmit message IDs (0x92, 0x94). Message ID 0x650 contains the first message's contents: 01, 12, 02, 20, 02, 32, 10, 92, and the second message's contents: 10, 94, 00, 00, 00, 00, 00, 00. Controller 2's bus includes receive message IDs (0x92, 0x260, 0x232) and transmit message IDs (0x116, 0x105). Message ID 0x640 contains the first message's contents: 00, 92, 02, 60, 02, 32, 11, 16, and the second message's contents: 11, 05, 00, 00, 00, 00, 00, 00. Controller 3 bus includes: receive message ID (0x92, 0x94, 0x105), send message ID (0x112, 0x220, 0x232, 0x260), message ID: 0x660 contains the content of the first message: 00, 92, 00, 94, 01, 05, 11, 12, and the content of the second message: 12, 20, 12, 32, 12, 60, 00, 00.
[0047] When a vehicle controller is initially powered on, each controller fills in the data in a routing request message according to its corresponding message ID and sends it to the Controller Area Network (CAN) bus. Each controller has a fixed and unique routing request message ID to avoid conflicts. When filling in the data, the most significant four bits of the two-byte data are set to 0 for incoming messages. For example, if ECU2 wants to receive 0x232, it fills in the data with 0x02 and 0x32. For outgoing messages, the most significant four bits of the two-byte data are set to 1. For example, if Controller 2 wants to send 0x116, it fills in the data with 0x11 and 0x16. After receiving routing request messages such as 0x640, 0x650, and 0x660, the gateway parses the data and generates routing rules accordingly. For example, if it recognizes that both Controller 1 and Controller 2 on the source address bus are receiving message 0x232, and that this message ID is sent by Controller 3 on the destination address bus, it generates a routing rule: "Forward 0x232 from the destination address bus to the source address bus."
[0048] In addition, the routing rules of traditional gateway controllers are all static, that is, they are configured in advance in the gateway controller and cannot be changed during operation. When the routing requirements change, the controller software that provides the requirements and the routing rules in the gateway controller need to be changed simultaneously. After the routing rules are configured, the new version of the software must be updated to the gateway controller, which is time-consuming and labor-intensive. However, when the gateway is first powered on, the present invention generates routing rules based on the routing requirement messages of each controller within a preset time. The preset time can be a time set in advance according to the specific situation, which can be, but is not limited to, 1 second or 0.5 seconds. The routing rules can be generated based on the routing requirement messages in a short time without affecting the controller's usage rate. On subsequent power-ups, the preset routing rules in the fixed memory can be directly loaded and used, which is consistent with static routing. When the routing requirements of a controller change later, the gateway can parse and update the preset routing rules in the fixed memory in real time, realizing dynamic routing without modifying or updating the software in the gateway, greatly improving development efficiency and debugging efficiency.
[0049] Optionally, matching the target routing rule with the preset routing rule and determining whether the target routing rule is stored in the fixed memory includes: in response to a successful match between the target routing rule and the preset routing rule, determining that the target routing rule is stored in the fixed memory; in response to a failure to match between the target routing rule and the preset routing rule, determining that the target routing rule is not stored in the fixed memory.
[0050] In an optional embodiment, the target routing rule is matched with the preset routing rule. If the target routing rule successfully matches the preset routing rule, it is determined that the target routing rule has been stored in the fixed memory, indicating that the target routing rule is not a new rule and does not need to be processed and can be directly loaded and used; in response to the target routing rule failing to match the preset routing rule, it is determined that the target routing rule is not stored in the fixed memory, indicating that the target routing rule is a new rule and needs to be stored.
[0051] Optionally, matching the target routing rule with the preset routing rule to determine whether the target routing rule is stored in the fixed memory includes: reading the preset routing rule stored in the fixed memory in response to receiving a power-on signal; loading the preset routing rule into the running memory; matching the target routing rule with the preset routing rule in the running memory to determine whether the target routing rule is stored in the fixed memory.
[0052] The power-on signal mentioned above can be a signal generated when an electronic device is powered on, indicating that the device has entered an operational state or performed a certain operation. The power-on signal can be a change in voltage, current, or other signal forms. In digital circuits, the power-on signal is usually represented by a high level, indicating that the device has entered an operational state; a low level indicates that the device is in a shutdown or standby state. The power-on signal can be generated in various ways, such as by a switch operation, a power control circuit, or an automatic circuit.
[0053] In an optional embodiment, upon receiving a power-on signal from the vehicle controller gateway, the preset routing rules stored in the fixed memory are read and loaded into the running memory. The running memory can be used directly according to the preset routing rules. If the target routing rule successfully matches the preset routing rule in the running memory, it means that the target routing rule has been successfully stored in the fixed memory, and the corresponding vehicle controller is not powered on for the first time. The running memory can directly forward according to the stored preset routing rule to achieve the next hop. If the target routing rule fails to match the preset routing rule in the running memory, it means that the corresponding vehicle controller is not powered on for the first time, or the routing requirements have changed, and the target routing rule needs to be updated to the fixed memory.
[0054] FIG3 is a flow chart of an optional routing rule verification method according to an embodiment of the present disclosure. As shown in FIG3 , the steps are as follows:
[0055] Step S301: receiving a power-on signal from a vehicle controller gateway.
[0056] Step S302: Read the preset routing rules stored in the fixed memory.
[0057] Step S303: Use the first verification code to determine whether the preset routing rule is valid. If so, execute step S304; if not, execute step S305.
[0058] Step S304: Loading the preset routing rules into the running memory.
[0059] Step S305: Ignore the preset routing rules.
[0060] Step S306: Receive a routing request message.
[0061] Step S307: parse the routing request message to obtain target routing rules.
[0062] Step S308: Save the target routing rule to a fixed memory.
[0063] Step S309: Load the target routing rules into the running memory.
[0064] It should be noted that the preset routing rules in fixed memory are preconfigured and static, and cannot be modified. However, the preset routing rules stored in running memory can be modified or updated at any time. Running memory is directly connected to the processor, allowing for faster read access, reducing read operations on fixed memory and the load on fixed memory, enabling faster packet forwarding. By loading preset routing rules into running memory, routing policies can be configured and adjusted according to actual needs, making routing rule processing more flexible.
[0065] Optionally, loading the preset routing rules into the running memory includes: generating a first verification code corresponding to the preset routing rules; determining whether the preset routing rules are valid based on the first verification code; ignoring the preset routing rules in response to the preset routing rules being invalid; and loading the preset routing rules into the running memory in response to the preset routing rules being valid.
[0066] The first check code mentioned above may be a check code corresponding to a preset routing rule, and may be a cyclic redundancy check (CRC) for verifying the validity and integrity of the routing rule.
[0067] In an optional embodiment, a first check code corresponding to the preset routing rule is calculated based on the preset routing rule, and the first check code is matched with a check code stored in a fixed memory to determine whether the preset routing rule is valid. If the preset routing rule is invalid, the preset routing rule is ignored, and a vehicle routing request message is received and parsed to obtain a target routing rule. The target routing rule is then loaded into the running memory for use, and the data packet is forwarded according to the target routing rule. If the preset routing rule is valid, the preset routing rule is directly loaded into the running memory, and the running memory forwards the data packet according to the preset routing rule.
[0068] It should be noted that the invalidity of preset routing rules can be divided into two situations. The first situation is that the vehicle controller gateway is powered on for the first time, and the routing rules have not been saved before, so the corresponding routing rules cannot be found in the routing table; the second situation is that when the routing rules were saved last time, there was a sudden power outage, resulting in data corruption and failure to successfully save the routing rules.
[0069] Optionally, based on the first verification code, determining whether the preset routing rule is valid includes: reading a preset verification code corresponding to the preset routing rule stored in a fixed memory; in response to the first verification code being consistent with the preset verification code, determining that the preset routing rule is valid; in response to the first verification code being inconsistent with the preset verification code, determining that the preset routing rule is invalid.
[0070] The aforementioned preset verification code may be a verification code pre-stored in a fixed memory.
[0071] In an optional embodiment, a preset verification code corresponding to a preset routing rule stored in a fixed memory is read, a first verification code is matched with the preset verification code, and it is determined whether the first verification code is consistent with the preset verification code. If the first verification code is consistent with the preset verification code, it is determined that the preset routing rule is valid; if the first verification code is inconsistent with the preset verification code, it is determined that the preset routing rule is invalid.
[0072] It should be noted that using the first verification code to verify the validity of the preset routing rules can effectively determine whether the preset routing rules have been maliciously tampered with or damaged, thereby improving the reliability of the preset routing rules. If the first verification code does not match the preset verification code, it means that the preset routing rules may have been tampered with or damaged and need to be repaired or reconfigured in a timely manner, thereby improving the reliability and security of the preset routing rules. Verifying that the preset routing rules are valid based on the first verification code effectively helps network administrators quickly locate and repair routing rule configuration errors or anomalies. Administrators can quickly determine the validity of routing rules, thereby improving the maintainability of the network and reducing the difficulty and cost of troubleshooting.
[0073] Optionally, adding the target routing rule to the fixed memory includes: generating a second verification code for the target routing rule; and storing the target routing rule and the second verification code in the fixed memory correspondingly.
[0074] In an optional embodiment, after determining that the target routing rule is not stored in a fixed memory, an XOR operation is performed on the target routing rule and a check code polynomial to obtain a calculation result, and the calculation result is used as a second check code corresponding to the target routing rule, and the target routing rule and the second check code are stored in a fixed memory.
[0075] In another optional embodiment, after determining that the target routing rule is not stored in the fixed memory, all bytes of the data corresponding to the target routing rule are added together, and the low byte of the result is taken as the second check code. If an overflow occurs, the overflow is re-added to the result. Thus, the second check code is obtained, and the target routing rule and the second check code are stored in the fixed memory.
[0076] Optionally, in response to the target routing rule being stored in the fixed memory, the message sent by the vehicle controller is forwarded based on the target routing rule.
[0077] In an optional embodiment, if the target routing rule has been stored in a fixed memory, the next hop is determined according to the target routing rule, thereby forwarding the message sent by the vehicle controller.
[0078] FIG4 is a flow chart of an optional routing rule processing method according to an embodiment of the present disclosure. As shown in FIG4 , the steps are as follows:
[0079] Step S401: Determine whether the routing request message is successfully received. If not, execute step S402; if so, execute step S403.
[0080] Step S402: forwarding the message sent by the vehicle controller according to the preset routing rules in the running memory.
[0081] Step S403: parse the routing request message to generate target routing rules.
[0082] Step S404: Determine whether the target routing rule has been stored in the fixed memory. If so, execute step S402; if not, execute step S405.
[0083] Step S405: Add the target routing rule to the running memory to take effect.
[0084] Step S406: Calculate the second check code of the target routing rule.
[0085] Step S407: Save the target routing rule and the second verification code in a fixed memory, and forward the message sent by the vehicle controller according to the target routing rule.
[0086] Example 2
[0087] According to an embodiment of the present disclosure, a routing rule processing device is also provided, which can execute the routing rule processing method in the above embodiment. The specific implementation method and preferred application scenario are the same as those in the above embodiment and will not be repeated here.
[0088] FIG5 is a schematic diagram of a routing rule processing device according to an embodiment of the present disclosure. As shown in FIG5 , the device includes the following parts: a receiving module 50 , a parsing module 52 , a determining module 54 and an adding module 56 .
[0089] Wherein, the receiving module 50 is configured to receive a routing request message sent by the vehicle controller;
[0090] The parsing module 52 is configured to parse the routing request message to obtain the target routing rule of the routing request message;
[0091] a determination module 54 configured to match the target routing rule with a preset routing rule and determine whether the target routing rule is stored in a fixed memory;
[0092] The adding module 56 is configured to add the target routing rule to the fixed memory in response to the target routing rule not being stored in the fixed memory, and forward the message sent by the vehicle controller based on the target routing rule.
[0093] Optionally, the determination module includes: a first determination unit, configured to determine that the target routing rule is stored in a fixed memory in response to a successful match between the target routing rule and the preset routing rule; and a second determination unit, configured to determine that the target routing rule is not stored in the fixed memory in response to a failure to match between the target routing rule and the preset routing rule.
[0094] Optionally, the determination module also includes: a reading unit, configured to read the preset routing rules stored in the fixed memory in response to receiving a power-on signal; a loading unit, configured to load the preset routing rules into the running memory; and a matching unit, configured to match the target routing rules with the preset routing rules in the running memory to determine whether the target routing rules are stored in the fixed memory.
[0095] Optionally, the loading unit includes: a generating subunit, configured to generate a first verification code corresponding to a preset routing rule; a determining subunit, configured to determine whether the preset routing rule is valid based on the first verification code; an ignoring subunit, configured to ignore the preset routing rule in response to the preset routing rule being invalid; and a loading subunit, configured to load the preset routing rule into the running memory in response to the preset routing rule being valid.
[0096] Optionally, the determination subunit is further configured to read a preset verification code corresponding to a preset routing rule stored in a fixed memory; in response to the first verification code being consistent with the preset verification code, the preset routing rule is determined to be valid; in response to the first verification code being inconsistent with the preset verification code, the preset routing rule is determined to be invalid.
[0097] Optionally, the adding module includes: a generating unit configured to generate a second verification code of the target routing rule; and a storing unit configured to store the target routing rule and the second verification code correspondingly in a fixed memory.
[0098] Optionally, the device further includes: a sending module configured to forward a message sent by the vehicle controller based on the target routing rule stored in the fixed memory in response to the target routing rule.
[0099] Example 3
[0100] According to another aspect of an embodiment of the present disclosure, a computer-readable storage medium is further provided. The computer-readable storage medium includes a stored program, wherein when the program is executed, the processor of the device where the program is located is controlled to execute the following method:
[0101] Receive routing request messages sent by vehicle controllers;
[0102] Parse the routing request message to obtain the target routing rule of the routing request message;
[0103] Matching the target routing rule with the preset routing rule to determine whether the target routing rule is stored in the fixed memory;
[0104] In response to the target routing rule not being stored in the fixed memory, the target routing rule is added to the fixed memory, and the message sent by the vehicle controller is forwarded based on the target routing rule.
[0105] Optionally, the storage medium controls the device where the storage medium is located to also execute the following method when the program is running: in response to a successful match between the target routing rule and the preset routing rule, determining that the target routing rule is stored in a fixed memory; in response to a failure to match between the target routing rule and the preset routing rule, determining that the target routing rule is not stored in the fixed memory.
[0106] Optionally, the storage medium controls the device where the storage medium is located to also execute the following method when the program is running: in response to receiving a power-on signal, reading the preset routing rules stored in the fixed memory; loading the preset routing rules into the running memory; matching the target routing rules with the preset routing rules in the running memory to determine whether the target routing rules are stored in the fixed memory.
[0107] Optionally, the storage medium controls the device where the storage medium is located to also execute the following method when the program is running: generating a first verification code corresponding to a preset routing rule; determining whether the preset routing rule is valid based on the first verification code; ignoring the preset routing rule in response to the preset routing rule being invalid; and loading the preset routing rule into the running memory in response to the preset routing rule being valid.
[0108] Optionally, the storage medium controls the device where the storage medium is located to further execute the following method when the program is running: reading a preset verification code corresponding to a preset routing rule stored in a fixed memory; in response to the first verification code being consistent with the preset verification code, determining that the preset routing rule is valid; in response to the first verification code being inconsistent with the preset verification code, determining that the preset routing rule is invalid.
[0109] Optionally, the storage medium controls the device where the storage medium is located to further execute the following method when the program is running: generating a second verification code of the target routing rule; and storing the target routing rule and the second verification code correspondingly in a fixed memory.
[0110] Optionally, the storage medium controls the device where the storage medium is located to further execute the following method when the program is running: in response to the target routing rule being stored in the fixed memory, forwarding the message sent by the vehicle controller based on the target routing rule.
[0111] Example 4
[0112] According to another aspect of the present disclosure, a vehicle is provided, comprising: one or more processors; a storage device for storing one or more programs; and when the one or more programs are executed by the one or more processors, the one or more processors perform the following method:
[0113] Receive routing request messages sent by vehicle controllers;
[0114] Parse the routing request message to obtain the target routing rule of the routing request message;
[0115] Matching the target routing rule with the preset routing rule to determine whether the target routing rule is stored in the fixed memory;
[0116] In response to the target routing rule not being stored in the fixed memory, the target routing rule is added to the fixed memory, and the message sent by the vehicle controller is forwarded based on the target routing rule.
[0117] Optionally, the vehicle, wherein the processor is further configured to run a computer program to perform the following method: in response to a successful match between the target routing rule and the preset routing rule, determining that the target routing rule is stored in the fixed memory; in response to a failure to match between the target routing rule and the preset routing rule, determining that the target routing rule is not stored in the fixed memory.
[0118] Optionally, the vehicle, wherein the processor is further configured to run a computer program to perform the following method: in response to receiving a power-on signal, reading a preset routing rule stored in a fixed memory; loading the preset routing rule into a running memory; matching a target routing rule with the preset routing rule in the running memory, and determining whether the target routing rule is stored in the fixed memory.
[0119] Optionally, the vehicle, wherein the processor is further configured to run a computer program to perform the following method: generating a first verification code corresponding to a preset routing rule; determining whether the preset routing rule is valid based on the first verification code; ignoring the preset routing rule in response to the preset routing rule being invalid; and loading the preset routing rule into the running memory in response to the preset routing rule being valid.
[0120] Optionally, the vehicle, wherein the processor is further configured to run a computer program to perform the following method: reading a preset verification code corresponding to a preset routing rule stored in a fixed memory; in response to a first verification code being consistent with the preset verification code, determining that the preset routing rule is valid; in response to the first verification code being inconsistent with the preset verification code, determining that the preset routing rule is invalid.
[0121] The serial numbers of the above-mentioned embodiments of the present disclosure are for description only and do not represent the advantages or disadvantages of the embodiments.
[0122] In the above embodiments of the present disclosure, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0123] In the several embodiments provided in this disclosure, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units described can be a logical functional division. In actual implementation, other division methods may be used. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not implemented. Furthermore, the coupling or direct coupling or communication connection shown or discussed can be through some interface, or the indirect coupling or communication connection of units or modules can be electrical or other forms.
[0124] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0125] In addition, the functional units in the various embodiments of the present disclosure may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0126] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0127] The above is only a preferred embodiment of the present disclosure. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present disclosure. These improvements and modifications should also be regarded as within the scope of protection of the present disclosure. Industrial Applicability
[0128] After determining that the target routing rule is not stored in the fixed memory, the target routing rule is promptly added to the fixed memory so that the routing rule in the fixed memory can be updated in real time. That is, when the vehicle controller changes the routing requirements, it is only necessary to update the routing rule corresponding to the vehicle controller, and there is no need to update the vehicle controller software and routing rules synchronously, thereby achieving the purpose of improving the routing rule processing efficiency, thereby realizing the technical effect of dynamic updating of routing rules, and further solving the technical problem of low routing rule processing efficiency in related technologies.
Claims
1. A routing rule processing method, comprising: Receive a routing request message sent by a vehicle controller; Parsing the routing requirement message to obtain a target routing rule of the routing requirement message; Matching the target routing rule with a preset routing rule to determine whether the target routing rule is stored in a fixed memory; In response to the target routing rule not being stored in the fixed memory, the target routing rule is added to the fixed memory, and the message sent by the vehicle controller is forwarded based on the target routing rule.
2. The routing rule processing method according to claim 1, wherein: Matching the target routing rule with a preset routing rule, and determining whether the target routing rule is stored in the fixed memory comprises: In response to the target routing rule successfully matching the preset routing rule, determining that the target routing rule is stored in the fixed memory; In response to the target routing rule failing to match the preset routing rule, it is determined that the target routing rule is not stored in the fixed memory.
3. The routing rule processing method according to claim 1, wherein: Matching the target routing rule with a preset routing rule, and determining whether the target routing rule is stored in the fixed memory comprises: In response to receiving a power-on signal, reading the preset routing rule stored in the fixed memory; Loading the preset routing rules into the running memory; The target routing rule is matched with the preset routing rule in the running memory to determine whether the target routing rule is stored in the fixed memory.
4. The routing rule processing method according to claim 3, wherein: Loading the preset routing rules into the running memory includes: Generate a first verification code corresponding to the preset routing rule; Based on the first verification code, determining whether the preset routing rule is valid; In response to the preset routing rule being invalid, ignoring the preset routing rule; In response to the preset routing rule being valid, the preset routing rule is loaded into the running memory.
5. The routing rule processing method according to claim 4, wherein: Determining whether the preset routing rule is valid based on the first verification code includes: Reading a preset verification code corresponding to the preset routing rule stored in the fixed memory; In response to the first verification code being consistent with the preset verification code, determining that the preset routing rule is valid; In response to the first verification code being inconsistent with the preset verification code, it is determined that the preset routing rule is invalid.
6. The routing rule processing method according to claim 1, wherein: Adding the target routing rule to the fixed memory includes: Generating a second verification code of the target routing rule; The target routing rule and the second verification code are stored in the fixed memory correspondingly.
7. The routing rule processing method according to claim 1, wherein: In response to the target routing rule being stored in the fixed memory, the message sent by the vehicle controller is forwarded based on the target routing rule.
8. A routing rule processing device, wherein: include: A receiving module, configured to receive a routing request message sent by a vehicle controller; A parsing module, configured to parse the routing requirement message to obtain a target routing rule of the routing requirement message; A determination module, configured to match the target routing rule with a preset routing rule, and determine whether the target routing rule is stored in a fixed memory; An adding module is configured to add the target routing rule to the fixed memory in response to the target routing rule not being stored in the fixed memory, and forward the message sent by the vehicle controller based on the target routing rule.
9. A computer-readable storage medium, wherein: The computer-readable storage medium includes a stored program, wherein when the program is executed, the processor of the device in which the program is controlled to execute the following method: Receive a routing request message sent by a vehicle controller; Parsing the routing requirement message to obtain a target routing rule of the routing requirement message; The target routing rule is matched with the preset routing rule to determine whether the target routing rule stored in fixed storage; In response to the target routing rule not being stored in the fixed memory, the target routing rule is added to the fixed memory, and the message sent by the vehicle controller is forwarded based on the target routing rule.
10. The storage medium according to claim 9, wherein when the program is running, the device where the storage medium is located is controlled to further execute the following method: In response to the target routing rule successfully matching the preset routing rule, determining that the target routing rule is stored in the fixed memory; In response to the target routing rule failing to match the preset routing rule, it is determined that the target routing rule is not stored in the fixed memory.
11. The storage medium according to claim 9, wherein when the program is running, the device where the storage medium is located is controlled to further execute the following method: In response to receiving a power-on signal, reading the preset routing rule stored in the fixed memory; Loading the preset routing rules into the running memory; The target routing rule is matched with the preset routing rule in the running memory to determine whether the target routing rule is stored in the fixed memory.
12. The storage medium according to claim 11, wherein when the program is running, the device where the storage medium is located is controlled to further execute the following method: Generate a first verification code corresponding to the preset routing rule; Based on the first verification code, determining whether the preset routing rule is valid; In response to the preset routing rule being invalid, ignoring the preset routing rule; In response to the preset routing rule being valid, the preset routing rule is loaded into the running memory.
13. The storage medium according to claim 11, wherein when the program is running, the device where the storage medium is located is controlled to further execute the following method: Reading a preset verification code corresponding to the preset routing rule stored in the fixed memory; In response to the first verification code being consistent with the preset verification code, determining that the preset routing rule is valid; In response to the first verification code being inconsistent with the preset verification code, determining that the preset routing rule is invalid effect.
14. The storage medium according to claim 9, wherein when the program is running, the device where the storage medium is located is controlled to further execute the following method: Generating a second verification code of the target routing rule; The target routing rule and the second verification code are stored in the fixed memory correspondingly.
15. The storage medium according to claim 9, when the program is running, controls the device where the storage medium is located to also execute the following method: in response to the target routing rule being stored in the fixed memory, forwarding the message sent by the vehicle controller based on the target routing rule.
16. A vehicle, wherein: include: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors execute the following method: Receive a routing request message sent by a vehicle controller; Parsing the routing requirement message to obtain a target routing rule of the routing requirement message; Matching the target routing rule with a preset routing rule to determine whether the target routing rule is stored in a fixed memory; In response to the target routing rule not being stored in the fixed memory, the target routing rule is added to the fixed memory, and the message sent by the vehicle controller is forwarded based on the target routing rule.
17. The vehicle of claim 16, wherein: The processor is further configured to run the computer program to perform the following method: In response to the target routing rule successfully matching the preset routing rule, determining that the target routing rule is stored in the fixed memory; In response to the target routing rule failing to match the preset routing rule, it is determined that the target routing rule is not stored in the fixed memory.
18. The vehicle of claim 16, wherein: The processor is further configured to run the computer program to perform the following method: In response to receiving a power-on signal, reading the preset routing rule stored in the fixed memory; Loading the preset routing rules into the running memory; The target routing rule is matched with the preset routing rule in the running memory to determine whether the target routing rule is stored in the fixed memory.
19. The vehicle of claim 18, wherein: The processor is further configured to run the computer program to perform the following method: Generate a first verification code corresponding to the preset routing rule; Based on the first verification code, determining whether the preset routing rule is valid; In response to the preset routing rule being invalid, ignoring the preset routing rule; In response to the preset routing rule being valid, the preset routing rule is loaded into the running memory.
20. The vehicle of claim 18, wherein: The processor is further configured to run the computer program to perform the following method: Reading a preset verification code corresponding to the preset routing rule stored in the fixed memory; In response to the first verification code being consistent with the preset verification code, determining that the preset routing rule is valid; In response to the first verification code being inconsistent with the preset verification code, it is determined that the preset routing rule is invalid.
Citation Information
Patent Citations
Routing rule updating method and device, computer equipment and storage medium
CN116471332A
Routing rule processing method and device, computer readable storage medium and vehicle
CN117041131A
Multiple-interface network device and selection method for transmitting network packets
US20150146523A1