CN111148275B - Communication method, device and system based on equipment code - Google Patents

Communication method, device and system based on equipment code Download PDF

Info

Publication number
CN111148275B
CN111148275B CN201911398790.2A CN201911398790A CN111148275B CN 111148275 B CN111148275 B CN 111148275B CN 201911398790 A CN201911398790 A CN 201911398790A CN 111148275 B CN111148275 B CN 111148275B
Authority
CN
China
Prior art keywords
code
connection
communication
equipment
random
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911398790.2A
Other languages
Chinese (zh)
Other versions
CN111148275A (en
Inventor
罗超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Queclink Communication Technology Co ltd
Original Assignee
Shenzhen Queclink Communication Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Queclink Communication Technology Co ltd filed Critical Shenzhen Queclink Communication Technology Co ltd
Priority to CN201911398790.2A priority Critical patent/CN111148275B/en
Publication of CN111148275A publication Critical patent/CN111148275A/en
Application granted granted Critical
Publication of CN111148275B publication Critical patent/CN111148275B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/11Allocation or use of connection identifiers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/02Protecting privacy or anonymity, e.g. protecting personally identifiable information [PII]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/03Protecting confidentiality, e.g. by encryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/10Integrity
    • H04W12/106Packet or message integrity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/30Services specially adapted for particular environments, situations or purposes
    • H04W4/40Services specially adapted for particular environments, situations or purposes for vehicles, e.g. vehicle-to-pedestrians [V2P]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention provides a communication method, a device and a system based on equipment codes, wherein the method comprises the following steps: receiving a connection request sent by terminal equipment, wherein the connection request comprises a connection code; analyzing the connection code to obtain an analyzed connection code, wherein the analyzed connection code comprises an equipment code; and matching the equipment code with a preset equipment code, and if the equipment code is successfully matched, sending a connection instruction to the terminal equipment, wherein the connection instruction is used for indicating that the connection code is successfully matched, so that the terminal equipment establishes communication connection with a shared vehicle according to the connection instruction, and the shared vehicle is started or closed. The method and the device have the advantages that the random connection codes are efficiently generated, the interactive connection codes of the shared vehicle and the terminal equipment are prevented from being cracked by others, and the safety and the reliability of communication between the terminal equipment and the shared vehicle are improved.

Description

Communication method, device and system based on equipment code
Technical Field
The present invention relates to the field of wireless communication technologies, and in particular, to a communication method, apparatus, and system based on device codes.
Background
The shared vehicle is a shared service which can provide vehicles driven by users in a characteristic application scene, and is a time-sharing rental mode.
With the abundance Of functions Of the terminal device, the terminal device and the shared vehicle are both provided with the bluetooth devices for transmitting control instructions, for example, unlocking Of the shared vehicle is realized, and the purpose can be achieved by only sending the string unlock to an IoT (Internet Of Things) device through the bluetooth Of the terminal device and by only sending the string lock to the IoT device to realize locking. The control instruction data is transmitted in the clear text, so that the control instruction data is easily known by others, and the others who do not pay can also obtain the authority of the shared vehicle by sending the control instruction, so that the shared vehicle can be unlocked and locked.
At present, communication data is encrypted by adopting an encryption algorithm, for example, algorithms such as AES and RSA are adopted, the encryption algorithms need to agree a secret key for encryption and decryption in advance, although data transmitted in the communication process is encrypted and cannot be decrypted, the encrypted data is also unchanged due to the unchanged control instruction, and other people can directly send the same encrypted data, so that the lock opening and closing operation can be realized. Another method for performing authentication by using dynamic passwords is, for example, setting a password for each shared vehicle, providing the password when the lock is opened and closed, and if the passwords are not correct, the corresponding operation cannot be performed. Since the password is used only once, a new password is generated again later. The password of the method is updated frequently, and the dynamic password stored in the IoT device may not be updated in time, thereby causing the lock unlocking failure.
Disclosure of Invention
The invention provides a communication method, a device and a system based on equipment codes, which are used for efficiently and randomly generating communication connection codes, avoiding the communication connection codes from being cracked by others and further improving the safety and reliability of communication connection between terminal equipment and a shared vehicle.
A first aspect of an embodiment of the present invention provides a method for communication based on device codes, including:
receiving a connection request sent by terminal equipment, wherein the connection request comprises a connection code;
analyzing the connection code to obtain an analyzed connection code, wherein the analyzed connection code comprises an equipment code;
and matching the equipment code with a preset equipment code, and if the equipment code is successfully matched, sending a connection instruction to the terminal equipment, wherein the connection instruction is used for indicating that the connection code is successfully matched, so that the terminal equipment establishes communication connection with a shared vehicle according to the connection instruction, and the shared vehicle is started or closed.
A second aspect of the embodiments of the present invention provides a device code-based communication method, including:
sending a device code request to a server;
and receiving the equipment code returned by the server, and sending a connection request to a shared vehicle according to the equipment code so as to establish communication connection with the shared vehicle, wherein the connection request comprises a connection code, and the connection code comprises the equipment code.
A third aspect of the embodiments of the present invention provides a device code-based communication method, including:
receiving a device code request sent by terminal equipment;
and searching in a pre-stored database according to the equipment code to obtain the equipment code corresponding to the shared vehicle, and sending the equipment code to the terminal equipment so as to indicate the terminal equipment to carry out a communication connection request.
A fourth aspect of the embodiment of the present invention provides a shared vehicle, including:
the terminal equipment comprises a first receiving module, a second receiving module and a sending module, wherein the first receiving module is used for receiving a connection request sent by the terminal equipment, and the connection request comprises a connection code;
the analysis module is used for analyzing the connection code to obtain an analyzed connection code, wherein the analyzed connection code comprises an equipment code;
and the matching module is used for matching the equipment code with a preset equipment code, and if the equipment code is successfully matched, sending a connection instruction to the terminal equipment, wherein the connection instruction is used for indicating that the connection code is successfully matched, so that the terminal equipment establishes communication connection with a shared vehicle according to the connection instruction, and the shared vehicle is started or closed.
A fifth aspect of the embodiments of the present invention provides a terminal device, including:
the sending module is used for sending a device code request to the server;
and the second receiving module is used for receiving the equipment code returned by the server and sending a connection request to the shared vehicle according to the equipment code so as to establish communication connection with the shared vehicle, wherein the connection request comprises a connection code, and the connection code comprises the equipment code.
A sixth aspect of the embodiments of the present invention provides a storage medium, which is readable and has stored therein a computer program for executing the method according to the first aspect.
A seventh aspect of the embodiments of the present invention provides a storage medium, in which a computer program is stored, the computer program being configured to execute the method according to the second aspect.
The invention provides a communication method, a device and a system based on equipment codes, wherein the equipment codes of shared vehicles are acquired through terminal equipment; the terminal device sends a device code request to the server. The server receives a device code request sent by the terminal device; and searching in a pre-stored database according to the equipment code request to obtain an equipment code corresponding to the shared vehicle, and sending the equipment code to the terminal equipment so as to indicate the terminal equipment to carry out a communication connection request. And the terminal equipment receives the equipment code returned by the server and sends a connection request to the shared vehicle according to the equipment code so as to establish communication connection with the terminal equipment, wherein the connection request comprises the connection code. The shared vehicle receives a connection request sent by terminal equipment, wherein the connection request comprises a connection code; the shared vehicle analyzes the connection code to obtain an analyzed connection code, wherein the analyzed connection code comprises an equipment code; and the server matches the equipment code with a preset equipment code, and if the equipment code is successfully matched, a connection instruction is sent to the terminal equipment, wherein the connection instruction is used for indicating that the connection code is successfully matched, so that the terminal equipment establishes communication connection with a shared vehicle according to the connection instruction, and the shared vehicle is opened or closed. By the method, the random connection codes are efficiently generated, the connection codes of the shared vehicle and the terminal equipment are prevented from being cracked by others, and the safety and reliability of communication between the terminal equipment and the shared vehicle are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a usage scenario diagram of a communication method based on device codes according to an embodiment of the present invention;
fig. 2 is a signaling interaction diagram of a communication method based on device codes according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a communication method based on device codes according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a connection request format in a communication method based on device codes according to this embodiment;
fig. 5 is a schematic diagram of a connection code in a communication method based on device codes according to this embodiment;
fig. 6 is a flowchart illustrating another communication method based on device codes according to an embodiment of the present invention;
fig. 7 is a schematic diagram of a prompt message in a communication method based on device codes according to an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of a shared vehicle controller according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a terminal device according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The shared vehicle is a shared service which can provide vehicles driven by users in a characteristic application scene, and is a time-sharing rental mode. Shared vehicles may include shared bicycles, shared scooters, and shared cars, among others. With the abundant functions of the terminal equipment, the shared vehicle can be locked and unlocked through the terminal equipment, however, data between communication of the terminal equipment is easily known by others, so that the shared vehicle can be used by other people who do not pay by sending cracked control instructions.
In order to solve the above problem, embodiments of the present application provide a communication method based on device codes, so as to efficiently generate random connection codes, prevent the connection codes between the shared vehicle and the terminal device from being cracked by others, and further improve the security and reliability of communication between the terminal device and the shared vehicle.
Fig. 1 is a usage scenario diagram of a communication method based on a device code according to an embodiment of the present invention, as shown in fig. 1, including a server 11, a terminal device 12, and a sharing vehicle 13 (e.g., a sharing scooter), where the sharing vehicle 13 may interact with the server 11 through the terminal device 12, so that the terminal device controls the sharing vehicle 13 to turn on or off. The terminal device 12 sends a device code request to the server 11; the server 11 receives a device code request sent by the terminal device 12; and searching in a pre-stored database according to the equipment code request to obtain an equipment code corresponding to the shared vehicle, and sending the equipment code to the terminal equipment so as to indicate the terminal equipment to carry out a communication connection request. And the terminal equipment receives the equipment code returned by the server and sends a connection request to the shared vehicle according to the equipment code so as to establish communication connection with the terminal equipment, wherein the connection request comprises the connection code. The shared vehicle receives a connection request sent by the terminal equipment, wherein the connection request comprises a connection code; analyzing the connection code to obtain an analyzed connection code, wherein the analyzed connection code comprises an equipment code; and matching the equipment code with a preset equipment code, and if the equipment code is successfully matched, sending a connection instruction to the terminal equipment, wherein the connection instruction is used for indicating that the connection code is successfully matched, so that the terminal equipment establishes communication connection with the shared vehicle according to the connection instruction, and the shared vehicle 13 is started or closed. In turn, the terminal device 12 sends a communication request to the shared vehicle, wherein the communication request includes a communication code. The sharing vehicle 13 receives a communication request sent by the terminal device, wherein the communication request comprises a communication code; and if the communication code is matched with the prestored communication code, communicating with the terminal equipment so as to enable the shared vehicle to be turned on or off. The terminal device 12 may be a smart phone, a tablet computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA), or the like. The shared vehicles may include shared bicycles (i.e., shared bicycles), shared scooters, shared cars, shared electric bicycles, and so on, for time-shared rental by multiple users. The following describes the smart phone and the shared scooter in detail as an example.
The technical solutions of the embodiments of the present application will be described in detail below with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 2 is a signaling interaction diagram of a communication method based on device codes according to an embodiment of the present invention. The embodiment relates to the process that the terminal device can control the opening or closing of the shared scooter through the interactive connection of the terminal device, the server and the shared scooter. The embodiment of the invention takes a terminal device, a server and a shared vehicle as examples, and the method of the embodiment of the invention is explained. As shown in fig. 2, the method includes:
s101, the terminal equipment sends an equipment code request to a server.
Specifically, the embodiment of the invention obtains the device code corresponding to the shared vehicle through the communication connection between the terminal device and the server.
For example, a user holding the terminal device by hand scans a two-dimensional code identifier on the shared scooter through the terminal device, and then the terminal device sends a device code request to the server according to the two-dimensional code, so as to obtain a device code of the shared scooter.
For another example, an application associated with the shared scooter is installed on the terminal device, and the user selects the shared scooter on the interactive interface of the terminal device, and simultaneously can select a text link corresponding to the shared scooter, and send a device code request to the server through the text link, so that the terminal device obtains the device code of the shared scooter.
S102, the server receives a device code request sent by the terminal device.
In this embodiment, when the terminal device sends a device code request to the server, the server receives the device code request to search for a device code corresponding to the shared vehicle in a pre-stored database.
S103, the server searches in a pre-stored database according to the equipment code request to obtain an equipment code corresponding to the shared vehicle, and sends the equipment code to the terminal equipment so as to indicate the terminal equipment to carry out a communication connection request.
The server receives the device code request sent by the terminal device, obtains the device code corresponding to the shared vehicle by searching in the pre-stored database, and then sends the device code to the terminal device, so that the terminal device can carry out the communication connection request with the shared vehicle.
And S104, the terminal equipment receives the equipment code returned by the server and sends a connection request to the shared vehicle according to the equipment code so as to establish communication connection with the shared vehicle, wherein the connection request comprises a connection code, and the connection code comprises the equipment code.
In this embodiment, the connection code adopts a fixed format, for example, the data header of the connection code all adopts 0x1234, the terminal device sets the acquired device code behind the data header, generates the connection code, and sends a connection request to the shared vehicle, where the connection request includes the connection code.
In an optional embodiment, the connection code further includes a random code and a communication code; generating a connection code according to the device code, including:
acquiring the generated random code and communication code according to a preset rule; performing XOR processing on each byte after the random code according to the random code to obtain a processed random code; and generating a connection code by the processed random code, the equipment code and the communication code.
The method comprises the steps that specific terminal equipment obtains a generated random code and a communication code according to a preset rule, wherein the preset rule of the random code is that each integer is traversed in sequence in the process of extracting the next integer at intervals of every 3 integers within the range of integers from 0 to 9, one integer is extracted every time, and for example, the first time the integer 3 is extracted is the random code; the predetermined specification of the random code may also refer to a random function, which may be unique or repetitive. The communication code refers to a rule and a convention that data signals of message information signal composing information blocks composing the message obey one in the processes of forming format, sending, receiving and processing, so the generation of the communication code can refer to the prior art, and the embodiment is not limited in the present invention.
In this embodiment, the connection code uses a data header with a fixed format, for example, 0x1234, and the length of the data header, the random code, the communication code, the data information, and the Check code may be sequentially set after the data header, where a CRC (Cyclic Redundancy Check) value of the device code may be the Check code. The terminal device performs exclusive or processing on each byte after the random code according to the random code, namely performing decimal conversion and binary conversion on each byte after the random code, wherein the decimal conversion and the binary conversion are the same and are set to be 0, and when the decimal conversion and the binary conversion are different, the decimal conversion and the binary conversion are set to be 1, so that the processed random code is obtained; and generating a connection code from the processed random code, the equipment code and the communication code. And the terminal equipment sends a connection request to the shared vehicle, wherein the connection request comprises a connection code.
The random code can be represented by one byte, a new random code can be adopted in each communication, subsequent data are encrypted through the random code, the random code can be prevented from being cracked by others, the random code and the CRC value of the equipment code are adopted in actual transmission, and the safety and the reliability of the communication between the terminal equipment and the shared vehicle are further guaranteed.
S105, the shared vehicle receives a connection request sent by the terminal equipment, wherein the connection request comprises a connection code.
In this embodiment, the terminal device and the shared vehicle have a communication function, and may interact with each other. The sharing vehicle receives the connection request sent by the terminal device so as to send a connection instruction to the terminal device after processing.
S106, the shared vehicle analyzes the connection code to obtain an analyzed connection code, wherein the analyzed connection code comprises the equipment code.
In this embodiment, the shared vehicle receives the connection request, and parses the connection code, specifically in combination with the above example, according to the data header at the beginning of the connection code and the last check code (i.e., the CRC value of the device code), the integrity of the connection code is determined, and then the processed random code is parsed, so as to obtain the random code, the communication code, and the data information, where the parsed connection code includes the device code.
And S107, the shared scooter matches the equipment code with a preset equipment code, and if the matching is successful, a connection instruction is sent to the terminal equipment, wherein the connection instruction is used for indicating the connection code to be successfully matched, so that the terminal equipment establishes communication connection with the shared scooter according to the connection instruction, and the shared scooter is started or closed.
Specifically, the shared vehicle matches the preset equipment code according to the equipment code in the analyzed connection code; and if the matching is successful, sending a connection instruction to the terminal equipment, wherein the connection instruction is used for indicating that the connection code is successfully matched, so that the terminal equipment establishes communication connection with the shared vehicle according to the connection instruction. The preset device code may include a device code corresponding to the shared scooter one-to-one, which is pre-stored in the shared scooter, and is not limited in this embodiment. In an alternative embodiment, for example, the format 0x11 is used to represent an unlock command, and the format 0x22 is used to represent a lock close command.
In an alternative embodiment, a device code verification instruction represented by 0x55 may be used, and if the device code is successfully matched with the preset device code, a connection instruction is generated.
And S108, the terminal equipment sends a communication request to the shared vehicle, wherein the communication request comprises a communication code so as to enable the shared scooter to be started or closed.
In this embodiment, when the terminal device makes a communication request after establishing a communication connection with the shared vehicle for the first time, the communication request includes a communication code.
S109, the shared vehicle receives a communication request sent by the terminal equipment, wherein the communication request comprises a communication code;
and if the communication code is matched with the prestored communication code, communicating with the terminal equipment.
The shared vehicle receives a communication request sent by the terminal device, such as "transmission data a"; and the sharing vehicle detects whether the communication code in the communication request is matched with the prestored communication code according to the communication request, for example, the communication code at the last moment, and if the matching is successful, the sharing vehicle communicates with the terminal equipment.
In an optional embodiment, in the communication process of the terminal device and the shared scooter, only when the terminal device is connected with the shared scooter for the first time, a unique device code needs to be verified, as long as the terminal device and the shared scooter are not in a communication disconnection state, the communication connection between the subsequent terminal device and the shared scooter only adopts the communication code to verify, thereby avoiding other subsequent people from acquiring the use permission of the shared scooter, further improving the safety and reliability of data transmission, and only needing to verify the device code for the first time, the operation is simple and convenient, the efficiency of using the shared scooter is greatly improved, and further the user experience is improved.
In this embodiment, a connection code including a device code, a communication code, and a random code is used to ensure the security and reliability of data communication. Especially, the device code has uniqueness, and the combination of the encryption processing of the random code can be equivalent to a random encryption mechanism, so that the connection codes encrypted in each communication are ensured to be different. The equipment code is adopted for checking when the terminal equipment is in communication connection with the shared scooter for the first time, the uniqueness and the safety of data are guaranteed, then the communication connection between the terminal equipment and the shared scooter is verified only through the communication code, and random codes are adopted for encryption, so that ciphertexts in each communication are different, and others cannot execute locking and unlocking through forging the ciphertexts. In addition, since the CRC value of the device code cannot be obtained, even if other people know the entire packet data, the communication format and the encryption method of the above embodiment, the encryption of the random code in combination with the check code cannot be obtained. The interaction between the terminal device and the shared scooter is prevented from being cracked by other people, and the safety and the reliability of the interaction between the terminal device and the shared scooter are ensured.
On the basis of the above-described embodiment, a description is given below of a procedure of how the sharing vehicle interacts with the terminal device. Fig. 3 is a flowchart illustrating a communication method based on device codes according to an embodiment of the present invention. The embodiment relates to a specific process of interaction between a shared vehicle and a terminal device. The embodiment of the invention takes a shared vehicle as an execution subject to describe the method of the embodiment. As shown in fig. 3, on the basis of the above embodiment, the method includes:
s201, the shared vehicle receives a connection request sent by the terminal equipment, wherein the connection request comprises a connection code.
The technical terms, technical effects, technical features and optional embodiments of step S201 can be understood by referring to step S103 shown in fig. 2, and repeated contents will not be described herein.
S202, the server analyzes the connection code to obtain an analyzed connection code, wherein the analyzed connection code comprises the equipment code.
In an optional embodiment, the parsed connection code further includes a random code and a communication code; analyzing the connection code to obtain the analyzed connection code, including: if the connection request is detected to be in accordance with the preset format, analyzing the connection code to obtain an equipment code, and acquiring a Cyclic Redundancy Check (CRC) value of the equipment code; and determining the random code and the data information according to the CRC value.
Fig. 4 is a schematic diagram of a connection request format in the communication method based on device codes according to this embodiment. As shown in fig. 4, the connection request includes a connection protocol head at the beginning and a blank line at the end, and the like in a preset format, where the connection request includes a connection code, and if it is detected that the connection request conforms to the preset format, the connection code is parsed to obtain a device code. Referring to fig. 5, fig. 5 is a schematic diagram of a connection code in the communication method based on the device code provided in this embodiment, as shown in fig. 5, the middle part of the connection code is a length, which may be represented by one byte to indicate the length of subsequent data, and then sequentially represents a random code, a communication code, and data information, where the random code may also be represented by one byte, a new random code is generated in each communication interaction process, and the random code may encrypt subsequent communication interactions, that is, perform xor processing on each byte after the random code, and the security and reliability of data transmission are further ensured by adding the check code to the processed random code.
S203, matching the equipment code with a preset equipment code, and if the equipment code is successfully matched, sending a connection instruction to the terminal equipment, wherein the connection instruction is used for indicating that the connection code is successfully matched, so that the terminal equipment establishes communication connection with the shared vehicle according to the connection instruction.
In an optional embodiment, the parsed connection code further includes a random code and a communication code; the random code and the communication code are generated according to a preset rule; before sending the first instruction to the terminal device, the method further comprises: carrying out XOR processing on each byte after the random code by using the random code to obtain a processed random code; and generating a first instruction according to the processed random code and the communication code. The random code and the communication code can be generated according to preset rules in the prior art, and the random code can also be combined with the embodiment to analyze the connection code to obtain the equipment code and obtain the Cyclic Redundancy Check (CRC) value of the equipment code if the connection request is detected to be in accordance with the preset format; and then, according to the CRC value, determining a random code. The present embodiment is not particularly limited.
Specifically, the connection code analyzed by the shared vehicle comprises an equipment code, a random code, data information and a communication code, the equipment code is matched with a preset equipment code, and if the matching is successful, before a connection instruction is sent to the terminal equipment, the server performs exclusive or processing on each byte after the random code by using the random code to obtain a processed random code; and generating a connection instruction according to the processed random code and the communication code.
And then, the shared scooter sends a connection instruction to the terminal device, and the connection instruction is used for indicating that the connection code is successfully matched, so that the terminal device establishes communication connection with the shared scooter according to the connection instruction, and the shared scooter is started or closed.
In an optional embodiment, the method further comprises sending a prompt message to the terminal device if the shared vehicle matching fails, wherein the prompt message is used for indicating that the connection code matching fails.
On the basis of the above embodiments, the following describes how the terminal device interacts with the server. Fig. 6 is a flowchart illustrating a communication method based on device codes according to an embodiment of the present invention. The embodiment relates to a specific process of how the terminal equipment interacts with the server. The embodiment of the present invention takes a terminal device as an execution subject to describe the method of the embodiment. As shown in fig. 6, on the basis of the above embodiment, the method includes:
s301, sending a device code request to a server.
In an alternative embodiment, the device code request further includes location information of the shared vehicle.
Specifically, the terminal device sends a device code request to the server according to the location information of the shared vehicle.
In this embodiment, the user holds the terminal device and expects to use a shared vehicle, such as a shared scooter. In an optional embodiment, the terminal device may obtain the positioning information in real time, or after the user determines the shared scooter, open the positioning setting of the terminal device to obtain the positioning information of the shared scooter, which is not specifically limited in this embodiment. And the terminal equipment sends an equipment code request to the server according to the positioning information so as to receive the equipment code returned by the server subsequently.
S302, receiving the equipment code returned by the server, and sending a connection request to the shared vehicle according to the equipment code to establish communication connection with the shared vehicle, wherein the connection request comprises a connection code, and the connection code comprises the equipment code.
The technical terms, technical effects, technical features and optional embodiments of steps S301 to S302 can be understood with reference to steps S101 and S104 shown in fig. 2, and repeated contents will not be described herein.
In an optional embodiment, further comprising:
and receiving a prompt message sent by the sharing vehicle, and displaying the prompt message on the interactive interface to remind a user, wherein the prompt message is used for indicating that the connection code matching fails.
In this embodiment, if the shared vehicle matching fails, a prompt message is sent to the terminal device. The terminal device receives the prompt message and displays the prompt message on the interactive interface to prompt the user, where the prompt message is used to indicate that the connection code matching fails, for example, referring to fig. 7, fig. 7 is a schematic diagram of the prompt message in the communication method based on the device code according to the embodiment of the present invention. So that the user can see or hear the prompting message on the interactive interface of the terminal equipment.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Fig. 8 is a schematic structural diagram of a shared vehicle controller according to an embodiment of the present invention. The shared vehicle controller may be implemented by software, hardware, or a combination of both to perform the processing method described above.
As shown in fig. 8, the shared vehicle controller 40 includes:
a first receiving module 41, configured to receive a connection request sent by a terminal device, where the connection request includes a connection code;
the analysis module 42 is configured to analyze the connection code to obtain an analyzed connection code, where the analyzed connection code includes an equipment code;
and a matching module 43, configured to match the device code with a preset device code, and if the matching is successful, send a connection instruction to the terminal device, where the connection instruction is used to indicate that the connection code is successfully matched, so that the terminal device establishes a communication connection with the shared vehicle according to the connection instruction, and the shared scooter is turned on or turned off.
In an optional embodiment, the parsed connection code further includes a random code and a communication code; analyzing the connection code to obtain the analyzed connection code, including:
if the connection request is detected to be in accordance with the preset format, analyzing the connection code to obtain an equipment code, and acquiring a Cyclic Redundancy Check (CRC) value of the equipment code;
and determining a random code and a communication code according to the CRC value.
In an optional embodiment, the parsed connection code further includes a random code and a communication code; the random code and the communication code are generated according to a preset rule; before sending the connection instruction to the terminal device, the method further comprises:
carrying out XOR processing on each byte after the random code by using the random code to obtain a processed random code;
and generating a connection instruction according to the processed random code and the communication code.
In an optional embodiment, a communication request sent by a terminal device is received, wherein the communication request includes a communication code;
and if the communication code is matched with the prestored communication code, communicating with the terminal equipment.
In an optional embodiment, further comprising:
and if the matching fails, sending a prompt message to the terminal equipment.
The shared vehicle controller provided by the embodiment of the application can execute the actions of the shared vehicle controller in the above method embodiments, and the implementation principle and the technical effect are similar, and are not described again here.
Fig. 9 is a schematic structural diagram of a terminal device according to an embodiment of the present invention. The terminal device may be implemented by software, hardware, or a combination of both to perform the communication method. As shown in fig. 9, the terminal device 50 includes:
a sending module 51, configured to send a device code request to a server;
and a second receiving module 52, configured to receive the device code returned by the server, and send a connection request to the shared vehicle according to the device code, so as to establish a communication connection with the shared vehicle, where the connection request includes a connection code, and the connection code includes the device code.
In an optional embodiment, the connection code further includes a random code and a communication code; generating a connection code according to the device code, including:
acquiring the generated random code and communication code according to a preset rule;
performing XOR processing on each byte after the random code according to the random code to obtain a processed random code;
and generating a connection code by the processed random code, the equipment code and the communication code.
In an optional embodiment, further comprising:
and sending a communication request to the sharing vehicle, wherein the communication request comprises a communication code.
In an optional embodiment, the device code request further includes
Location information of the vehicle is shared.
In an optional embodiment, further comprising:
and receiving a prompt message sent by the sharing vehicle, and displaying the prompt message on the interactive interface to remind a user, wherein the prompt message is used for indicating that the connection code matching fails.
The terminal device provided in the embodiment of the present application may execute the actions of the terminal device in the above method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. As shown in fig. 10, the electronic device may include: at least one processor 61 and a memory 62. Fig. 10 shows an electronic device as an example of a processor.
And a memory 62 for storing programs. In particular, the program may include program code including computer operating instructions.
The memory 62 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The processor 61 is configured to execute computer-executable instructions stored in the memory 62 to implement the server-side speech processing method described above.
Alternatively, the processor 61 is configured to execute computer-executable instructions stored in the memory 62 to implement the voice processing method on the display device side described above.
The processor 61 may be a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement the embodiments of the present Application.
Alternatively, in a specific implementation, if the communication interface, the memory 62 and the processor 61 are implemented independently, the communication interface, the memory 62 and the processor 61 may be connected to each other through a bus and perform communication with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. Buses may be classified as address buses, data buses, control buses, etc., but do not represent only one bus or type of bus.
Alternatively, in a specific implementation, if the communication interface, the memory 62 and the processor 61 are integrated into a chip, the communication interface, the memory 62 and the processor 61 may complete communication through an internal interface.
The present invention also provides a computer-readable storage medium, which may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and in particular, the computer-readable storage medium stores program instructions for the method at the first terminal side or the method at the second terminal side.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (13)

1. A method for device code based communication, comprising:
receiving a connection request sent by terminal equipment, wherein the connection request comprises a connection code;
analyzing the connection code to obtain an analyzed connection code, wherein the analyzed connection code comprises an equipment code;
matching the equipment code with a preset equipment code, and if the equipment code is successfully matched, sending a connection instruction to the terminal equipment, wherein the connection instruction is used for indicating that the connection code is successfully matched, so that the terminal equipment establishes communication connection with a shared vehicle according to the connection instruction, and the shared vehicle is started or closed;
the analyzed connection code also comprises a random code and a communication code; analyzing the connection code to obtain the analyzed connection code, including:
if the connection request is detected to be in accordance with a preset format, analyzing the connection code to obtain an equipment code, and acquiring a Cyclic Redundancy Check (CRC) value of the equipment code;
determining the random code and a communication code according to the CRC value; the random code and the communication code are used to generate the connection instruction.
2. The method according to claim 1, wherein the parsed concatenated code further includes a random code and a communication code; the random code and the communication code are generated according to a preset rule; before sending a connection instruction to the terminal device, the method further includes:
carrying out XOR processing on each byte after the random code by using the random code to obtain a processed random code;
and generating the connection instruction according to the processed random code and the communication code.
3. The method of claim 1, further comprising:
receiving a communication request sent by terminal equipment, wherein the communication request comprises a communication code;
and if the communication code is matched with a pre-stored communication code, communicating with the terminal equipment.
4. The method of claim 1, further comprising:
and if the matching fails, sending a prompt message to the terminal equipment.
5. A method for device code based communication, comprising:
sending a device code request to a server;
receiving a device code returned by the server, and sending a connection request to a shared vehicle according to the device code so as to establish communication connection with the shared vehicle, wherein the connection request comprises a connection code, and the connection code comprises the device code;
the connection code also comprises a random code and a communication code; generating a connection code according to the device code, including:
acquiring the generated random code and communication code according to a preset rule;
according to the random code, carrying out XOR processing on each byte after the random code to obtain a processed random code;
and generating the connection code by using the processed random code, the equipment code and the communication code.
6. The method of claim 5, further comprising:
and sending a communication request to the sharing vehicle, wherein the communication request comprises a communication code.
7. The method of claim 5, wherein the device code request further comprises
The location information of the shared vehicle.
8. The method of claim 5, further comprising:
and receiving a prompt message sent by the sharing vehicle, and displaying the prompt message on an interactive interface to remind a user, wherein the prompt message is used for indicating that the connection code matching fails.
9. A method for device code based communication, comprising:
receiving a device code request sent by terminal equipment; searching in a pre-stored database according to the equipment code request to obtain an equipment code corresponding to the shared vehicle, and sending the equipment code to the terminal equipment to indicate the terminal equipment to carry out a communication connection request; the connection request comprises a connection code; the connection code also comprises a random code and a communication code; the connection code is generated based on the processed random code, the device code and the communication code;
the processed random code is obtained by performing exclusive or processing on each byte after the random code; the random code and the communication code are obtained based on a preset rule.
10. A shared vehicle, characterized in that the shared vehicle comprises:
the terminal equipment comprises a first receiving module, a second receiving module and a sending module, wherein the first receiving module is used for receiving a connection request sent by the terminal equipment, and the connection request comprises a connection code;
the analysis module is used for analyzing the connection code to obtain an analyzed connection code, wherein the analyzed connection code comprises an equipment code;
the matching module is used for matching the equipment code with a preset equipment code, and if the equipment code is successfully matched, sending a connection instruction to the terminal equipment, wherein the connection instruction is used for indicating that the connection code is successfully matched, so that the terminal equipment establishes communication connection with a shared vehicle according to the connection instruction, and the shared vehicle is started or closed;
the analyzed connection code also comprises a random code and a communication code; analyzing the connection code to obtain the analyzed connection code, including:
if the connection request is detected to be in accordance with a preset format, analyzing the connection code to obtain an equipment code, and acquiring a Cyclic Redundancy Check (CRC) value of the equipment code;
determining the random code and a communication code according to the CRC value; the random code and the communication code are used to generate the connection instruction.
11. A terminal device, characterized in that the terminal device comprises:
the sending module sends a device code request to the server;
the second receiving module is used for receiving the equipment code returned by the server and sending a connection request to a shared vehicle according to the equipment code so as to establish communication connection with the terminal equipment, wherein the connection request comprises a connection code so that the shared vehicle is started or closed;
the connection code also comprises a random code and a communication code; generating a connection code according to the device code, including:
acquiring the generated random code and communication code according to a preset rule;
according to the random code, carrying out XOR processing on each byte after the random code to obtain a processed random code;
and generating the connection code by using the processed random code, the equipment code and the communication code.
12. A readable storage medium, in which a computer program is stored which, when being executed by a processor, is adapted to carry out the method of any one of claims 1-4.
13. A readable storage medium, in which a computer program is stored which, when being executed by a processor, is adapted to carry out the method of any one of claims 5 to 8.
CN201911398790.2A 2019-12-30 2019-12-30 Communication method, device and system based on equipment code Active CN111148275B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911398790.2A CN111148275B (en) 2019-12-30 2019-12-30 Communication method, device and system based on equipment code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911398790.2A CN111148275B (en) 2019-12-30 2019-12-30 Communication method, device and system based on equipment code

Publications (2)

Publication Number Publication Date
CN111148275A CN111148275A (en) 2020-05-12
CN111148275B true CN111148275B (en) 2022-01-25

Family

ID=70521964

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911398790.2A Active CN111148275B (en) 2019-12-30 2019-12-30 Communication method, device and system based on equipment code

Country Status (1)

Country Link
CN (1) CN111148275B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113840282A (en) * 2021-09-27 2021-12-24 中国建设银行股份有限公司 Internet of things information transmission method and device, storage medium and electronic equipment
CN114980071B (en) * 2022-06-23 2023-06-23 中国联合网络通信集团有限公司 Terminal upgrading method, device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106657063A (en) * 2016-12-22 2017-05-10 江苏萝卜交通科技有限公司 Unlocking method for electric vehicle, vehicle cloud platform and mobile terminal
CN107181742A (en) * 2017-05-16 2017-09-19 珠海晶通科技有限公司 A kind of shared bicycle electronic lock system and its method for unlocking
CN108234651A (en) * 2018-01-02 2018-06-29 京东方科技集团股份有限公司 A kind of shared vehicles management method, device, system and equipment, storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106657063A (en) * 2016-12-22 2017-05-10 江苏萝卜交通科技有限公司 Unlocking method for electric vehicle, vehicle cloud platform and mobile terminal
CN107181742A (en) * 2017-05-16 2017-09-19 珠海晶通科技有限公司 A kind of shared bicycle electronic lock system and its method for unlocking
CN108234651A (en) * 2018-01-02 2018-06-29 京东方科技集团股份有限公司 A kind of shared vehicles management method, device, system and equipment, storage medium

Also Published As

Publication number Publication date
CN111148275A (en) 2020-05-12

Similar Documents

Publication Publication Date Title
EP3723399A1 (en) Identity verification method and apparatus
CN111181928B (en) Vehicle diagnosis method, server, and computer-readable storage medium
US8590024B2 (en) Method for generating digital fingerprint using pseudo random number code
CN110719173B (en) Information processing method and device
US20120155636A1 (en) On-Demand Secure Key Generation
JP2014204444A (en) Method and device for detecting manipulation of sensor and/or sensor data of the sensor
CN110690956B (en) Bidirectional authentication method and system, server and terminal
CN115396121B (en) Security authentication method for security chip OTA data packet and security chip device
CN111131300B (en) Communication method, terminal and server
CN112396735B (en) Internet automobile digital key safety authentication method and device
CN113221128B (en) Account and password storage method and registration management system
CN112615834B (en) Security authentication method and system
CN111148275B (en) Communication method, device and system based on equipment code
CN105262592A (en) Data interaction method and API interface
CN104836784A (en) Information processing method, client, and server
CN112241527B (en) Secret key generation method and system of terminal equipment of Internet of things and electronic equipment
CN113872770A (en) Security verification method, system, electronic device and storage medium
CN111800276B (en) Service processing method and device
CN108292997B (en) Authentication control system and method, server device, client device, authentication method, and recording medium
CN111385258A (en) Data communication method, device, client, server and storage medium
CN112367329B (en) Communication connection authentication method, device, computer equipment and storage medium
CN111541642B (en) Bluetooth encryption communication method and device based on dynamic secret key
JP6723422B1 (en) Authentication system
CN114244505A (en) Safety communication method based on safety chip
CN113872769B (en) Device authentication method and device based on PUF, computer device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant