Data configuration method and apparatus, terminal device, and storage medium

CN116896502BActive Publication Date: 2026-09-11SHENZHEN HANGSHENG ELECTRONICS +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310772101.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-27
Publication Date
2026-09-11
Estimated Expiration
2043-06-27

AI Technical Summary

Technical Problem

[0004]本申请的主要目的在于提供一种数据配置方法、装置、终端设备以及存储介质,旨在解决传统的车载娱乐系统主处理器与微控制器之间的数据通讯耦合性太高,无法做到平台化的问题

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116896502B_ABST
    Figure CN116896502B_ABST
Patent Text Reader

Abstract

The application discloses a data configuration method and device, a terminal equipment and a storage medium. The method comprises the following steps: receiving a message configuration request sent by a front end, wherein the message configuration request comprises a main processor and a microcontroller communication related configuration message; performing configuration data analysis according to the main processor and the microcontroller communication related configuration message in the message configuration request; generating a communication code between the main processor and the microcontroller according to a configuration data analysis result; and uploading the communication code to a project configuration library. The application solves the problem that the data communication coupling between a main processor and a microcontroller of a traditional vehicle-mounted entertainment system is too high, realizes the configuration platformization of the communication code between the main processor and the microcontroller, and reduces the labor cost of communication data structure receiving and sending definition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vehicle-mounted system communication, and more particularly to a data configuration method, apparatus, terminal device, and storage medium. Background Technology

[0002] With the development of automotive in-vehicle entertainment systems, the controller domain network data and vehicle power supply variations differ across different vehicle models. Web-based automated configuration to generate MCU / SOC communication code transforms interface definitions into a visual method for adding configurations, adapting the communication data structure accordingly.

[0003] However, traditional in-vehicle entertainment systems rely on pre-defined data structures for data communication between the main processor and the microcontroller. This requires standardized code operations, resulting in high data communication coupling and high management and development costs. Furthermore, it is prone to confusion when dealing with large amounts of information, and errors can easily lead to memory leaks. Portability across different projects and platforms is also low, hindering platformization. Summary of the Invention

[0004] The main purpose of this application is to provide a data configuration method, apparatus, terminal device, and storage medium, which aims to solve the problem that the data communication between the main processor and microcontroller of traditional in-vehicle entertainment systems is too highly coupled, making it impossible to achieve platformization.

[0005] To achieve the above objectives, this application provides a data configuration method, the data configuration method comprising:

[0006] Receive a message configuration request sent by the front end, the message configuration request including configuration messages related to communication between the main processor and the microcontroller;

[0007] Perform configuration data analysis based on the main processor and microcontroller communication-related configuration messages in the configuration request message;

[0008] Based on the configuration data analysis results, the communication code between the main processor and the microcontroller is generated;

[0009] Upload the communication code to the project configuration library.

[0010] Optionally, the configuration messages related to communication between the main processor and the microcontroller include one or more of the following: message direction, message parameters, and parameter types.

[0011] Optionally, the step of generating communication code between the main processor and the microcontroller based on the configuration data analysis results includes:

[0012] Based on the analysis results of the configuration data, a message protocol file is generated;

[0013] The message protocol file is serialized to generate communication code between the main processor and the microcontroller.

[0014] Optionally, after the step of generating the communication code between the main processor and the microcontroller based on the configuration data analysis results, the method further includes:

[0015] Automated testing of data transmission is performed on the communication code between the main processor and the microcontroller;

[0016] If the automated test is successful, proceed to step 1: Upload the communication code to the project configuration library.

[0017] Optionally, after the step of uploading the communication code to the project configuration repository, the method further includes:

[0018] Record the operation information of the relevant configuration messages and back up the communication code;

[0019] Generate a notification email based on the relevant configuration messages;

[0020] The notification email was sent to the relevant personnel of the main processor and microcontroller.

[0021] Upon receiving communication instructions from the main processor and microcontroller, the corresponding communication code is retrieved from the project configuration library;

[0022] The data transmission between the main processor and the microcontroller is controlled according to the communication code.

[0023] Optionally, the operation information in the relevant configuration message includes one or more of the following: modification point, modification time, and modification personnel.

[0024] Optionally, after the steps of recording the operation information of the relevant configuration messages and backing up the communication code, the method further includes:

[0025] Upon receiving a configuration rollback instruction, the project configuration library is rolled back based on the recorded operation messages and the backed-up data.

[0026] This application also proposes a data configuration device, the data configuration device comprising:

[0027] Data receiving module: used to receive message configuration requests sent by the front end, the message configuration requests including configuration messages related to communication between the main processor and the microcontroller;

[0028] Data Analysis Module: Used to perform configuration data analysis on configuration messages related to communication between the main processor and microcontroller in the message configuration request;

[0029] Code generation module: Used to generate communication code between the main processor and the microcontroller based on the configuration data analysis results;

[0030] Code upload module: Used to upload communication code to the project configuration library.

[0031] This application also proposes a terminal device, which includes a memory, a processor, and a data configuration program stored in the memory and executable on the processor. When the data configuration program is executed by the processor, it implements the steps of the data configuration method described above.

[0032] This application also proposes a computer-readable storage medium storing a data configuration program, which, when executed by a processor, implements the steps of the data configuration method described above.

[0033] The data configuration method, apparatus, terminal device, and storage medium proposed in this application embodiment receive a message configuration request sent by a front end. The message configuration request includes configuration messages related to communication between the main processor and the microcontroller. Configuration data is analyzed based on the main processor and microcontroller communication-related configuration messages in the message configuration request. Based on the configuration data analysis results, communication code between the main processor and the microcontroller is generated. The communication code is then uploaded to a project configuration library. This invention's solution, based on automated configuration generation of communication code between the main processor and the microcontroller via a web page, solves the problem of excessively high data communication coupling between the main processor and the microcontroller in traditional in-vehicle entertainment systems, which prevents platform-based implementation. Attached Figure Description

[0034] Figure 1 This is a schematic diagram of the functional modules of the terminal device to which the data configuration device of this application belongs;

[0035] Figure 2 A flowchart illustrating a first exemplary embodiment of the data configuration method of this application;

[0036] Figure 3 The overall system architecture diagram for the data configuration method function in this application is shown below;

[0037] Figure 4 A flowchart illustrating a second exemplary embodiment of the data configuration method of this application;

[0038] Figure 5 Flowchart for generating the data configuration method document for this application;

[0039] Figure 6 A flowchart illustrating a third exemplary embodiment of the data configuration method of this application;

[0040] Figure 7 This is a flowchart illustrating the fourth exemplary embodiment of the data configuration method of this application;

[0041] Figure 8 Flowchart of the overall scheme for the data configuration method of this application;

[0042] Figure 9 This is a flowchart illustrating the fifth exemplary embodiment of the data configuration method of this application.

[0043] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0044] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application. The main solution of this application's embodiments is: receiving a message configuration request sent by the front end, the message configuration request including configuration messages related to communication between the main processor and the microcontroller; performing configuration data analysis based on the configuration messages related to communication between the main processor and the microcontroller in the message configuration request; generating communication code between the main processor and the microcontroller based on the configuration data analysis results; and uploading the communication code to the project configuration library. This solution generates communication code between the main processor and the microcontroller based on automated configuration via a web page, effectively solving the problem of excessively high data communication coupling between the main processor and the microcontroller in traditional in-vehicle entertainment systems, and realizing a platform-based configuration of the communication code between the main processor and the microcontroller.

[0045] Technical terms used in this application:

[0046] Main processor: SOC, is the core processor of the system, responsible for human-computer interaction and related function implementation (based on Android, Linux and other systems), and provides services after processing vehicle information.

[0047] Microcontroller (MCU): Primarily responsible for power management of the in-vehicle entertainment system and data transmission and reception via the vehicle controller area network (CAN), providing vehicle information to the SOC.

[0048] Message protocol file: Proto file, a language used to define data structures and message formats for customizing data structures for data transmission between the main processor and microcontroller.

[0049] Data serialization: Nanopb is also a lightweight Protobuf library that supports the C language and can be used on microcontrollers such as STM32. It can encode and decode Proto files to generate communication code between the main processor and the microcontroller.

[0050] Protobuf: Protobuf is a data format developed by Google, similar to XML, capable of serializing structured data. It can be used for data storage, communication protocols, and more. It is language- and platform-independent and highly extensible. The core of Protobuf is a .proto file. We define a custom .proto file to create our protocol data, and then use the protoc tool to compile it into C code, resulting in two files: a header file and a source file.

[0051] The embodiments of this application take into account that the relevant technical solutions are based on long-connection data transmission using an asynchronous transceiver transmitter (UART) / serial peripheral interface (SPI). The communication data interface requires MCU engineers and SOC engineers to write the sending and receiving code according to the agreed data structure, and upload the configuration library at the same time. This requires a lot of learning and manpower costs, has high requirements for version control, and is inefficient and prone to errors.

[0052] Based on this, this application proposes a solution that can platformize the configuration of communication code between the main processor and the microcontroller, thereby enabling automatic generation of MCU / SOC communication code through web page configuration.

[0053] Specifically, refer to Figure 1 , Figure 1 This is a functional module diagram of the terminal device to which the data configuration device belongs in this application. The data configuration device can be a data processing device independent of the terminal device, and it can be carried on the terminal device in hardware or software form. The terminal device can be a smart mobile device with data processing capabilities, such as a mobile phone or tablet computer, or it can be a fixed terminal device or server with data processing capabilities.

[0054] In this embodiment, the terminal device to which the data configuration device belongs includes at least an output module 110, a processor 120, a memory 130, and a communication module 140.

[0055] The memory 130 stores the operating system and data configuration program. The data configuration device can store received and processed data, as well as configuration templates for the message processing cluster, in the memory 130. The output module 110 can be a display screen, speaker, etc. The communication module 140 can include a WIFI module, a mobile communication module, and a Bluetooth module, etc., and communicates with external devices or servers through the communication module 140.

[0056] When the data configuration program in memory 130 is executed by the processor, it performs the following steps:

[0057] Receive a message configuration request sent by the front end, the message configuration request including configuration messages related to communication between the main processor and the microcontroller;

[0058] Perform configuration data analysis based on the main processor and microcontroller communication-related configuration messages in the configuration request message;

[0059] Based on the configuration data analysis results, the communication code between the main processor and the microcontroller is generated;

[0060] Upload the communication code to the project configuration library.

[0061] Furthermore, when the data configuration program in memory 130 is executed by the processor, it also performs the following steps:

[0062] Based on the analysis results of the configuration data, a message protocol file is generated;

[0063] The message protocol file is serialized to generate communication code between the main processor and the microcontroller.

[0064] Furthermore, when the data configuration program in memory 130 is executed by the processor, it also performs the following steps:

[0065] Automated testing of data transmission is performed on the communication code between the main processor and the microcontroller;

[0066] If the automated test is successful, proceed to step 1: Upload the communication code to the project configuration library.

[0067] Furthermore, when the data configuration program in memory 130 is executed by the processor, it also performs the following steps:

[0068] Record the operation information of the relevant configuration messages and back up the communication code;

[0069] Generate a notification email based on the relevant configuration messages;

[0070] The notification email was sent to the relevant personnel of the main processor and microcontroller.

[0071] Upon receiving communication instructions from the main processor and microcontroller, the corresponding communication code is retrieved from the project configuration library;

[0072] The data transmission between the main processor and the microcontroller is controlled according to the communication code.

[0073] Furthermore, when the data configuration program in memory 130 is executed by the processor, it also performs the following steps:

[0074] Upon receiving a configuration rollback instruction, the project configuration library is rolled back based on the recorded operation messages and the backed-up data.

[0075] This embodiment, through the above-described scheme, specifically involves receiving a message configuration request sent by the front end. This message configuration request includes configuration messages related to communication between the main processor and the microcontroller. Configuration data is analyzed based on these messages. Based on the analysis results, communication code between the main processor and the microcontroller is generated. This communication code is then uploaded to the project configuration library. This scheme, based on automated web-based configuration to generate communication code between the main processor and the microcontroller, solves the problem of high data communication coupling between the main processor and the microcontroller in traditional in-vehicle entertainment systems, which prevents platformization. Based on this embodiment, addressing the low efficiency of existing data configuration technologies, a data configuration method is designed by combining automated web-based configuration. The effectiveness of this method is verified during data configuration, and finally, platformization of data configuration is achieved through this method.

[0076] Based on, but not limited to, the terminal device architecture described above, this invention proposes an embodiment of the method. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order. The executing entity of this embodiment's method can be a data configuration device, a data configuration terminal device, or a server. This embodiment uses a data configuration device as an example, which can be integrated into a terminal device with data processing capabilities.

[0077] Reference Figure 2 , Figure 2 This is a flowchart illustrating a first exemplary embodiment of the data configuration method of this application.

[0078] An embodiment of the present invention provides a data configuration method, the method comprising:

[0079] Step S10: Receive a message configuration request sent by the front end. The message configuration request includes configuration messages related to communication between the main processor and the microcontroller.

[0080] In order to decouple the communication data between the main processor and the microcontroller of the in-vehicle entertainment system and realize the data configuration platform, this embodiment designs a corresponding data configuration program.

[0081] One implementation method involves receiving configuration requests from the front end, analyzing the configuration data related to communication between the main processor and the microcontroller in the configuration requests to obtain configuration data analysis results, generating communication code between the main processor and the microcontroller, and uploading the communication code to the project configuration library. This enables the configuration of data communication between the main processor and the microcontroller, improving the efficiency of data configuration.

[0082] It uses a B / S architecture, deployed based on Node.js. The front-end is implemented using JS+HTML+CSS, and the back-end uses JS+SQLite3. The front-end is configured, and the back-end automatically generates MCU and SOC code. Interface definitions are transformed into a visual configuration-based approach, overcoming the drawbacks of high manual costs, complexity, difficulty in understanding, and susceptibility to errors in defining communication data structures. This platform-based approach is simple, efficient, easy to maintain, and can be easily applied to multiple projects.

[0083] Based on a browser, no client installation is required, allowing for convenient and quick modification and generation anywhere with internet access. Complex communication and data transmission interfaces are simplified into simple message configurations, making them more intuitive. Customizable message rules are available, lower skill requirements are placed on personnel, and even large message volumes can be easily handled.

[0084] Receive a message configuration request sent from the front end. This request includes configuration messages related to communication between the main processor and the microcontroller. The configuration messages related to communication between the main processor and the microcontroller include the message direction, message parameters, and parameter types.

[0085] Step S20: Perform configuration data analysis based on the main processor and microcontroller communication-related configuration messages in the configuration request.

[0086] The configuration data is analyzed based on the configuration messages related to the communication between the main processor and the microcontroller in the configuration request message. The analysis includes the direction of the relevant configuration messages, message parameters, parameter types, etc.

[0087] To ensure that the generated communication code can function correctly in a specific environment and meet specific data transmission requirements, the appropriate communication protocol and data transmission method can be determined by analyzing and comparing various parameters. This avoids unnecessary errors or adjustments during the development phase, ensuring that the generated communication code functions correctly and meets the communication needs of the main processor and microcontroller.

[0088] Step S30: Based on the configuration data analysis results, generate the communication code between the main processor and the microcontroller.

[0089] Based on the results of configuration data analysis, communication code suitable for data communication between the main processor and the microcontroller is generated.

[0090] To ensure effective data communication between the main processor and the microcontroller, and to guarantee the correct and reliable transmission of configuration data, thereby reducing development and maintenance costs.

[0091] The communication code needs to be able to correctly encode and decode data between the main processor and the microcontroller to ensure normal data transmission.

[0092] Step S40: Upload the communication code to the project configuration library.

[0093] Upload the generated communication code to the project configuration library.

[0094] To enable control and management of communication data between the main processor and the microcontroller, the project configuration library is used to retrieve communication code. Storing the communication code in the project configuration library reduces the time and cost of unnecessary repetitive generation of communication code, thus improving development efficiency.

[0095] This solution features user management, MCU / SOC data configuration, email notification, data storage, code generation, automated testing, and system configuration. It can also be expanded with additional features such as window priority and audio priority, greatly facilitating the development of the entire project.

[0096] The user management module enables administrators to manage user permissions, automatically generates code and submits it to the configuration repository, and notifies administrators and relevant engineers, thus facilitating project management.

[0097] like Figure 3 As shown, the backend server receives requests from the frontend browser and responds to the requests by calling services in the backend server. These services include multi-user system, data analysis, mail server, data storage, file generation, automated testing, operation logging, and file configuration. Different services are called when different functions are executed.

[0098] This embodiment, through the above-described scheme, specifically involves receiving a message configuration request sent by the front end. This message configuration request includes configuration messages related to communication between the main processor and the microcontroller. Configuration data is analyzed based on the main processor and microcontroller communication configuration messages in the message configuration request. Based on the configuration data analysis results, communication code between the main processor and the microcontroller is generated. This communication code is then uploaded to the project configuration library. This achieves decoupling of communication data between the main processor and the microcontroller in the in-vehicle entertainment system, thereby realizing a platform-based data configuration system for the main processor and microcontroller.

[0099] Reference Figure 4 , Figure 4 This is a flowchart illustrating an exemplary embodiment of the data configuration method of this application.

[0100] Based on the first embodiment, a second embodiment of this application is proposed. The difference between the second embodiment and the first embodiment is as follows:

[0101] In this embodiment, the step of generating the communication code between the main processor and the microcontroller based on the configuration data analysis results includes:

[0102] Step S301: Generate a message protocol file based on the configuration data analysis results;

[0103] Step S302: Perform data serialization processing on the message protocol file to generate communication code between the main processor and the microcontroller.

[0104] First, based on the analysis results of the configuration messages related to communication between the main processor and the microcontroller, a suitable communication protocol is selected to meet the current requirements, and a message protocol file is generated. The analysis results include the communication protocol, communication rate, data bit width, and verification method, which are used to clarify communication requirements and determine feasible communication schemes. The generated message protocol file specifies the message format and specifications between the communicating parties.

[0105] Then, the data in the generated message protocol file is serialized to generate communication code between the main processor and the microcontroller. This communication code is stored in C / C++, Java, and other file formats.

[0106] like Figure 5 As shown, configuration data analysis is performed on the data, and a .proto file is generated based on the configuration rules and configuration data analysis results. Then, Nanopb is used to generate the necessary C / C++, Java, and other files from the .proto file to store the communication code between the main processor and the microcontroller.

[0107] Using Nanopb, you can generate the required C / C++, Java, and other code according to actual needs, adapting to different system platforms.

[0108] This embodiment, through the above-described scheme, specifically generates a message protocol file based on the configuration data analysis results; performs data serialization processing on the message protocol file to generate communication code between the main processor and the microcontroller. By serializing the configuration messages and generating code from the configuration data analysis results, it ensures that the communication code meets communication requirements, reduces the probability of communication errors, and improves the efficiency and stability of communication between devices.

[0109] Reference Figure 6 , Figure 6 This is a flowchart illustrating an exemplary embodiment of the data configuration method of this application.

[0110] Based on the first embodiment, a third embodiment of this application is proposed. The difference between the third embodiment and the first embodiment is as follows:

[0111] In this embodiment, after the step of generating the communication code between the main processor and the microcontroller based on the configuration data analysis results, the method further includes:

[0112] Step S303: Perform automated testing of data transmission on the communication code between the main processor and the microcontroller;

[0113] Step S304: If the automated test is normal, then execute the step: upload the communication code to the project configuration library.

[0114] First, automated testing of the data transmission code between the main processor and the microcontroller is performed to verify its correctness.

[0115] Then, if the automated test is successful, the communication code is uploaded to the project configuration repository.

[0116] To verify the correctness, stability, and reliability of the communication code, and to ensure its compliance with project requirements and standards, automated testing of data transmission between the main processor and the microcontroller can be achieved by writing automated test scripts, utilizing the communication environment between the main processor and the microcontroller for data transmission testing.

[0117] This embodiment, through the above-described scheme, specifically automates the data transmission testing of the communication code between the main processor and the microcontroller. If the automated test is successful, the step of uploading the communication code to the project configuration library is executed. This verifies the correctness of the communication code between the main processor and the microcontroller, saves testing time, improves testing efficiency, avoids errors that may occur during manual testing in traditional data configuration schemes, reduces fault handling costs, and improves the efficiency and stability of data communication.

[0118] Reference Figure 7 , Figure 7 This is a flowchart illustrating an exemplary embodiment of the data configuration method of this application.

[0119] Based on the first embodiment, a sixth embodiment of this application is proposed. The difference between the sixth embodiment and the first embodiment is as follows:

[0120] In this embodiment, after the step of uploading the communication code to the project configuration library, the method further includes:

[0121] Step S305: Record the operation information of the relevant configuration messages and back up the communication code;

[0122] Step S306: Generate a notification email based on the relevant configuration message;

[0123] Step S307: Send the notification email to the relevant personnel of the main processor and microcontroller;

[0124] Step S308: Upon receiving communication instructions from the main processor and microcontroller, retrieve the corresponding communication code from the project configuration library;

[0125] Step S309: Control the data transmission between the main processor and the microcontroller according to the communication code.

[0126] First, for each modification or update to the communication code, record the modification details, time, and responsible party, and back up the communication code. The relevant configuration messages should include the modification details, time, and responsible party.

[0127] Then, based on the configuration message, a notification email is generated, detailing the changes to the communication code and the reasons for them.

[0128] Then, the generated notification email is sent to the engineers and administrators related to the main processor and microcontroller.

[0129] When the main processor or microcontroller issues a communication instruction, the corresponding communication code is retrieved from the project configuration library.

[0130] Finally, the data transmission between the main processor and the microcontroller is controlled based on the retrieved communication code.

[0131] Whether you're a SOC development engineer or an MCU engineer, all you need to do is open the client in your browser, enter your registered username, lock the message, and you can create or modify messages. Then, you can configure the message direction, message parameters, parameter types, etc., according to the actual situation, generate a .proto file, and finally use Nanopb to generate MCU and SOC code. The code is then automatically uploaded to the project's configuration library. The system can automatically record the modification points, modification time, and the person who made the modification, and finally notify the relevant personnel via email.

[0132] The operation log and data backup functions can actually record user operations and can also revert to any version in special circumstances.

[0133] like Figure 8As shown, the backend server receives configuration request data from the frontend, and the data is accessed by the network server. The network server generates communication code between the main processor and the microcontroller, and then pushes the communication code to the version control server. The configuration information is sent to the mail server, which generates an email with the configuration information and notifies the administrator and the engineers of the main processor and microcontroller. When the main processor and microcontroller communicate, the communication code in the configuration library is pulled to perform data transmission between the main processor and the microcontroller.

[0134] This embodiment, through the above-described scheme, specifically records operation information, backs up data, and generates notification emails to notify engineers and administrators related to the main processor and microcontroller. This achieves version control of the configuration data, sending the details and reasons for changes to the communication code to relevant personnel via email, facilitating device updates and avoiding problems caused by inconsistent communication code versions.

[0135] Reference Figure 9 , Figure 9 This is a flowchart illustrating an exemplary embodiment of the data configuration method of this application.

[0136] Based on the first embodiment, a seventh embodiment of this application is proposed. The difference between the seventh embodiment and the first embodiment is as follows:

[0137] In this embodiment, after the steps of recording the operation information of the relevant configuration messages and backing up the communication code, the method further includes:

[0138] Step S3051: Upon receiving the configuration backtracking instruction, perform backtracking processing on the project configuration library based on the operation message record and the backed-up data.

[0139] Upon receiving a configuration rollback instruction, the operation message record and the backed-up data are used to perform rollback processing on the obtained communication code and configuration file information, and then applied to the project configuration library.

[0140] To avoid communication problems caused by version upgrades, we can trace back to a specific point in time when the communication code and configuration files were modified, so as to quickly locate and find the cause of the error and correct it in a timely manner.

[0141] This embodiment, through the above-described scheme, specifically performs backtracking processing on the project configuration library based on the recorded operation messages and the backed-up data when a configuration backtracking instruction is received. This achieves version control of the project configuration library, thereby correcting communication errors between the main processor and the microcontroller and ensuring the security and reliability of data transmission.

[0142] Furthermore, embodiments of this application also propose a data configuration device, the data configuration device comprising:

[0143] Data receiving module: Used to receive message configuration requests sent by the front end;

[0144] Data Analysis Module: Used to perform configuration data analysis on configuration messages related to communication between the main processor and microcontroller in the message configuration request;

[0145] Code generation module: Used to generate communication code between the main processor and the microcontroller based on the configuration data analysis results;

[0146] Code upload module: Used to upload communication code to the project configuration library.

[0147] The principle and implementation process of data configuration in this embodiment are explained in the above embodiments and will not be repeated here.

[0148] Furthermore, this application also proposes a terminal device, which includes a memory, a processor, and a data configuration program stored in the memory and executable on the processor. When the data configuration program is executed by the processor, it implements the steps of the data configuration method described above.

[0149] Since this data configuration program employs all the technical solutions of all the foregoing embodiments when executed by the processor, it has at least all the beneficial effects brought about by all the technical solutions of all the foregoing embodiments, which will not be elaborated here.

[0150] Furthermore, embodiments of this application also propose a computer-readable storage medium storing a data configuration program, which, when executed by a processor, implements the steps of the data configuration method described above.

[0151] Since this data configuration program employs all the technical solutions of all the foregoing embodiments when executed by the processor, it has at least all the beneficial effects brought about by all the technical solutions of all the foregoing embodiments, which will not be elaborated here.

[0152] Compared to existing technologies, the data configuration method, apparatus, terminal device, and storage medium proposed in this application receive a message configuration request sent by a front end, the message configuration request including configuration messages related to communication between the main processor and the microcontroller; perform configuration data analysis based on the configuration messages related to communication between the main processor and the microcontroller in the message configuration request; generate communication code between the main processor and the microcontroller based on the configuration data analysis results; and upload the communication code to the project configuration library. The web-based automated configuration generation of MCU / SOC communication code transforms interface definitions into a visual configuration addition method, realizing a platform-based configuration of communication code between the main processor and the microcontroller, thereby achieving automatic generation of MCU / SOC communication code from web page configuration.

[0153] 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.

[0154] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0155] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, controlled terminal, or network device, etc.) to execute the methods of each embodiment of this application.

[0156] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A data configuration method, characterized in that, The method is applied to a backend server, and the method includes: The system receives a configuration request message sent by the front-end browser. The configuration request message includes configuration messages related to communication between the main processor and the microcontroller. The main processor and the microcontroller communicate via a UART or SPI interface. Perform configuration data analysis based on the main processor and microcontroller communication-related configuration messages in the configuration request message; Based on the configuration data analysis results, communication code between the main processor and the microcontroller is generated, specifically including: generating a Proto format message protocol file based on the configuration data analysis results; performing data serialization processing on the message protocol file using Nanopb to generate communication code between the main processor and the microcontroller; wherein, the analysis results include at least one or more of the following: communication protocol, communication rate, data bit width, and verification method; Automated data transmission testing is performed on the communication code between the main processor and the microcontroller; wherein, data transmission testing is performed using the communication environment between the main processor and the microcontroller. If the automated test is successful, proceed to step 1: Upload the communication code to the project configuration library. Record the operation information of the relevant configuration messages and back up the communication code; generate a notification email based on the relevant configuration messages; send the notification email to the relevant personnel of the main processor and microcontroller; when receiving communication instructions from the main processor and microcontroller, retrieve the corresponding communication code from the project configuration library; and control the data transmission between the main processor and microcontroller based on the communication code.

2. The data configuration method according to claim 1, characterized in that, The configuration messages related to communication between the main processor and the microcontroller include one or more of the following: message direction, message parameters, and parameter types.

3. The data configuration method according to claim 1, characterized in that, The operation information in the relevant configuration message includes one or more of the following: modification point, modification time, and modification personnel.

4. The data configuration method according to claim 3, characterized in that, After the steps of recording the operation information of the relevant configuration messages and backing up the communication code, the method further includes: Upon receiving a configuration rollback instruction, the project configuration library is rolled back based on the recorded and backed-up data of the operation information.

5. A data configuration device, characterized in that, The data configuration device includes: Data receiving module: used to receive message configuration requests sent by the front-end browser, the message configuration requests including configuration messages related to communication between the main processor and the microcontroller; wherein, the main processor and the microcontroller communicate via UART or SPI interface; Data Analysis Module: Used to perform configuration data analysis on configuration messages related to communication between the main processor and microcontroller in the message configuration request; Code generation module: used to generate communication code between the main processor and the microcontroller based on the configuration data analysis results, specifically including: generating a Proto format message protocol file based on the configuration data analysis results; performing data serialization processing on the message protocol file using Nanopb to generate communication code between the main processor and the microcontroller; wherein, the analysis results include at least one or more of the following: communication protocol, communication rate, data bit width, and verification method; Code upload module: used for automated testing of data transmission of communication code between the main processor and the microcontroller; wherein, data transmission testing is performed using the communication environment between the main processor and the microcontroller; if the automated test is normal, the following step is executed: upload the communication code to the project configuration library; The data configuration device is also used to record operation information of the relevant configuration messages, back up the communication code; generate notification emails according to the relevant configuration messages; send the notification emails to relevant personnel of the main processor and microcontroller; when receiving communication instructions from the main processor and microcontroller, retrieve the corresponding communication code from the project configuration library; and control the data transmission of the main processor and microcontroller according to the communication code.

6. A terminal device, characterized in that, The terminal device includes a memory, a processor, and a data configuration program stored in the memory and executable on the processor. When the data configuration program is executed by the processor, it implements the steps of the data configuration method as described in any one of claims 1-4.

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

Citation Information

Patent Citations

  • Method and device for generating CAN communication program of vehicle control unit

    CN106950864A