Disclosure of Invention
The embodiment of the application provides terminal access equipment with a CAN bus function, an application method and a device, so that the terminal access equipment with the CAN bus function CAN have the CAN interface function and CAN encrypt data and store the data in a medium.
In a first aspect, an embodiment of the present application provides a terminal access device with a CAN bus function, including a processor, an interface module, a controller chip, a first memory, a second memory, and an antenna circuit, where the interface module includes a CAN interface chip, an RS232 interface chip, an RS485 interface chip, and a switch network interface chip, and the controller chip, the RS232 interface chip, the RS485 interface chip, the first memory, the second memory, the switch network interface chip, and the antenna circuit are all connected to the processor; RS232 interface chip RS485 interface chip switch net gape chip with CAN interface chip all CAN be used for connecting outside terminal equipment, CAN interface chip with controller chip connects, first memory is used for saving encryption and decryption algorithm, the treater is used for receiving outside input's data through the interface module to it is right to carry out encryption processing based on the encryption and decryption algorithm in the first memory, with the data storage after the encryption processing to the second memory.
Further, the processor is of the IPQ4019 model.
Further, the model of the CAN interface chip is SN65HVD230 QDR.
Further, the model of the controller chip is MCP 2510.
Further, the model of the switch network port chip is 88E 6097.
Further, the antenna circuit comprises a radio frequency circuit connected with the high-frequency processor and an antenna transceiver connected with the radio frequency circuit.
In a second aspect, an embodiment of the present invention provides an application method of a terminal access device, where the terminal access device is the terminal access device with a CAN bus function according to the first aspect of the present invention, and the method includes:
the processor reads a starting file of the first memory, reads a system file and an application program file of the second memory, and initializes the terminal access equipment based on the starting file, the system file and the application program file;
the processor receives externally input data through the interface module, reads an encryption and decryption algorithm from the first memory, encrypts the data based on the encryption and decryption algorithm, and stores the encrypted data into the second memory;
the processor receives a data export instruction input from the outside through the interface module, reads the encryption and decryption algorithm from the first memory, reads the data corresponding to the data export instruction from the second memory, decrypts the data based on the encryption and decryption algorithm, and outputs the decrypted data.
In a third aspect, an embodiment of the present invention provides an application apparatus of a terminal access device, where the terminal access device is the terminal access device with a CAN bus function according to the first aspect of the present invention, and the application apparatus includes:
an equipment starting module: the processor is used for reading a starting file of the first memory and reading a system file and an application program file of the second memory, and initializing the terminal access equipment based on the starting file, the system file and the application program file;
a data encryption module: the processor receives externally input data through the interface module, reads an encryption and decryption algorithm from the first memory, encrypts the data based on the encryption and decryption algorithm, and stores the encrypted data into the second memory;
a data decryption module: the processor receives a data export instruction input from the outside through the interface module, reads the encryption and decryption algorithm from the first memory, reads the data corresponding to the data export instruction from the second memory, decrypts the data based on the encryption and decryption algorithm, and outputs the decrypted data.
In a fourth aspect, an embodiment of the present application provides a computer device, including: a memory and one or more processors;
the memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method of application of the terminal access device according to the second aspect.
In a fourth aspect, embodiments of the present application provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform the method of applying the terminal access device according to the second aspect.
The embodiment of the application is provided with a processor, an interface module, a controller chip, a first memory, a second memory and an antenna circuit, wherein the interface module comprises a CAN interface chip, an RS232 interface chip, an RS485 interface chip and a switch network port chip, so that a multi-interface access form is realized through the interface module, the interface module is provided with the CAN interface chip, the access mode of a CAN interface is increased, and the defect that the prior art does not have a CAN bus transmission function is overcome; because the first memory stores the encryption and decryption algorithm, the processor encrypts the externally input data and stores the data in the second memory, the security of the data is guaranteed through the encryption and decryption algorithm, and the encrypted data and the encryption algorithm are stored separately.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, specific embodiments of the present application will be described in detail with reference to the accompanying drawings. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be further noted that, for the convenience of description, only some but not all of the relevant portions of the present application are shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
The embodiment of the application provides terminal access equipment with a CAN bus function, an application method, a device, equipment and a storage medium. CAN is an abbreviation of Controller Area network, i.e., a Controller Area network. In the embodiment, the terminal access device is a device connected to the service terminal in the WAPI network topology architecture, referring to fig. 1, the service terminal is accessed to the WAPI network through the terminal access device. The embodiment of the application is provided with the processor, the interface module, the controller chip, the first memory, the second memory and the antenna circuit, wherein the interface module comprises the CAN interface chip, the RS232 interface chip, the RS485 interface chip and the switch network port chip, so that a multi-interface access form is realized through the interface module, the interface module is provided with the CAN interface chip, the access mode of a CAN interface is increased, and the defect that the prior art does not have a CAN bus transmission function is overcome; because the first memory stores the encryption and decryption algorithm, the processor encrypts the externally input data and stores the data in the second memory, the security of the data is guaranteed through the encryption and decryption algorithm, and the encrypted data and the encryption algorithm are stored separately.
The following are detailed below.
Fig. 2 is a schematic structural diagram of a terminal access device having a CAN bus function according to an embodiment of the present disclosure. Referring to fig. 1, the terminal access device having a CAN bus function includes: processor 201, interface module, controller chip 202, first memory 203, second memory 204, antenna circuit 205. The processor 201 is mainly used for performing operations and processing on data in the present embodiment. In the embodiment, the terminal access device is connected with the external terminal device through the interface module, and the data interaction is processed by the processor. The antenna circuit is used for receiving and transmitting wireless signals.
The processor 201 is preferably an IPQ4019 model in this embodiment, and it adopts a single chip design, has advanced WIFI function and network processing function, and has high performance, low power consumption, low cost, and high data transmission efficiency.
Specifically, in this embodiment, the interface module includes a CAN interface chip 206, an RS232 interface chip 207, an RS485 interface chip 208, and a switch port chip 209. The controller chip, the RS232 interface chip, the RS485 interface chip, the first memory, the second memory, the switch network port chip and the antenna circuit are all connected with the processor; the RS232 interface chip, the RS485 interface chip, the switch network port chip and the CAN interface chip CAN be used for connecting external terminal equipment, and the CAN interface chip is connected with the controller chip. The model of the CAN interface chip is SN65HVD230QDR, the model of the RS232 interface chip is SP3232, the model of the RS485 interface chip is SP3485, and the model of the switchboard network port chip is 88E 6097.
The CAN interface chip is used as a transceiver, the protocol type is a CAN bus, and the CAN interface chip is internally integrated with a CAN interface integrated circuit and comprises 8 pins, wherein one pin is used for sending and one pin is used for receiving, and two signal pins are used for signal transmission. The CAN interface chip is connected with the switch network port chip, the processor is connected with the switch network port chip, a sending pin and a receiving pin of the CAN interface chip are used for being connected with external terminal equipment, and the signal pin is used for being connected with the controller chip.
Among the above, the type of the controller chip is preferably but not limited to MCP2510, which is an independent CAN controller with an SPI interface, and completely supports CAN bus technical specifications, has a communication rate of 1Mb/s, has a high-speed SPI interface and a low-power sleep mode, and is used to process message transmission and reception on the CAN interface chip, and when a message is transmitted, the message is first loaded into a correct message buffer and control register, and the transmission operation CAN be started by using the SPI interface or using a transmission enable pin. The processor communicates with an external device through the SPI interface of the controller chip and then through the CAN interface chip, and all read-write operations are carried out on the register by using a standard SPI read-write command. The pin packaging form of the controller chip of the MCP2510 model is a known technology, and is not described again.
Accordingly, the RS232 bus and RS485 bus transmission protocols are mature technologies commonly used in the market. In the embodiment, the model of the RS232 interface chip adopts SP3232, which is also a transceiver, and the protocol type is RS232 bus. The SP3232 chip is internally provided with a high-efficiency charge pump, can operate only by a 0.1uF capacitor when the working voltage is 3.3V, is a device of a 2-driver and a 2-receiver, has a low-power-consumption turn-off mode, and both the driver output and the charge pump are forbidden in the turn-off mode. The model of the RS485 interface chip adopts SP3485, and the RS485 interface chip is a low-power-consumption half-duplex transceiver and can meet the requirement of an RS485 serial protocol. SP3485 comprises a receiver output pin, an active low receiver output enable pin, an active high driver output enable pin, a driver input pin, a ground pin, an in-phase driver output or receiver input pin, an inverted driver output or receiver input pin, and a dc power supply pin. The data transmission rate of the SP3485 is high and can reach 10 Mbps. The RS232 bus and RS485 bus transmission is a mature technology, and the RS232 and RS485 interface transmission realized by adopting the RS232 interface chip and the RS485 interface chip is a connection mode which can be easily known by products on the market in the prior art, and is not described herein again.
In the embodiment of the application, the processor is used for processing the data received and transmitted based on the interface module. And the first memory and the second memory are used for storing different data, respectively. In the embodiment, the first memory is an SPI serial port access memory, and the second memory is an embedded memory. The first memory stores the starting program and encryption and decryption algorithm of the terminal access device, and the second memory stores the application program. The processor is used for receiving externally input data through the interface module, carrying out encryption processing on the data based on an encryption and decryption algorithm in the first memory, and storing the encrypted data to the second memory. And when the stored data are required to be output, the stored data are uniformly decrypted by reading the encryption and decryption algorithm, and then the decrypted data are output to external terminal equipment through the interface module.
The embodiment of the application realizes the butt joint of the WAPI system through the CAN interface, carries out encryption and decryption algorithm processing on data, ensures data safety, stores the encryption and decryption algorithm and the data in different media, and is convenient for data management. When the terminal access device of this embodiment receives the start instruction, first read the start file in the first memory, read the system file and the application program file in the second memory, then initialize all devices of the terminal access device, and the terminal access device enters the self-checking state. When external terminal equipment transmits data to the terminal access equipment through the interface module, the processor reads the encryption and decryption file from the first memory, encrypts the transmitted data, and stores the encrypted data in the second memory. In an example, the terminal device transmits data through the CAN bus, sends the data to the CAN interface chip, and the controller chip forwards the data to the processor, and the processor encrypts the data and stores the encrypted data in the second memory. In another example, the user operates the terminal device to input a data export instruction, and in this example, the data export refers to outputting data from the second memory of the terminal access device to the terminal device. At the moment, the processor reads the encryption and decryption algorithm from the first memory, reads the encrypted data from the second memory, carries out decryption processing on the data based on the encryption and decryption algorithm, and outputs the decrypted data to the terminal equipment.
As a preferred embodiment, the terminal access device of this embodiment may further include a third storage, and the third storage may be a DDR3 computer memory. In another aspect, the antenna circuit includes a radio frequency circuit coupled to the high frequency processor and an antenna transceiver coupled to the radio frequency circuit. Preferably, the wireless transceiver comprises a 2.4G antenna and a 5.8G antenna.
Fig. 2 shows a flowchart of an application method of a terminal access device according to an embodiment of the present application, in the application method of the terminal access device according to the embodiment, the terminal access device is a terminal access device with a CAN bus function described in any aspect of the embodiment of the present application, the terminal access device includes a processor, an interface module, a controller chip, a first memory, a second memory, and an antenna circuit, the interface module includes a CAN interface chip, an RS232 interface chip, an RS485 interface chip, and a switch portal chip, and the controller chip, the RS232 interface chip, the RS485 interface chip, the first memory, the second memory, the switch portal chip, and the antenna circuit are all connected to the processor; the RS232 interface chip, the RS485 interface chip, the switch network port chip and the CAN interface chip CAN be used for connecting external terminal equipment, and the CAN interface chip is connected with the controller chip.
Referring to fig. 3, an application method of a terminal access device provided in an embodiment of the present application includes:
301: the processor reads the starting file of the first memory, reads the system file and the application program file of the second memory, and initializes the terminal access equipment based on the starting file, the system file and the application program file.
The processor is usually a central processing unit, which is the core of the operation and control of the computer system and is the final execution unit of information processing and program operation. In this embodiment, this treater chooses the chip that the model is IPQ4019 for use, and this chip adopts single chip design, has advanced WIFI function and network processing function, and the performance is high and low power dissipation, with low costs to data transmission is efficient.
In the embodiment, the first memory is selected as an SPI serial port connection memory and is used for storing the starting file and the encryption and decryption algorithm. The second memory is an embedded memory in the embodiment and is used for storing encrypted data, application program files and system files.
Before the terminal access equipment is started, the processor receives a starting instruction, reads a starting file stored in the first memory, reads a system file and an application program file of the second memory, and then initializes the terminal access equipment to enable the equipment to be ready and enter a working state at any time. After the terminal access equipment is initialized, a self-checking stage is also carried out to detect whether faults exist in each device, when faults exist, information can be fed back to the processor and then a user is informed, when faults do not exist, normal processing is carried out, normal information of the equipment can be fed back to the processor at the moment, the user equipment is informed to be normal, and information can be not fed back by default, namely, when the feedback information is received, the device faults exist, and when the feedback information is not received, the device is indicated to be all normal. For example, the processor sends a self-test signal to the interface module, the controller chip, the first memory, the second memory, and the antenna circuit, and it is set that when a feedback signal of the interface module, the controller chip, the first memory, the second memory, and the antenna circuit is received within a preset time period, it means that each device is in a normal state, and conversely, when a feedback signal of any one device is not received within the preset time period, it means that the device is abnormal.
302: the processor receives data input from the outside through the interface module, reads an encryption and decryption algorithm from the first memory, encrypts the data based on the encryption and decryption algorithm, and stores the encrypted data in the second memory.
The interface module corresponds multiple interface, owing to included CAN interface chip, RS232 interface chip, RS485 interface chip and switch net gape chip in the embodiment, CAN correspond different bus transmission protocol and carry out interface data transmission. An external terminal device CAN transmit data through an interface module, exemplarily, a user operates the terminal device at the moment, the terminal device is, for example, a vehicle-mounted host, the vehicle-mounted host is connected with a terminal access device through a CAN bus and outputs a data transmission instruction through the CAN bus, the CAN interface chip feeds the data transmission instruction back to a controller chip, then the controller chip sends the data transmission instruction to a processor, the processor CAN feed back a response signal, the response signal is also the transmission of data agreed or not, under the agreed condition, the processor finally receives the data of the smart phone through the CAN interface and reads an encryption and decryption algorithm stored in a first memory, the received data is encrypted according to the encryption mode of the encryption and decryption algorithm and is stored in a second memory, namely, the stored data is encrypted and then stored every time of data transmission, the storage safety of the data is ensured. And the encryption and decryption algorithm and the data are respectively stored in two different storage media, so that the data management is more convenient.
303: the processor receives a data export instruction input from the outside through the interface module, reads the encryption and decryption algorithm from the first memory, reads the data corresponding to the data export instruction from the second memory, decrypts the data based on the encryption and decryption algorithm, and outputs the decrypted data.
The embodiment of the application can encrypt and store external data, and correspondingly, can also receive an externally input data export instruction. In an example, the terminal device is a smart phone, the smart phone is connected with the terminal access device through an interface provided by the RS232 interface chip, a user operates the smart phone to output a data export instruction, the data export instruction reaches the processor through the RS232 interface chip, and the processor feeds back the data export instruction, including refusing or agreeing. And under the condition of agreement, the processor reads the encrypted data stored in the second memory, reads the encryption and decryption algorithm in the first memory to decrypt the encrypted data, and then transmits the encrypted data to the terminal equipment through the RS232 interface chip.
As shown in fig. 4, an embodiment of the present application further provides an application apparatus of a terminal access device, where the terminal access device is any one of the terminal access devices with a CAN bus function in the present invention, and the apparatus includes: a device boot module 401, a data encryption module 402, and a data decryption module 403.
Specifically, the device start module 401 is configured to read a start file of a first memory and read a system file and an application file of a second memory by a processor, and initialize the terminal access device based on the start file, the system file, and the application file; the data encryption module 402 is used for receiving externally input data through the interface module by the processor, reading an encryption and decryption algorithm from the first memory, encrypting the data based on the encryption and decryption algorithm, and storing the encrypted data into the second memory; and a data decryption module 403, configured to receive an externally input data export instruction through the interface module, read an encryption/decryption algorithm from the first memory, read data corresponding to the data export instruction from the second memory, decrypt the data based on the encryption/decryption algorithm, and output the decrypted data.
As shown in fig. 5, an embodiment of the present application further provides a computer device, including: a memory 501 and one or more processors 502; the memory 501 is used for storing one or more programs; when executed by the one or more processors 502, the one or more programs cause the one or more processors to implement the method for application of the terminal access device as described herein.
The embodiment of the present application further provides a storage medium containing computer executable instructions, where the computer executable instructions are used to execute the application method of the terminal access device provided in the above embodiment when executed by a computer processor, and the application method of the terminal access device includes: the processor reads a starting file of the first memory, reads a system file and an application program file of the second memory, and initializes the terminal access equipment based on the starting file, the system file and the application program file; the processor receives externally input data through the interface module, reads an encryption and decryption algorithm from the first memory, encrypts the data based on the encryption and decryption algorithm, and stores the encrypted data into the second memory; the processor receives a data export instruction input from the outside through the interface module, reads the encryption and decryption algorithm from the first memory, reads the data corresponding to the data export instruction from the second memory, decrypts the data based on the encryption and decryption algorithm, and outputs the decrypted data.
Storage medium-any of various types of memory devices or storage devices. The term "storage medium" is intended to include: mounting media such as CD-ROM, floppy disk, or tape devices; computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Lanbas (Rambus) RAM, etc.; non-volatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in a first computer system in which the program is executed, or may be located in a different second computer system connected to the first computer system through a network (such as the internet). The second computer system may provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations, such as in different computer systems that are connected by a network. The storage medium may store program instructions (e.g., embodied as a computer program) that are executable by one or more processors.
Of course, the storage medium containing the computer-executable instructions provided in the embodiments of the present application is not limited to the application method of the terminal access device described above, and may also perform related operations in the application method of the terminal access device provided in any embodiments of the present application.
The application apparatus, the device, and the storage medium of the terminal access device provided in the foregoing embodiments may execute the application method of the terminal access device provided in any embodiment of the present application, and refer to the application method of the terminal access device provided in any embodiment of the present application without detailed technical details described in the foregoing embodiments.
The foregoing is considered as illustrative of the preferred embodiments of the invention and the technical principles employed. The present application is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present application has been described in more detail with reference to the above embodiments, the present application is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present application, and the scope of the present application is determined by the scope of the claims.