Data writing method and device for production line, electronic equipment and storage medium
By using the cache device and the CAN bus on the production line equipment, we ensure that data is successfully written to the non-volatile memory of the on-board product, solving the product uninitialization problem caused by data writing failure, and improving production efficiency and OTA function of the whole vehicle.
Patent Information
- Application Number
- CN202311558864.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-21
- Publication Date
- 2025-05-30
AI Technical Summary
During the production process of on-board products, data writing failure results in the product not being initialized, affecting production efficiency and the product's OTA function of the vehicle.
By storing data in the cache device on the production line device and sending trigger instructions to trigger data writing through the CAN bus, ensuring that data is successfully written to the non-volatile memory of the product.
It realizes that data is completely dropped on the production line, avoids the problem of uninitialization of products, improves production efficiency, and ensures the OTA function of the entire vehicle of the product.
Smart Images

Figure CN120066376A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicles, and particularly to a data writing method, apparatus, electronic device, and storage medium for a production line. Background Art
[0002] During the production process of in-vehicle products (such as vehicle controllers, etc.), information such as version numbers, part numbers, and configurations need to be written on the production line. However, in the current production process, there are sometimes situations where the above-mentioned data (version numbers, part numbers, configurations, etc.) written cannot be successfully saved to disk, resulting in the product not being initialized, and thus may lead to product repair and the inability to perform vehicle OTA (Over-The-Air technology). If the normal power-off process is used to write data, it will affect the production line rhythm and reduce production efficiency. Summary of the Invention
[0003] The present invention is completed to solve the above problems, and its purpose is to provide a data writing method, apparatus, electronic device, and storage medium for a production line, which can ensure that the data written to the product on the production line is completely saved to the product.
[0004] According to one aspect of the present invention, there is provided a data writing method for a production line, including the following steps: when writing data to a product on a production line device, storing the data in a buffer device, and sending a trigger instruction for triggering data writing through a CAN bus; after the product receives the trigger instruction, confirming whether it can be executed, if it can be executed, sending a positive response to the production line device, and performing an operation of writing the data in the buffer device to the non-volatile memory of the product; when a preset time has elapsed after sending the trigger instruction, the production line device sends a query instruction through the CAN bus; and if the data is successfully written to the non-volatile memory, the product sends a positive response to the production line device.
[0005] Preferably, the data includes a version number, a part number, and configuration information.
[0006] Preferably, when writing data to a product on a production line device, storing the data in a buffer device, and sending a trigger instruction for triggering data writing through a CAN bus, using the first diagnostic routine DID in the UDS protocol as the trigger instruction.
[0007] Preferably, when a preset time has elapsed after sending the trigger instruction, the production line device sends a query instruction through the CAN bus, using the second diagnostic routine DID in the UDS protocol as the query instruction.
[0008] Preferably, in the operation of writing the data into the non-volatile memory of the product, it includes: writing the data in the cache device into the data storage unit of the non-volatile memory; and after the data writing is completed, confirming whether the data written in the data storage unit is consistent with that in the cache device, and if it is consistent, it is confirmed that the data is successfully written.
[0009] According to another aspect of the present invention, there is provided a data writing device for a production line, including: a trigger module, configured to store the data in a cache device and send a trigger instruction for triggering data writing through a CAN bus when writing data to a product on a production line device; an execution module, configured to confirm whether it can be executed after the product receives the trigger instruction, and if it can be executed, send a positive response to the production line device and perform an operation of writing the data in the cache device into the non-volatile memory of the product; a query module, configured to when a preset time has passed after sending the trigger instruction, the production line device sends a query instruction through the CAN bus; and a response module, configured to if the data is successfully written into the non-volatile memory, the product sends a positive response to the production line device.
[0010] According to another aspect of the present invention, there is provided an electronic device, the electronic device includes a processor and a memory, and at least one instruction or at least one program segment is stored in the memory, and the at least one instruction or the at least one program segment is loaded and executed by the processor to perform the method described in the above aspect.
[0011] According to another aspect of the present invention, there is provided a computer storage medium, and at least one instruction or at least one program segment is stored in the storage medium, and the at least one instruction or the at least one program segment is loaded and executed by a processor to perform the method described in the above aspect of the claims. Description of the Drawings
[0012] Figure 1 It is a schematic flow chart of a data writing method for a production line provided by an embodiment of the present invention.
[0013] Figure 2 It is a structural block diagram of a data writing device for a production line provided by an embodiment of the present invention.
[0014] Figure 3 It is a structural block diagram of an electronic device provided by an embodiment of the present invention. Detailed Embodiments
[0015] Next, the present invention will be further described in detail with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than limiting the invention. Additionally, it should be noted that for the sake of convenience of description, only the parts related to the relevant invention are shown in the drawings.
[0016] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a" and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "comprises" and / or "consists of" are used in this specification, the specified features, wholes, steps, operations, elements, and / or components are present, but do not preclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their groups.
[0017] The embodiments described herein may be described with reference to plan views and / or cross-sectional views by means of ideal schematic diagrams of the present disclosure. Therefore, the example illustrations can be modified according to manufacturing techniques and / or tolerances. Therefore, the embodiments are not limited to the embodiments shown in the drawings, but include modifications of configurations formed based on manufacturing processes. Therefore, the regions illustrated in the drawings have schematic properties, and the shapes of the regions shown in the drawings illustrate the specific shapes of the regions of the elements, but are not intended to be restrictive.
[0018] Unless otherwise defined, the meanings of all terms (including technical and scientific terms) used herein are the same as those commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in common dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning, unless expressly so defined herein.
[0019] The method and device for writing vehicle controller data for a production line provided by the embodiments of the present invention are based on the same concept. Since the principles for the method and device to solve problems are similar, the implementation of the device and the method can be referred to each other, and the repeated parts will not be elaborated.
[0020] Figure 1 is a flowchart of the data writing method for a production line provided by the embodiments of the present invention. This specification provides method operation steps such as in the embodiments or flowcharts, but based on routine or non-creative labor, there may be more or fewer operation steps. The order of steps listed in the embodiments is only one way among the execution orders of numerous steps and does not represent the only execution order. When the actual system or server product executes, it can be executed in the order of the method shown in the embodiments or the drawings, or executed in parallel (for example, in an environment of parallel processors or multi-threaded processing).
[0021] AsFigure 1 As shown, the data writing method for the production line provided in this embodiment includes the following steps.
[0022] S101: When writing data to a product on a production line device, store the data in a buffer device and send a trigger instruction for triggering data writing via a CAN bus.
[0023] When data needs to be written to a product on the production line, in this embodiment, the product is set as a vehicle controller, and the data to be written will be stored in a buffer device. Then, a trigger instruction for triggering data writing is sent to the vehicle controller via a CAN bus. Generally, the data to be written to the product includes a version number, a part number, configuration information, etc.
[0024] Here, a certain diagnostic routine DID (such as 31 01F0 13) in the Unified diagnostic services (UDS) protocol can be used as the trigger instruction, and the diagnostic routine DID is sent to the vehicle controller via a CAN bus, which can trigger the vehicle controller to perform the operation of writing data.
[0025] S102: After the product receives the trigger instruction, confirm whether it can be executed. If it can be executed, send a positive response to the production line device and perform the operation of writing the data in the buffer device to the non-volatile memory of the product.
[0026] After the in-vehicle controller receives the above diagnostic routine DID (31 01F0 13), first confirm whether it can be executed. If it can be executed, send a positive response to the production line device, and the in-vehicle controller writes the data (version number, part number, configuration information, etc.) in the buffer device to its own non-volatile memory. Specifically, first, write the data in the buffer device to the data storage unit (dflash) of the non-volatile memory of the in-vehicle controller. Then, after the data writing is completed, confirm whether the data written in the data storage unit is the same as that in the buffer device. If it is the same, it is confirmed that the data is successfully written.
[0027] S103: When the preset time has passed after sending the trigger instruction, the production line device sends a query instruction via the CAN bus.
[0028] The preset time can be set according to requirements. For example, it can be set to 1 second, that is, when 1 second has passed after the production line device sends the trigger instruction, a query instruction is sent via the CAN bus.
[0029] Similarly, another diagnostic routine DID (such as 31 03F0 13) in the UDS protocol can be used as the trigger instruction, and the diagnostic routine DID is sent to the vehicle controller via a CAN bus to query whether the data has been successfully written to the disk.
[0030] S104: If the data is successfully written into the non-volatile memory, the product sends a positive response to the production line equipment.
[0031] If it is confirmed in step S102 that the data is successfully written, after receiving the query instruction, the product sends a positive response to the production line equipment.
[0032] Figure 2 It is a structural block diagram of the data writing device 200 for the production line provided by an embodiment of the present invention.
[0033] As Figure 2 shown, the data writing device 200 for the production line includes: a trigger module 201, an execution module 202, a query module 203, and a response module 204.
[0034] Among them, the trigger module 201 is used to store the data in the buffer device when writing data to the product on the production line equipment, and send a trigger instruction for triggering data writing through the CAN bus. The execution module 202 is used to confirm whether it can be executed after the product receives the trigger instruction. If it can be executed, it sends a positive response to the production line equipment and performs the operation of writing the data in the buffer device into the non-volatile memory of the product. The query module 203 is used to send a query instruction through the CAN bus by the production line equipment when a preset time has passed after sending the trigger instruction. The response module 204 is used to send a positive response to the production line equipment if the data is successfully written into the non-volatile memory.
[0035] Figure 3 It is a structural block diagram of the electronic device provided by an embodiment of the present invention. As Figure 3 shown, the present invention also provides an electronic device 300, which includes a processor and a memory. At least one instruction or at least one program segment is stored in the memory, and the at least one instruction or the at least one program segment is loaded and executed by the processor to perform the method described in the above embodiments.
[0036] The present invention also provides a computer storage medium, in which at least one instruction or at least one program segment is stored, and the at least one instruction or the at least one program segment is loaded and executed by the processor to implement the method described in the above embodiments.
[0037] Optionally, in this embodiment, the above storage medium may be located in at least one of multiple network servers in a computer network. Optionally, in this embodiment, the above storage medium may include, but is not limited to: various media that can store program codes such as USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs.
[0038] Those skilled in the art should be able to realize that the modules, units, and method steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of electronic hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in the form of electronic hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0039] Although the present invention has been described with reference to the current specific embodiments, those of ordinary skill in the art in the technical field of the present invention should recognize that the scope of the invention involved in the present invention is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the technical solutions formed by mutually replacing the above features with the (but not limited to) technical features having similar functions disclosed in the present invention.
Claims
1. A data writing method for a production line, characterized in that, it includes the following steps: When writing data to a product on a production line device, store the data in a cache device and send a trigger instruction for triggering data writing through a CAN bus; After receiving the trigger instruction, the product confirms whether it can be executed. If it can be executed, it sends a positive response to the production line device and performs the operation of writing the data in the cache device to the non-volatile memory of the product; When a preset time has passed after sending the trigger instruction, the production line device sends a query instruction through the CAN bus; and If the data is successfully written to the non-volatile memory, the product sends a positive response to the production line device.
2. The data writing method for a production line according to claim 1, characterized in that, the data includes a version number, a part number, and configuration information.
3. The data writing method for a production line according to claim 1 or 2, characterized in that, When writing data to a product on a production line device, store the data in a cache device and send a trigger instruction for triggering data writing through a CAN bus, use the first diagnostic routine DID in the UDS protocol as the trigger instruction.
4. The data writing method for a production line according to claim 1 or 2, characterized in that, When a preset time has passed after sending the trigger instruction, the production line device sends a query instruction through the CAN bus, use the second diagnostic routine DID in the UDS protocol as the query instruction.
5. The data writing method for a production line according to claim 1 or 2, characterized in that, In the operation of writing the data to the non-volatile memory of the product, it includes: Writing the data in the cache device to the data storage unit of the non-volatile memory; and After the data writing is completed, confirm whether the data written in the data storage unit is the same as that in the cache device. If it is the same, it is confirmed that the data is successfully written.
6. A data writing device for a production line, characterized in that, it includes: A trigger module, used for when writing data to a product on a production line device, storing the data in a cache device and sending a trigger instruction for triggering data writing through a CAN bus; An execution module, used for after the product receives the trigger instruction, confirming whether it can be executed. If it can be executed, it sends a positive response to the production line device and performs the operation of writing the data in the cache device to the non-volatile memory of the product; A query module, used for when a preset time has passed after sending the trigger instruction, the production line device sends a query instruction through the CAN bus; and A response module, used for if the data is successfully written to the non-volatile memory, the product sends a positive response to the production line device.
7. An electronic device, characterized in that, the electronic device includes a processor and a memory. At least one instruction or at least one program segment is stored in the memory, and the at least one instruction or the at least one program segment is loaded and executed by the processor to perform the method according to any one of claims 1 to 5.
8. A computer storage medium, characterized in that, at least one instruction or at least one program segment is stored in the storage medium, and the at least one instruction or the at least one program segment is loaded and executed by a processor to perform the method according to any one of claims 1 to 5.