A vehicle spy database one-key generation method and device

CN116775663BActive Publication Date: 2026-06-19DONGFENG AUTOMOBILE ELECTRONICS

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
DONGFENG AUTOMOBILE ELECTRONICS
Filing Date
2023-06-29
Publication Date
2026-06-19

Smart Images

  • Figure CN116775663B_ABST
    Figure CN116775663B_ABST
Patent Text Reader

Abstract

This invention discloses a one-click generation method and apparatus for Vehicle Spy databases, relating to the field of database technology. The one-click generation method for Vehicle Spy databases includes the following steps: acquiring data from each header column of a CAN matrix table, where each header column includes a name description, ID, byte content, and period; converting the data from each header column of the CAN matrix table into corresponding elements in XML, and simultaneously automatically generating channel and transmission mode header columns, thereby converting the data in the CAN matrix into a Vehicle Spy-recognizable vsdb file to generate the database. This one-click generation method for Vehicle Spy databases can replace manual input or single-cell copying with automatic batch generation, improving development and testing efficiency and avoiding errors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of database technology, specifically to a method and apparatus for one-click generation of a Vehicle Spy database. Background Technology

[0002] CAN (Controller Area Network) bus is a serial communication protocol widely used in the automotive and industrial fields. Vehicle Spy is a software tool for analyzing and diagnosing automotive network communications; we typically use it to receive and send CAN bus messages.

[0003] In the development and testing of automotive electronic products, customers provide CAN matrix documents, and staff need to compose and send messages based on the message names, IDs, transmission types, transmission cycles, and other information provided in the documents. When composing and sending messages, manual input or copying single cells is the only option, resulting in a large workload, low efficiency, and a high risk of errors. Summary of the Invention

[0004] This application provides a method, apparatus, device, and storage medium for one-click generation of a Vehicle Spy database, which can improve development and testing efficiency and avoid errors.

[0005] To achieve the above objectives, this application adopts the following technical solution:

[0006] Firstly, a method for generating a Vehicle Spy database with a single click is provided, including the following steps:

[0007] Obtain the data under each title bar of the CAN matrix table, wherein the title bar includes name description, ID, byte content and period;

[0008] The data under each header bar of the CAN matrix table is converted into the corresponding elements in XML. At the same time, the channel and transmission mode header bars are automatically generated to convert the data in the CAN matrix into a vsdb file that can be recognized by Vehicle Spy to generate a database.

[0009] In some embodiments, the simultaneous automatic generation of channel and transmission mode title bars includes:

[0010] To determine which CAN channel is being used to transmit the data under each header column of the current CAN matrix table, enter the corresponding channel number under the channel header column.

[0011] In some embodiments, converting the data under each header bar of the CAN matrix table into corresponding elements in XML includes:

[0012] Use a For loop to poll all rows of the CAN matrix table. For each row of data detected, add an XML sub-element TxMsg and make the data in each column of the CAN matrix table correspond to the sub-element in the TxMsg sub-element.

[0013] When a child element TxMsg is added, the value of the child element Key in the XML is incremented by 1, and the data under the send mode title bar is filled into the child element AutoTxType in the XML, while the data under the period title bar is filled into the child element UpdateRateMs in the XML.

[0014] Fill the formatted ID header data into the XML sub-element ByteString0, and fill the formatted byte content header data into the XML sub-element ByteString1-8;

[0015] Fill the data under the Name Description title bar into the Description sub-element of the XML.

[0016] In some embodiments, it also includes:

[0017] Check if the data under the channel title bar is 1. If it is 1, enter net1 in the NetworkKey sub-element of the XML. If it is not 1, enter net0 in the NetworkKey sub-element of the XML.

[0018] In some embodiments, it also includes:

[0019] Determine the length of the data under the ID title bar. If it is 3, enter False in the XtdFrame sub-element of the XML. If it is 8, enter True in the XtdFrame sub-element of the XML.

[0020] In some embodiments, when Chinese characters are present in the name description, the following is also included:

[0021] Use the Asc function to find Chinese characters one by one;

[0022] Use the AscW function to obtain the Unicode character code of Chinese characters and convert it to hexadecimal representation;

[0023] Add the prefix &#x before the Unicode character code of the Chinese character and the suffix; after it.

[0024] In some embodiments, the step of correcting the CAN matrix table data is also included, which includes:

[0025] Use the StrConv function to convert the data under the ID and byte content header bar to uppercase;

[0026] Use a For loop to check the ASCII codes of the data under the header bar of the byte content one by one, keep only 0 to 9 and A to F, and delete the other data as erroneous characters.

[0027] Use a For loop to extract two characters from the data below the byte content header each time, and add a space to separate each pair of bytes.

[0028] Secondly, a device for one-click generation of a Vehicle Spy database is provided, comprising:

[0029] An extraction unit is used to obtain data under each title bar of the CAN matrix table, wherein the title bar includes name description, ID, byte content and period;

[0030] The generation unit is used to convert the data under each title bar of the CAN matrix table into the corresponding elements in XML, and automatically generate the channel and transmission mode title bars to convert the data in the CAN matrix into a vsdb file that can be recognized by Vehicle Spy to generate a database.

[0031] Thirdly, a computer device is provided, comprising: a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, it implements the method described in any one of the first aspects.

[0032] Fourthly, a computer-readable storage medium is provided, on which a computer program is stored, wherein when the computer program is executed by a processor, it implements the method described in any one of the first aspects.

[0033] In this invention, data from each header column of a CAN matrix table is acquired. Each header column includes a name description, ID, byte content, and period. This data is then converted into corresponding elements in an XML file. Simultaneously, channel and transmission mode header columns are automatically generated. This process transforms the data in the CAN matrix into a vsdb file recognizable by Vehicle Spy to generate a database. This one-click Vehicle Spy database generation method replaces manual input or single-cell copying with automatic batch generation, improving development and testing efficiency and preventing errors. Attached Figure Description

[0034] Figure 1 This is a flowchart of a one-click method for generating a Vehicle Spy database according to an embodiment of the present invention;

[0035] Figure 2 This is a schematic diagram of a Vehicle Spy database one-click generation device according to an embodiment of the present invention;

[0036] Figure 3 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention. Detailed Implementation

[0037] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0038] First, the relevant concepts involved in this invention will be explained.

[0039] CAN (Controller Area Network) bus is a serial communication protocol widely used in the automotive and industrial fields. Vehicle Spy is a software tool for analyzing and diagnosing automotive network communications; we typically use it to receive and send CAN bus messages.

[0040] See Figure 1 , Figure 1 This is a flowchart illustrating a one-click method for generating a Vehicle Spy database, provided as an embodiment of the present invention. Figure 1 As shown, the method includes, but is not limited to, the following steps:

[0041] S1. Obtain the data under each title bar of the CAN matrix table, wherein the title bar includes name description, ID, byte content and period;

[0042] S2. Convert the data under each title bar of the CAN matrix table into the corresponding elements in XML, and automatically generate the channel and transmission mode title bars to convert the data in the CAN matrix into a vsdb file that can be recognized by Vehicle Spy to generate a database.

[0043] It is worth noting that in the development and testing of automotive electronic products, customers typically provide a CAN matrix document, which includes information such as message name, ID, transmission type, and transmission cycle. The generated VehicleSpy-recognizable vsdb file needs to have the channel and transmission mode added.

[0044] In some embodiments, the simultaneous automatic generation of channel and transmission mode title bars includes:

[0045] To determine which CAN channel is being used to transmit the data under each header column of the current CAN matrix table, enter the corresponding channel number under the channel header column.

[0046] It is worth noting that the channels are divided into "0" and "1" channels, and the corresponding channel number is recorded according to the data output selection;

[0047] The sending methods are divided into "0", "1" and "2" modes. The corresponding mode number is recorded according to the selected sending data.

[0048] The "0" mode is automatic transmission at periodic intervals;

[0049] The "1" method means that one frame is sent for each confirmation.

[0050] The "2" method involves automatically sending data at periodic intervals after confirmation, and stopping sending data upon cancellation.

[0051] In some embodiments, converting the data under each header bar of the CAN matrix table into corresponding elements in XML includes:

[0052] Use a For loop to poll all rows of the CAN matrix table. For each row of data detected, add an XML sub-element TxMsg and make the data in each column of the CAN matrix table correspond to the sub-element in the TxMsg sub-element.

[0053] When a child element TxMsg is added, the value of the child element Key in the XML is incremented by 1, and the data under the send mode title bar is filled into the child element AutoTxType in the XML, while the data under the period title bar is filled into the child element UpdateRateMs in the XML.

[0054] Fill the formatted ID header data into the XML sub-element ByteString0, and fill the formatted byte content header data into the XML sub-element ByteString1-8;

[0055] Fill the data under the Name Description title bar into the Description sub-element of the XML.

[0056] Check if the data under the channel title bar is 1. If it is 1, enter net1 in the NetworkKey sub-element of the XML. If it is not 1, enter net0 in the NetworkKey sub-element of the XML.

[0057] In some embodiments, when Chinese characters are present in the name description, the following is also included:

[0058] Use the Asc function to find Chinese characters one by one;

[0059] Use the AscW function to obtain the Unicode character code of Chinese characters and convert it to hexadecimal representation;

[0060] Add the prefix &#x before the Unicode character code of the Chinese character and the suffix; after it.

[0061] In some embodiments, the step of correcting the CAN matrix table data is also included, which includes:

[0062] Use the StrConv function to convert the data under the ID and byte content header bar to uppercase;

[0063] Use a For loop to check the ASCII codes of the data under the header bar of the byte content one by one, keep only 0 to 9 and A to F, and delete the other data as erroneous characters.

[0064] Use a For loop to extract two characters from the data below the byte content header each time, and add a space to separate each pair of bytes.

[0065] One byte is represented by two characters, so a For loop is used again to retrieve two characters from the "byte content" column each time and add a space to separate each two bytes, making it easier to check the data length and correctness.

[0066] It is worth noting that identifying the data in the four modules of "Name Description", "ID", "Byte Content" and "Period" in the customer CAN matrix table and performing error detection on them helps to detect errors in a timely manner and avoid other impacts caused by subsequent erroneous messages.

[0067] The Vehicle Spy database one-click generation method of the present invention obtains data from each header column of a CAN matrix table, wherein the header column includes name description, ID, byte content, and period; converts the data under each header column of the CAN matrix table into corresponding elements in XML, and automatically generates channel and transmission mode header columns, thereby converting the data in the CAN matrix into a vsdb file recognizable by Vehicle Spy to generate the database. This one-click generation method of the Vehicle Spy database in the present invention can replace manual input or single-cell copying with automatic batch generation, improving development and testing efficiency and avoiding errors.

[0068] See Figure 2 This invention also provides a one-click device for generating a Vehicle Spy database, comprising:

[0069] An extraction unit is used to obtain data under each title bar of the CAN matrix table, wherein the title bar includes name description, ID, byte content and period;

[0070] The generation unit is used to convert the data under each title bar of the CAN matrix table into the corresponding elements in XML, and automatically generate the channel and transmission mode title bars to convert the data in the CAN matrix into a vsdb file that can be recognized by Vehicle Spy to generate a database.

[0071] In some embodiments, the generation unit is used to: automatically generate channel and transmission mode title bars, including: the data under each title bar of the current CAN matrix table, and fill in the corresponding channel number under the channel title bar if a CAN channel needs to be used for transmission.

[0072] In some embodiments, the generation unit is further configured to: convert the data under each title bar of the CAN matrix table into corresponding elements in XML, including:

[0073] Use a For loop to poll all rows of the CAN matrix table. For each row of data detected, add an XML sub-element TxMsg and make the data in each column of the CAN matrix table correspond to the sub-element in the TxMsg sub-element.

[0074] When a child element TxMsg is added, the value of the child element Key in the XML is incremented by 1, and the data under the send mode title bar is filled into the child element AutoTxType in the XML, while the data under the period title bar is filled into the child element UpdateRateMs in the XML.

[0075] Fill the formatted ID header data into the XML sub-element ByteString0, and fill the formatted byte content header data into the XML sub-element ByteString1-8;

[0076] Fill the data under the Name Description title bar into the Description sub-element of the XML.

[0077] Check if the data under the channel title bar is 1. If it is 1, enter net1 in the NetworkKey sub-element of the XML. If it is not 1, enter net0 in the NetworkKey sub-element of the XML.

[0078] In some embodiments, the generation unit is further configured to: when Chinese characters are present in the name description, further include: using the Asc function to find Chinese characters one by one; using the AscW function to obtain the Unicode character code of the Chinese characters and convert it to hexadecimal representation; adding the &#x prefix before the Unicode character code of the Chinese characters and adding a ; suffix after it.

[0079] In some embodiments, the generation unit is also used for: the step of correcting CAN matrix table data, which includes: using the StrConv function to convert the ID and the data under the byte content title bar into uppercase; using a For loop to judge the ASCII code of the data under the byte content title bar one by one, keeping only 0 to 9 and A to F, and deleting other data as erroneous characters; using a For loop to extract 2 characters from the data under the byte content title bar each time, adding a space to separate every two bytes.

[0080] The Vehicle Spy database one-click generation device in this invention is used to acquire data from each header column of a CAN matrix table, where each header column includes a name description, ID, byte content, and period; convert the data from each header column of the CAN matrix table into corresponding elements in XML; and simultaneously automatically generate channel and transmission mode header columns, thereby converting the data in the CAN matrix into a Vehicle Spy-recognizable vsdb file to generate a database. This allows for automatic batch generation instead of manual input or single-cell copying, improving development and testing efficiency and avoiding errors.

[0081] It should be noted that the step numbers in the embodiments of this application do not limit the order of operations in the technical solution of this application.

[0082] It should be noted that those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device and each unit can be referred to the corresponding process in the aforementioned embodiment of the one-click generation method for the Vehicle Spy database, and will not be repeated here.

[0083] The apparatus provided in the above embodiments can be implemented as a computer program, which can be used in, for example... Figure 3 It runs on the computer device shown.

[0084] This application also provides a computer device, including: a memory, a processor, and a network interface connected via a system bus, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement all or part of the steps of the aforementioned one-click generation method for the Vehicle Spy database.

[0085] The network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0086] A processor can be a CPU, or other general-purpose processors, DSPs (Digital Signal Processors), ASICs (Application Specific Integrated Circuits), FPGAs (Field Programmable Gate Arrays), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor, or any conventional processor. The processor is the control center of a computer device, connecting all parts of the computer device through various interfaces and lines.

[0087] Memory can be used to store computer programs and / or modules. The processor implements various functions of the computer device by running or executing the computer programs and / or modules stored in the memory, and by accessing data stored in the memory. Memory can mainly include a program storage area and a data storage area. The program storage area can store the operating system, at least one application program required for a function (such as video playback, image playback, etc.), etc.; the data storage area can store data created based on the use of the mobile phone (such as video data, image data, etc.). Furthermore, memory can include high-speed random access memory (RAM), and can also include non-volatile memory, such as hard disks, RAM, plug-in hard disks, SMC (Smart MediaCard), SD (Secure Digital) cards, flash cards, at least one disk storage device, flash memory device, or other volatile solid-state storage devices.

[0088] This application also provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements all or part of the steps of the aforementioned one-click generation method for the Vehicle Spy database.

[0089] The embodiments of this application can implement all or part of the aforementioned processes, or they can be accomplished by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various methods described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, ROM (Read-Only memory), RAM (Random Access memory), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.

[0090] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, servers, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.

[0091] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0092] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0093] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A one-click generation method of a Vechicle Spy database, characterized in that, The method includes the following steps: Obtain the data under each title bar of the CAN matrix table, wherein the title bar includes name description, ID, byte content and period; The data under each header bar of the CAN matrix table is converted into the corresponding elements in XML. At the same time, the channel and transmission mode header bars are automatically generated to convert the data in the CAN matrix into a vsdb file that can be recognized by Vehicle Spy to generate a database. The simultaneous automatic generation of channel and transmission mode title bars includes: For the data under each header column of the current CAN matrix table, enter the corresponding channel number under the channel header column to indicate which CAN channel is being used for transmission. The process of converting the data under each header bar of the CAN matrix table into corresponding elements in XML includes: Use a For loop to poll all rows of the CAN matrix table. For each row of data detected, add an XML sub-element TxMsg and make the data in each column of the CAN matrix table correspond to the sub-element in the TxMsg sub-element. When a child element TxMsg is added, the value of the child element Key in the XML is incremented by 1, and the data under the send mode title bar is filled into the child element AutoTxType in the XML, while the data under the period title bar is filled into the child element UpdateRateMs in the XML. Fill the formatted ID header data into the XML sub-element ByteString0, and fill the formatted byte content header data into the XML sub-element ByteString1-8; Fill the data under the name and description title bar into the Description sub-element of the XML; It also includes the step of correcting the CAN matrix table data, which includes: Use the StrConv function to convert the data under the ID and byte content header bar to uppercase; Use a For loop to check the ASCII codes of the data under the header bar of the byte content one by one, keep only 0 to 9 and A to F, and delete the other data as erroneous characters. Use a For loop to extract two characters from the data below the byte content header each time, and add a space to separate each pair of bytes.

2. A one-click database generation method for Vehicle Spy as claimed in claim 1, wherein, Also includes: Check if the data under the channel title bar is 1. If it is 1, enter net1 in the NetworkKey sub-element of the XML. If it is not 1, enter net0 in the NetworkKey sub-element of the XML.

3. The method for one-click generation of a Vehicle Spy database as described in claim 1, characterized in that, Also includes: Determine the length of the data under the ID title bar. If it is 3, enter False in the XtdFrame sub-element of the XML. If it is 8, enter True in the XtdFrame sub-element of the XML.

4. The method for one-click generation of a Vehicle Spy database as described in claim 1, characterized in that, When the name description contains Chinese characters, it also includes: Use the Asc function to find Chinese characters one by one; Use the AscW function to obtain the Unicode character code of Chinese characters and convert it to hexadecimal representation; Add the prefix &#x before the Unicode character code of the Chinese character and the suffix; after it.

5. A Vehicle Spy database one-click generation device employing the Vehicle Spy database one-click generation method as described in any one of claims 1 to 4, characterized in that, include: An extraction unit is used to obtain data under each title bar of the CAN matrix table, wherein the title bar includes name description, ID, byte content and period; The generation unit is used to convert the data under each title bar of the CAN matrix table into the corresponding elements in XML, and automatically generate the channel and transmission mode title bars to convert the data in the CAN matrix into a vsdb file that can be recognized by Vehicle Spy to generate a database.

6. A computer device, comprising: The computer device includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein the computer program, when executed by the processor, performs the steps as described in any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 4.