Analog data sending method and device, data generator, storage medium and product

By inputting relevant information into the tool interface of the data generator to generate and send simulated data, the problem of not being able to quickly insert valid data in batches in the existing technology is solved, thereby improving the computing power of the server and the overall performance of the vehicle networking system.

CN118843131BActive Publication Date: 2026-01-06CHERY AUTOMOBILE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410916254.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-09
Publication Date
2026-01-06
Estimated Expiration
2044-07-09

AI Technical Summary

Technical Problem

Existing data generation methods cannot quickly, in batches, and accurately insert large amounts of valid data into Kafka, failing to meet the computing needs of servers in high-concurrency scenarios.

Method used

By inputting the server's connection address, target channel, vehicle identification start and end ranges, and the message to be sent into the data generator's tool interface, simulated data is generated and sent. Concurrent threads are used for data transmission to ensure data accuracy and efficiency.

Benefits of technology

This enabled the insertion of a large amount of valid data into the server in a short period of time, verifying the server's computing power and improving the overall performance of the vehicle networking system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118843131B_ABST
    Figure CN118843131B_ABST
Patent Text Reader

Abstract

The application relates to the computer technical field, in particular to a simulation data sending method and device, a data generator, a storage medium and a product, wherein the method comprises the following steps: creating a tool interface of the data generator; inputting a connection address of a server, a target channel, a starting range and an ending range of a vehicle identifier and a to-be-sent message in the tool interface; generating a target number of vehicle identifiers according to the starting range and the ending range; filling each vehicle identifier and a current time into the to-be-sent message to generate simulation data; and sequentially sending the simulation data to the target channel according to the connection address of the server. Therefore, the problem of how to insert a large amount of effective data into the server in a short time to verify the computing capacity of the server is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, data generator, storage medium and product for simulating data transmission. Background Technology

[0002] As more and more vehicles are connected to the vehicle networking platform, the signals related to the vehicle's power battery need to be stored in a server (such as Kafka). Then the program retrieves data from Kafka for calculation. In order to ensure that the system can process this data efficiently, especially in high-concurrency scenarios, large-scale data calculation is more important. Therefore, it is necessary to insert a large amount of valid data into Kafka.

[0003] Traditional data generation methods, such as manual creation or small-batch data generation, can no longer meet computational needs. Therefore, it is crucial to be able to quickly, in batches, and accurately insert large amounts of valid data into Kafka. Summary of the Invention

[0004] This application provides a method, apparatus, data generator, storage medium, and product for simulating data transmission, in order to solve the problem of how to insert a large amount of valid data into a server in a short period of time to verify the server's computing power.

[0005] The first aspect of this application provides a method for simulating data transmission, comprising the following steps: creating a tool interface for a data generator; inputting the connection address of a server, a target channel, the start and end ranges of vehicle identifiers, and a message to be sent in the tool interface; generating a target number of vehicle identifiers based on the start and end ranges; filling each vehicle identifier and the current time into the message to be sent to generate simulated data; and sequentially sending the simulated data to the target channel according to the connection address of the server.

[0006] Optionally, simulated data is sent to the target channel sequentially according to the server's connection address, including: a virtual button for sending simulated data is set on the tool interface; when the virtual button is triggered, a corresponding number of worker threads are created according to the set number of concurrent threads, wherein each worker thread connects to the server according to the connection address, and after the connection is successful, it repeatedly executes the operation of obtaining simulated data and sending it to the target channel until the preset number of sending times is met, and then the sending stops.

[0007] Optionally, filling each vehicle identifier and current time into the message to be sent to generate simulated data includes: encoding the vehicle identifier as a string, and identifying the actual vehicle identifier and actual time in the message to be sent; replacing the actual vehicle identifier and actual time in the message to be sent with the encoded vehicle identifier and current time to obtain simulated data.

[0008] Optionally, it also includes: if the connection to the server fails, generating a failure message and displaying the failure message to the tool interface.

[0009] Optionally, the simulated data is battery signal data, including one or more of the following: vehicle identification, battery level, voltage, charging current, discharging current, and battery health status. The simulated data is used to verify the computing performance of the server.

[0010] A second aspect of this application provides a simulated data transmission device, comprising: a creation module for creating a tool interface for a data generator; a generation module for inputting a server connection address, a target channel, a start and end range of vehicle identifiers, and a message to be sent in the tool interface, generating a target number of vehicle identifiers based on the start and end ranges, and filling each vehicle identifier and the current time into the message to be sent to generate simulated data; and a transmission module for sequentially sending the simulated data to the target channel according to the server connection address.

[0011] Optionally, the sending module is further equipped with a virtual button on the tool interface for sending simulated data; when the virtual button is triggered, a corresponding number of worker threads are created according to the set number of concurrent threads, wherein each worker thread connects to the server according to the connection address, and after the connection is successful, it repeatedly executes the operation of obtaining simulated data and sending it to the target channel until the preset number of sending times is met, and then the sending stops.

[0012] Optionally, the generation module is further configured to: encode the vehicle identifier as a string, and identify the actual vehicle identifier and actual time in the message to be sent; replace the actual vehicle identifier and actual time in the message to be sent with the encoded vehicle identifier and current time to obtain simulated data.

[0013] Optionally, the simulated data transmission device further includes a display module, used to generate failure information and display the failure information to the tool interface when the connection to the server fails.

[0014] Optionally, the simulated data is battery signal data, including one or more of the following: vehicle identification, battery level, voltage, charging current, discharging current, and battery health status. The simulated data is used to verify the computing performance of the server.

[0015] A third aspect of this application provides a data generator, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the program to implement the simulated data transmission method as described in the above embodiments.

[0016] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which is executed by a processor to implement the simulated data transmission method as described in the above embodiments.

[0017] A fifth aspect of this application provides a computer program product, including: a computer program or instructions, which, when executed, implement the simulated data transmission method as described in the above embodiments.

[0018] Therefore, this application has at least the following beneficial effects:

[0019] This application embodiment allows for the generation of a large amount of simulated data by inputting the server's connection address, target channel, vehicle identification start and end ranges, and the message to be sent into the data generator's tool interface. The operation is simple and convenient, and the large amount of simulated data can better verify the server's computing power, thereby effectively improving the overall performance of the vehicle networking system.

[0020] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0021] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:

[0022] Figure 1 This is a flowchart of a simulated data transmission method provided according to an embodiment of this application;

[0023] Figure 2 This is an example diagram of the tool interface of a data generator provided according to an embodiment of this application;

[0024] Figure 3 Example diagram of simulated data transmission according to one embodiment of this application;

[0025] Figure 4 This is a block diagram of a simulated data transmission apparatus provided according to an embodiment of this application;

[0026] Figure 5 This is a schematic diagram of the structure of a data generator provided according to an embodiment of this application. Detailed Implementation

[0027] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0028] The following description, with reference to the accompanying drawings, outlines a method, apparatus, data generator, storage medium, and product for simulating data transmission according to embodiments of this application. Addressing the problems mentioned in the background section, this application provides a method for simulating data transmission. In this method, by inputting the server's connection address, target channel, the start and end ranges of the vehicle identifier, and the message to be sent into the data generator's interface, a large amount of simulated data can be generated. The operation is simple and convenient. Using a large volume of simulated data allows for better verification of the server's computing power, thereby effectively improving the overall performance of the vehicle networking system.

[0029] Specifically, Figure 1 This is a flowchart illustrating a simulated data transmission method provided in an embodiment of this application.

[0030] like Figure 1 As shown, the simulated data transmission method includes the following steps:

[0031] In step S101, a tool interface for creating a data generator is created.

[0032] The embodiments of this application can use the Java Swing framework to design the interface of a data generator utility, such as... Figure 2 As shown, there is a server connection address, vehicle identifier (vin) start number, number of threads, number of requests to be sent for each vin, target channel (topic), and message input box.

[0033] It should be noted that, in this embodiment of the application, a large number of regular VINs can be pre-inserted into the business database. Starting from TEST0000000000001, 10,000 data entries can be incremented for backup. For example, in this embodiment of the application, each subsequent VIN number can be incremented by 1 based on the previous one, until "TEST0000010000000", thereby forming a large number of regular VINs. Such an operation helps to simulate a large-scale real-world data environment and facilitates subsequent computational performance verification.

[0034] In step S102, the connection address of the server, the target channel, the start and end ranges of the vehicle identifiers and the message to be sent are entered in the tool interface. The target number of vehicle identifiers are generated according to the start and end ranges. Each vehicle identifier and the current time are filled into the message to be sent to generate simulated data.

[0035] The simulated data can be battery signal data, including one or more of the following: vehicle identification, battery level, voltage, charging current, discharging current, and battery health status. The simulated data is used to verify the computing performance of the server.

[0036] like Figure 2As shown in the embodiment of this application, the user can input the Kafka connection address, the start and end ranges of the VIN, the number of threads, the number of requests to be sent per VIN, the target channel topic, and the message content to be sent on the tool interface. By clicking the submit button, the getText() method of JTextField is used to obtain the Kafka connection address, VIN start number, number of threads, number of requests per VIN, the topic content to be sent, and the message, respectively. The operation is simple and convenient.

[0037] Furthermore, in this embodiment, a continuous or specified number of VIN sequences can be automatically generated based on the start and end ranges of the VINs input by the user; by encoding the vehicle identifier as a string and identifying the actual vehicle identifier and actual time in the message to be sent; by replacing the actual vehicle identifier and actual time in the message to be sent with the encoded vehicle identifier and current time, simulated data is obtained. The simulated data is in the correct format and conforms to the data standards of the vehicle networking system. Thus, by generating a large amount of valid data and sending it to the Kafka server, it is used for subsequent verification of computing capabilities, thereby improving the overall performance of the vehicle networking system.

[0038] In step S103, simulated data is sent to the target channel sequentially according to the server's connection address.

[0039] In one embodiment of this application, simulated data is sequentially sent to the target channel according to the connection address of the server, including: a virtual button for sending simulated data is set on the tool interface; when the virtual button is triggered, a corresponding number of worker threads are created according to the set number of concurrent threads, wherein each worker thread connects to the server according to the connection address, and after the connection is successful, it repeatedly executes the operation of obtaining simulated data and sending it to the target channel until the preset number of sending times is met, and then the sending stops.

[0040] The preset number of sends can be the number of requests that need to be sent for each vin, or it can be set according to the actual situation without specific limitation.

[0041] It is understood that this embodiment of the application can create a thread group, with each thread creating a KafkaProducer object, configuring ByteArraySerializer for serialization, and establishing a secure and reliable network connection based on the provided server address. If the connection to the server fails, a failure message is generated and displayed on the tool interface. If the connection to the server succeeds, this embodiment of the application can encode each VIN as a string, obtain the current time, replace the VIN and time in the message, and call the send() method to send simulated data to the specified target channel in a loop. In actual execution, this embodiment of the application can send simulated data in byte array format to ensure the performance and reliability of data transmission.

[0042] The following is combined Figure 3 The simulated data transmission method of this application embodiment will be described in detail, including the following steps:

[0043] (1) Insert a large number of regular vins into the business database, starting from TEST0000000000001 and incrementing by 10,000 records for later use.

[0044] (2) Use the java.swing framework to design the interface of the data generator tool and input the relevant data.

[0045] (3) When the submit button is clicked, the getText() method of JTextField is used to obtain the Kafka connection address, VIN starting number, number of threads, number of requests per VIN, topic content and message sent. A thread group is created, and each thread creates a kafkaProducer object, configures ByteArraySerializer, and connects to the Kafka server.

[0046] (4) Determine if the connection is successful. If successful, execute (5) operation. If unsuccessful, print an error message.

[0047] (5) After encoding the vin as a string, get the current time, replace the vin and time in the message, and call the send() method to send messages to the specified topic in a loop.

[0048] According to the simulated data transmission method proposed in the embodiments of this application, a large amount of simulated data can be generated by inputting the server's connection address, target channel, vehicle identification start and end ranges, and the message to be sent on the tool interface of the data generator. The operation is simple and convenient. A large amount of simulated data can better verify the server's computing power and effectively improve the overall performance of the vehicle networking system.

[0049] Next, the analog data transmission apparatus proposed according to the embodiments of this application is described with reference to the accompanying drawings.

[0050] Figure 4 This is a block diagram of a simulated data transmission device according to an embodiment of this application.

[0051] like Figure 4 As shown, the simulated data transmission device 10 includes: a creation module 100, a generation module 200, and a transmission module 300.

[0052] The creation module 100 is used to create a tool interface for the data generator; the generation module 200 is used to input the server's connection address, target channel, the start and end ranges of vehicle identifiers, and the message to be sent in the tool interface, generate a target number of vehicle identifiers according to the start and end ranges, and fill each vehicle identifier and the current time into the message to be sent to generate simulated data; the sending module 300 is used to send simulated data to the target channel sequentially according to the server's connection address.

[0053] In one embodiment of this application, the sending module 300 is further configured to have a virtual button for sending simulated data on the tool interface; when the virtual button is triggered, a corresponding number of worker threads are created according to the set number of concurrent threads, wherein each worker thread connects to the server according to the connection address, and after the connection is successful, it repeatedly executes the operation of obtaining simulated data and sending it to the target channel until the preset number of sending times is met, and then the sending stops.

[0054] In one embodiment of this application, the generation module 200 is further configured to: encode the vehicle identifier as a string, and identify the actual vehicle identifier and actual time in the message to be sent; replace the actual vehicle identifier and actual time in the message with the encoded vehicle identifier and current time to obtain simulated data.

[0055] In one embodiment of this application, the simulated data sending device 10 further includes a display module, used to generate failure information and display the failure information to the tool interface when the connection to the server fails.

[0056] In one embodiment of this application, the simulated data is battery signal data, including one or more of the following: vehicle identification, battery level, voltage, charging current, discharging current, and battery health status. The simulated data is used to verify the computing performance of the server.

[0057] It should be noted that the foregoing explanation of the embodiments of the analog data transmission method also applies to the analog data transmission device of this embodiment, and will not be repeated here.

[0058] According to the simulated data transmission device proposed in the embodiments of this application, a large amount of simulated data can be generated by inputting the server's connection address, target channel, vehicle identification start and end range and message to be sent on the tool interface of the data generator. The operation is simple and convenient. The large amount of simulated data can better verify the server's computing power, thereby effectively improving the overall performance of the vehicle networking system.

[0059] Figure 5 A schematic diagram of the structure of a vehicle provided in an embodiment of this application. The vehicle may include:

[0060] The memory 501, the processor 502, and the computer program stored on the memory 501 and capable of running on the processor 502.

[0061] When the processor 502 executes the program, it implements the simulated data transmission method provided in the above embodiments.

[0062] Furthermore, the vehicle also includes:

[0063] Communication interface 503 is used for communication between memory 501 and processor 502.

[0064] The memory 501 is used to store computer programs that can run on the processor 502.

[0065] The memory 501 may include high-speed RAM (Random Access Memory) memory, and may also include non-volatile memory, such as at least one disk storage.

[0066] If the memory 501, processor 502, and communication interface 503 are implemented independently, then the communication interface 503, memory 501, and processor 502 can be interconnected via a bus to complete communication between them. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0067] Optionally, in a specific implementation, if the memory 501, processor 502, and communication interface 503 are integrated on a single chip, then the memory 501, processor 502, and communication interface 503 can communicate with each other through an internal interface.

[0068] Processor 502 may be a CPU (Central Processing Unit), an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement embodiments of this application.

[0069] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described analog data transmission method.

[0070] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0071] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0072] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0073] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (FPGAs), field-programmable gate arrays (FPGAs), etc.

[0074] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0075] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.

Claims

1. A method of transmitting analog data, characterized by The method comprises the following steps: a tool interface of a data generator is created; a connection address of a server, a target channel, a starting range and an ending range of vehicle identifiers, and a to-be-sent message are input in the tool interface, a target number of vehicle identifiers is generated according to the starting range and the ending range, each vehicle identifier and a current time are filled into the to-be-sent message to generate simulation data; the simulation data is sequentially sent to the target channel according to the connection address of the server; the simulation data is sequentially sent to the target channel according to the connection address of the server, and the tool interface is provided with a virtual button for sending the simulation data; when the virtual button is triggered, a corresponding number of worker threads are created according to a set number of concurrent threads, each worker thread connects the server according to the connection address, and after a successful connection, the operation of obtaining the simulation data and sending it to the target channel is repeatedly performed until a preset number of sending times is reached and the sending is stopped.

2. The analog data transmission method of claim 1, wherein each vehicle identifier and the current time are filled into the to-be-sent message to generate simulation data, which comprises: the vehicle identifiers are encoded as strings, and actual vehicle identifiers and actual times in the to-be-sent message are identified; the encoded vehicle identifiers and the current time are used to replace the actual vehicle identifiers and the actual times in the to-be-sent message to obtain the simulation data.

3. The analog data transmission method of claim 1, wherein Further comprising: if the server fails to be connected, failure information is generated and displayed to the tool interface.

4. The analog data transmission method according to any one of claims 1 to 3, characterized in that, The simulation data is battery signal data, which comprises one or more of a vehicle identifier, a battery capacity, a voltage, a charging current, a discharging current, and a battery health status, and the simulation data is used to verify the computing performance of the server.

5. An analog data transmitting apparatus characterized by comprising: It comprises: a creating module for creating a tool interface of a data generator; a generating module for inputting a connection address of a server, a target channel, a starting range and an ending range of vehicle identifiers, and a to-be-sent message in the tool interface, generating a target number of vehicle identifiers according to the starting range and the ending range, filling each vehicle identifier and a current time into the to-be-sent message to generate simulation data; a sending module for sequentially sending the simulation data to the target channel according to the connection address of the server; the tool interface is provided with a virtual button for sending the simulation data, and the sending module is further used to create a corresponding number of worker threads according to a set number of concurrent threads when the virtual button is triggered, each worker thread connects the server according to the connection address, and after a successful connection, the operation of obtaining the simulation data and sending it to the target channel is repeatedly performed until a preset number of sending times is reached and the sending is stopped.

6. A data generator, comprising: It comprises: a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor executes the program to implement the simulation data sending method according to any one of claims 1-4.

7. A computer readable storage medium having stored thereon computer programs or instructions being executed, characterized in that, The computer program or instructions, when executed by a processor, are used to implement the analog data transmission method according to any one of claims 1-4.

8. A computer program product, comprising: Computer program or instructions, characterized in that, when executed by a processor, are used to implement the analog data transmission method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Monitoring platform test method and device, storage medium and server

    CN110691011A

  • Pressure testing method and device, storage medium and electronic equipment

    CN113076238A