An access network communication method, a gateway device, and a peripheral device
By using the method of determining the scrambling code and verification code between the gateway device and the peripheral device using the address, total time and network key, the problem of poor applicability of device network access communication in the prior art is solved, and a more flexible and efficient network configuration is achieved.
Patent Information
- Application Number
- CN202410175756.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-07
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2044-02-07
AI Technical Summary
In the prior art, the applicability of equipment network communication is poor, especially the root key requires the device to support USIM, and the scope of application of dedicated lines is relatively small.
The first scramble code is determined by the address of the gateway device, the total number of time of the current time group, and the network key, forming a first verification code, and sending it to the peripheral device. The peripheral device determines the second verification code based on its network key and received information. If both are the same, the network access operation will be completed.
It improves the applicability of device network communication, simplifies network configuration, supports large networks with hybrid and independent modes, and replaces network modes with simple and flexible.
Smart Images

Figure CN117997675B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of communications, and particularly to an access communication method, a gateway device, and a peripheral device. Background Art
[0002] Currently, with the development of communication network technologies, more and more communication devices have started to join the communication network to perform control between devices, sending and receiving of data, etc. through the communication network. For example, a gateway device can communicate and interact with multiple peripheral devices.
[0003] In the prior art, methods such as root keys and dedicated lines can be used to implement access communication of devices. However, the root keys in the existing methods require the devices to support USIM (Universal Subscriber Identity Module), and the applicable scope of dedicated lines is relatively small, making the prior art have great limitations and poor applicability. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to provide an access communication method, a gateway device, and a peripheral device to improve the applicability of device access communication.
[0005] To solve the above technical problems, an embodiment of the present application provides an access communication method, which is applied to a gateway device. The gateway device is used to communicate with a peripheral device, and the method includes:
[0006] Determine a first scrambling code according to the address of the gateway device, the total number of times in the current time group, and the network key of the gateway device;
[0007] Select a byte segment formed by bytes at a preset number of positions in the first scrambling code as a first check code;
[0008] Send the first check code, the address of the gateway device, and the total number of times in the current time group to the peripheral device, so that the peripheral device determines a second check code according to the address of the gateway device, the total number of times in the current time group, and the network key of the peripheral device, and when the second check code is the same as the first check code, complete the access operation of the peripheral device for the gateway device.
[0009] An embodiment of the present application also provides an access communication method. The gateway device is a logistics terminal device, and the peripheral device is arranged on a logistics item. The peripheral device on each logistics item is communicatively connected to the logistics terminal device.
[0010] An embodiment of the present application also provides an access network communication method. Determining a first scrambling code according to the address of the gateway device, the total number of times in the current time group, and the network key of the gateway device includes:
[0011] Determine plaintext according to the address of the gateway device and the total number of times in the current time group;
[0012] Input the plaintext and the network key of the gateway device into a preset encryption engine to obtain the first scrambling code.
[0013] An embodiment of the present application also provides an access network communication method. After determining the first scrambling code according to the address of the gateway device, the total number of times in the current time group, and the network key of the gateway device, it further includes:
[0014] Scramble the current original PDU field of the gateway device according to the first scrambling code to obtain a scrambled PDU field; wherein, the current original PDU field is the communication basic data between the peripheral device and the gateway device;
[0015] The gateway device also sends the scrambled PDU field to the peripheral device; the peripheral device determines a second scrambling code according to the network key of the peripheral device, the address of the gateway device in the source packet, and the total number of times in the current time group, and determines the current original PDU field according to the second scrambling code and the scrambled PDU field.
[0016] An embodiment of the present application also provides an access network communication method. The method further includes:
[0017] Determine a first signal synchronization word according to the first scrambling code;
[0018] Send the first signal synchronization word to the peripheral device, so that when the first signal synchronization word is the same as the second signal synchronization word calculated by the peripheral device, the peripheral device and the gateway device perform data interaction.
[0019] An embodiment of the present application also provides an access network communication method. Determining the first signal synchronization word according to the first scrambling code includes:
[0020] Select a first byte segment with a preset length starting from the low bit of the first scrambling code;
[0021] Check the validity of the first byte segment with the preset length according to the preset validity condition;
[0022] If the validity check fails, reselect a second byte segment of a preset length different from the first byte segment of the preset length from the first scrambling code until the second byte segment of the preset length passes the validity check, and use the second byte segment of the preset length as the first signal synchronization word.
[0023] An embodiment of the present application further provides an access network communication method, which is applied to a peripheral device for communicating with a gateway device. The method includes:
[0024] Receiving a first check code, an address of the gateway device, and the total number of times of the current time group sent by the gateway device;
[0025] Determining a second scrambling code according to the network key of the peripheral device, the address of the gateway device, and the total number of times of the current time group;
[0026] Selecting a byte segment formed by bytes at a preset number of positions in the second scrambling code as a second check code;
[0027] If the second check code is the same as the first check code, complete the access network operation of the peripheral device for the gateway device.
[0028] An embodiment of the present application further provides an access network communication method, which further includes:
[0029] Receiving a scrambled PDU field sent by the gateway device;
[0030] Scrambling the scrambled PDU field according to the second scrambling code to obtain a current original PDU field; the current original PDU field is the communication basic data between the peripheral device and the gateway device;
[0031] Receiving a first signal synchronization word sent by the gateway device;
[0032] Determining a second signal synchronization word according to the second scrambling code;
[0033] If the second signal synchronization word is the same as the first signal synchronization word, the peripheral device and the gateway device perform data interaction.
[0034] An embodiment of the present application further provides a gateway device, including: at least one first processor; and,
[0035] A first memory communicatively connected to the at least one first processor; wherein,
[0036] The first memory stores instructions executable by the at least one first processor. The instructions are executed by the at least one first processor, enabling the at least one first processor to execute any of the above-mentioned network access communication methods applied to the gateway device.
[0037] Embodiments of the present application further provide a peripheral device, including: at least one second processor; and,
[0038] a first memory communicatively connected to the at least one second processor; wherein,
[0039] the second memory stores instructions executable by the at least one second processor. The instructions are executed by the at least one second processor, enabling the at least one second processor to execute any of the above-mentioned network access communication methods applied to the peripheral device.
[0040] In the embodiments of the present application, the gateway device and the peripheral device are configured for network access through a network key. Only when the network key of the peripheral device is the same as that of the gateway device can the network access operation of the peripheral device for the gateway device be completed. The network configuration is simple and easy to use. At the same time, all gateway devices and all peripheral devices can implement a large-scale network in a hybrid mode by using the same network key, and a large-scale network in an independent mode can be achieved by configuring different network keys for different gateway devices. That is, the present application can change different network modes by setting different network keys, and changing the network mode is relatively simple and flexible without the need to rely on other hardware facilities. Therefore, the network access communication method of the present application has strong applicability. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings, and these exemplary illustrations do not limit the embodiments.
[0042] Figure 1 is a flowchart of the first network access communication method provided by an embodiment of the present application;
[0043] Figure 2 is a schematic diagram of a large-scale network in a hybrid mode provided by an embodiment of the present application;
[0044] Figure 3 is a schematic diagram of a large-scale network in an independent mode provided by an embodiment of the present application;
[0045] Figure 4 is a flowchart of the second network access communication method provided by an embodiment of the present application;
[0046] Figure 5 is a flowchart of the third network access communication method provided by an embodiment of the present application;
[0047] Figure 6 It is a flowchart of the fourth network access communication method provided by an embodiment of the present application;
[0048] Figure 7 It is a flowchart of the fifth network access communication method provided by an embodiment of the present application;
[0049] Figure 8 It is a flowchart of the sixth network access communication method provided by an embodiment of the present application;
[0050] Figure 9 It is a schematic structural diagram of a gateway device provided by an embodiment of the present application;
[0051] Figure 10 It is a schematic structural diagram of a peripheral device provided by an embodiment of the present application. Detailed implementation manners
[0052] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the following will elaborate on each embodiment of the present application with reference to the accompanying drawings. However, those of ordinary skill in the art can understand that in each embodiment of the present application, many technical details are proposed to help readers better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions claimed in the present application can still be implemented. The following division of each embodiment is for convenience of description and should not constitute any limitation on the specific implementation manner of the present application. Each embodiment can be combined and cross-referenced with each other on the premise of not being contradictory.
[0053] Embodiments of the present application relate to a network access communication method, which is applied to a gateway device. The gateway device is used to communicate with a peripheral device. As Figure 1 shown, it specifically includes the following steps.
[0054] Step 101: Determine a first scrambling code according to the address of the gateway device, the total number of times in the current time group, and the network key of the gateway device.
[0055] Among them, the address of the gateway device is used to identify the uniquely corresponding gateway device, and the address of the gateway device can be represented as InitID.
[0056] The total number of times in the current time group can be represented as NextEvtCnt. Among them, the communication between the gateway device and the peripheral device is divided into multiple time groups. Every time a time group passes, the total number of times in the current time group is incremented by one. Among them, each peripheral device has a fixed time group.
[0057] The network key of the gateway device is pre-set. The user can pre-set the network key of the gateway device in the gateway device, and the network key of the gateway device can be represented as netkey1. In an exemplary implementation, the lower 8 bytes of the network key of the gateway device are pre-stored network keys, and the upper 8 bytes are all 0.
[0058] In an exemplary implementation, the length of the first scrambling code can be 16 bytes.
[0059] Step 102: Select a byte segment formed by bytes at a preset number of positions in the first scrambling code as the first check code.
[0060] In an exemplary implementation, the length of the first check code is 4 bytes. A byte segment formed by the lower 4 bytes of the first scrambling code can be selected as the first check code. Of course, it can also be other preset positions, which are not specifically limited in the embodiments of the present application. The first check code can be represented as NetMic1.
[0061] Step 103: Send the first check code, the address of the gateway device, and the total number of times in the current time group to the peripheral device.
[0062] In the embodiments of the present application, the gateway device sends a source packet to the peripheral device. The source packet contains the first check code, the address of the gateway device, and the total number of times in the current time group. After receiving the source packet, the peripheral device determines a second check code according to the network key of the peripheral device, the address of the gateway device in the source packet, and the total number of times in the current time group in the source packet. The method for determining the second check code is the same as the method for the gateway device to determine the first check code, and will not be elaborated here.
[0063] The network key of the peripheral device is pre-set. The user can pre-set the network key of the peripheral device in the peripheral device, and the network key of the peripheral device can be represented as netkey2.
[0064] After the peripheral device determines the second check code, it compares the second check code with the first check code in the source packet. If the second check code and the first check code are the same, the peripheral device can access the network.
[0065] In the embodiments of the present application, the gateway device and the peripheral device are configured to access the network through the network key. Only when the network key of the peripheral device is the same as the network key of the gateway device can it be ensured that the first check code and the second check code are the same, thereby completing the network access operation of the peripheral device for the gateway device. The network configuration for this network access is simple and easy to use.
[0066] Such as Figure 2As shown, all gateway devices and all peripheral devices can implement a large-scale network in hybrid mode by using the same network key. There are multiple gateway devices and multiple peripheral devices in this large-scale network in hybrid mode; as Figure 3 As shown, configuring different network keys for different gateway devices can implement a large-scale network in independent mode. There is one gateway device and multiple peripheral devices in this large-scale network in independent mode. That is, the embodiments of the present application can change different network modes by setting different network keys, and changing the network mode is relatively simple and flexible. Only the network key needs to be configured, and no other hardware facilities are required. Therefore, the applicability of the network access communication method of the present application is relatively strong.
[0067] In the embodiments of the present application, the gateway device determines a first scrambling code according to the address of the gateway device, the total number of times in the current time group, and the network key of the gateway device; selects a byte segment formed by bytes at a preset number of positions in the first scrambling code as the first check code; and sends the first check code, the address of the gateway device, and the total number of times in the current time group to the peripheral device, so that the peripheral device determines a second check code according to the address of the gateway device, the total number of times in the current time group, and the network key of the peripheral device, and when the second check code is the same as the first check code, the network access operation of the peripheral device for the gateway device is completed. The network configuration for network access is simple and easy to use, and changing the network mode is relatively simple and flexible. The applicability of this network access communication method is relatively strong.
[0068] Based on the above Figure 1 Based on the above network access communication method shown, the embodiments of the present application also provide a network access communication method. In the application scenario of a logistics station, the gateway device is a logistics terminal device, which can be a logistics terminal held by a courier. Correspondingly, the peripheral device is set on the logistics item, and the peripheral device on each logistics item is communicatively connected to the logistics terminal device. Of course, in other application scenarios, the gateway device and the peripheral device can also be other devices, which are not specifically limited in the embodiments of the present application.
[0069] Based on the above Figure 1 Based on the above network access communication method shown, the embodiments of the present application also provide a network access communication method, as Figure 4 As shown, step 101, determining the first scrambling code according to the address of the gateway device, the total number of times in the current time group, and the network key of the gateway device specifically includes the following steps.
[0070] Step 401, determining the plaintext according to the address of the gateway device and the total number of times in the current time group.
[0071] In an exemplary implementation, the lower 0-3 bytes of the plaintext are the preset common synchronization word 0x6deb98e8, the lower 4-7 bytes are the total time of the current time group, the 8-13 bytes are the address of the gateway device, and the remaining 14-216 bytes are all 0.
[0072] Step 402: Input the plaintext and the network key of the gateway device into a preset encryption engine to obtain a first scrambling code.
[0073] Among them, the preset encryption engine can be an aes-128 encryption engine. The input of the aes-128 encryption engine is a 16-byte key and a 16-byte plaintext, and the generated output is a 16-byte ciphertext, which belongs to hardware encryption. Of course, the first scrambling code can also be obtained by encrypting through other encryption engines, and no specific limitation is made in the embodiments of the present application.
[0074] In the embodiments of the present application, according to the address of the gateway device and the total time of the current time group, the plaintext is determined, and the plaintext and the network key of the gateway device are input into a preset encryption engine to obtain a first scrambling code, and then the first check code can be further determined through the determined first scrambling code.
[0075] In the above Figure 1 Based on the above-mentioned network access communication method, the embodiments of the present application further provide a network access communication method. After step 101 of determining the first scrambling code according to the address of the gateway device, the total time of the current time group, and the network key of the gateway device, the following steps are further included.
[0076] Scramble the current original PDU (Protocol Data Unit) field of the gateway device according to the first scrambling code to obtain a scrambled PDU field.
[0077] In an exemplary implementation, the first scrambling code can be subjected to a bitwise exclusive OR calculation with the current original PDU field of the gateway device to calculate and obtain a scrambled PDU field.
[0078] The current original PDU field is the communication basic data between the peripheral device and the gateway device, that is, normal communication between the peripheral device and the gateway device can be carried out only after the communication basic data exists in the peripheral device.
[0079] When the gateway device sends the first check code, the address of the gateway device, and the total time of the current time group to the peripheral device, it also sends the scrambled PDU field to the peripheral device, that is, the source packet sent by the gateway device to the peripheral device includes both the first check code, the address of the gateway device, the total time of the current time group, and the scrambled PDU field.
[0080] After the peripheral device determines the second check code and determines that the second check code is the same as the first check code, after completing the network access operation of the peripheral device for the gateway device, continue to determine the second scrambling code according to the network key of the peripheral device, the address of the gateway device in the source packet, and the total number of times of the current time group in the source packet, and determine the current original PDU field according to the second scrambling code and the scrambled PDU field. Among them, the method for determining the second scrambling code is the same as the method for the gateway device to determine the first scrambling code. First, determine the plaintext, and then obtain the second scrambling code according to the plaintext and the network key of the peripheral device. The method for determining the current original PDU field is the same as the method for the gateway device to obtain the scrambled PDU field. Perform a bitwise exclusive OR calculation on the second scrambling code and the scrambled PDU field to obtain the current original PDU field.
[0081] After the peripheral device calculates and obtains the current original PDU field, store the current original PDU field, so that normal communication and interaction can be carried out between the gateway device and the peripheral device.
[0082] In the embodiment of the present application, after the network access operation, determine the current original PDU field according to the scrambled PDU field in the source packet and store it, so that the peripheral device can communicate normally with the gateway device after network access.
[0083] Based on the network access communication method in the above embodiment, the embodiment of the present application further provides a network access communication method, as Figure 5 shown, the above method further includes the following steps.
[0084] Step 501, determine the first signal synchronization word according to the first scrambling code.
[0085] After the peripheral device performs the network access operation and stores the current original PDU field, the gateway device can perform data interaction with the peripheral device. At this time, the gateway device sends a synchronization data packet to the peripheral device, and the synchronization data packet includes request data and the first signal synchronization word. The first signal synchronization word is intercepted from the first scrambling code.
[0086] Step 502, send the first signal synchronization word to the peripheral device.
[0087] After the peripheral device receives the synchronization data packet, compare the first signal synchronization word in the synchronization data packet with the second signal synchronization word calculated by the peripheral device. If the first signal synchronization word is the same as the second signal synchronization word, the peripheral device performs data interaction with the gateway device, that is, the peripheral device determines the response data according to the request data in the synchronization data packet and sends a response packet carrying the response data to the gateway device. After the gateway device receives the response packet, it sends a response confirmation packet to the peripheral device.
[0088] In an embodiment of the present application, the method for the peripheral device to obtain the second signal synchronization word is the same as the method for the gateway device to obtain the first signal synchronization word.
[0089] In an embodiment of the present application, after the peripheral device performs the network access operation and stores the current original PDU field, normal communication data interaction between the peripheral device and the gateway device is carried out according to the first signal synchronization word and the request data.
[0090] Based on the network access communication method in the above Figure 5 shown embodiment, the embodiment of the present application further provides a network access communication method. As Figure 6 shown, in step 501 above, determining the first signal synchronization word according to the first scrambling code further includes the following steps.
[0091] Step 601: Select a first byte segment with a preset length starting from the low bit of the first scrambling code.
[0092] In an exemplary embodiment, starting from the low bit of the scrambling code, 4 bytes can be taken as the first byte segment.
[0093] Step 602: Check the validity of the first byte segment with a preset length according to a preset validity condition.
[0094] Wherein, the preset validity condition is: there is no at least continuous 6 0s or 1s, each byte value cannot be all equal, the number of value flips does not exceed 24 times, and there are at least 2 value flips in the high 6 bits.
[0095] Step 603: If the validity check fails, select a second byte segment with a preset length different from the first byte segment with a preset length from the first scrambling code until the second byte segment with a preset length passes the validity check, and use the second byte segment with a preset length as the first signal synchronization word.
[0096] If the first byte segment does not meet the preset validity condition and the validity check fails, select 4 bytes starting from the low 2 bits of the scrambling code as the second byte segment and continue the validity check. If the validity check of the second byte segment passes, use the 4-byte second byte segment as the first signal synchronization word. If the first byte segment selected from the first scrambling code and each second byte segment do not pass the validity check, a general synchronization word is used. For example, the general synchronization word can be: 0x6deb98e8.
[0097] The embodiment of the application realizes determining the first signal synchronization word according to the first scrambling code by checking the validity of the byte segment in the first scrambling code.
[0098] Based on the network access communication method in the above embodiments, an embodiment of the present application further provides a network access communication method, which is applied to a peripheral device. The peripheral device is used to communicate with a gateway device, such as Figure 7 shown, and specifically includes the following steps.
[0099] Step 701, receive the first check code, the address of the gateway device, and the total number of times in the current time group sent by the gateway device.
[0100] Specifically, the peripheral device receives the source packet sent by the gateway device. The source packet contains the first check code, the address of the gateway device, and the total number of times in the current time group.
[0101] Step 702, determine the second scrambling code according to the network key of the peripheral device, the address of the gateway device, and the total number of times in the current time group.
[0102] Specifically, the peripheral device determines the plaintext according to the address of the gateway device and the total number of times in the current time group in the source packet, and inputs the plaintext and the network key of the peripheral device into a preset encryption engine to obtain the second scrambling code.
[0103] Step 703, select the byte segment formed by the bytes at a preset number of positions in the second scrambling code as the second check code.
[0104] In an exemplary embodiment, the length of the second check code is 4 bytes. The byte segment formed by the lower 4 bytes of the second scrambling code can be selected as the second check code. Of course, it can also be other preset positions, which are not specifically limited in the embodiments of the present application. The second check code can be represented as NetMic2.
[0105] Step 704, if the second check code is the same as the first check code, complete the network access operation of the peripheral device for the gateway device.
[0106] If the second check code is the same as the first check code, the peripheral device can access the network.
[0107] In the embodiments of the present application, network access is configured by configuring the network key on the peripheral device side. When the network key of the peripheral device is the same as the network key of the gateway device, the first check code and the second check code are the same, and then the network access operation of the peripheral device for the gateway device is completed.
[0108] In the above Figure 7 Based on the network access communication method in the shown embodiment, an embodiment of the present application further provides a network access communication method, which is applied to a peripheral device, such as Figure 8 shown, and specifically includes the following steps.
[0109] Step 801, receive the scrambled PDU field sent by the gateway device.
[0110] The source packet sent by the gateway device not only contains the first check code, the address of the gateway device, the total number of times of the current time group, but also contains the calculated scrambled PDU field.
[0111] Step 802, according to the second scrambling code, scramble the scrambled PDU field to obtain the current original PDU field.
[0112] In an exemplary implementation, the second scrambling code can be XOR-calculated with the scrambled PDU field to calculate the current original PDU field, and the current original PDU field is stored. The current original PDU field is the basic communication data between the peripheral device and the gateway device.
[0113] Step 803, receive the first signal synchronization word sent by the gateway device.
[0114] After the network access is completed, the peripheral device and the gateway device communicate normally. Specifically, the gateway device sends a synchronization data packet to the peripheral device, and the synchronization data packet contains the first signal synchronization word and the request data.
[0115] Step 804, determine the second signal synchronization word according to the second scrambling code.
[0116] Specifically, starting from the low bit of the second scrambling code, select a third byte segment with a preset length, and perform a validity check on the third byte segment with the preset length according to the preset validity condition. If the validity check fails, reselect a fourth byte segment with a preset length different from the third byte segment with the preset length from the second scrambling code until the fourth byte segment with the preset length passes the validity check, and use the fourth byte segment with the preset length as the second signal synchronization word.
[0117] Step 805, if the second signal synchronization word is the same as the first signal synchronization word, the peripheral device and the gateway device perform data interaction.
[0118] If the second signal synchronization word is the same as the first signal synchronization word, the peripheral device determines the response data according to the request data in the synchronization data packet, and sends a response packet carrying the response data to the gateway device.
[0119] In the embodiment of the present application, the normal communication data interaction between the peripheral device and the gateway device is completed on the peripheral device side after the peripheral device completes the network access operation.
[0120] The step division of the above various methods is only for clear description. When implemented, they can be combined into one step or some steps can be split into multiple steps. As long as the same logical relationship is included, they are all within the protection scope of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs, but not changing the core design of its algorithm and process are all within the protection scope of this patent.
[0121] An embodiment of the present application relates to a gateway device, such as Figure 9 shown, including: at least one first processor 901; and a first memory 902 communicatively connected to the at least one first processor 901; wherein, the first memory 902 stores instructions executable by the at least one first processor 901, and the instructions are executed by the at least one first processor 901 to enable the at least one first processor 901 to execute the network access communication method applied to the gateway device in the above embodiments.
[0122] An embodiment of the present application relates to a peripheral device, such as Figure 10 shown, including: at least one second processor 1001; and a second memory 1002 communicatively connected to the at least one second processor 901; wherein, the second memory 1002 stores instructions executable by the at least one second processor 1001, and the instructions are executed by the at least one second processor 1001 to enable the at least one second processor 1001 to execute the network access communication method applied to the peripheral device in the above embodiments.
[0123] Wherein, the memory and the processor are connected in a bus manner. The bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus may also connect various other circuits together, which are well known in the art, and thus will not be further described herein.
[0124] An embodiment of the present application relates to a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the above method embodiments are implemented.
[0125] That is, those skilled in the art can understand that all or part of the steps in implementing the above method embodiments can be completed by a program instructing relevant hardware. The program is stored in a storage medium, including several instructions for causing a device (which may be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0126] Those of ordinary skill in the art can understand that the above embodiments are specific embodiments for implementing the present application, and in practical applications, various changes can be made in form and details without departing from the spirit and scope of the present application.
Claims
1. A network access communication method, characterized in that: The method is applied to a gateway device, the gateway device is used to communicate with peripheral devices, all gateway devices and all peripheral devices form a large network in a mixed mode by using the same network key, different network keys are configured for different gateway devices to form a large network in an independent mode, there is one gateway device and multiple peripheral devices in the large network in the independent mode, the communication between the gateway device and the peripheral devices is divided into multiple time groups, and after each time group, the total time of the current time group is increased by one, the method comprises: Determine a first scrambling code according to the address of the gateway device, the total time of the current time group, and the network key of the gateway device; Selecting a byte segment formed by bytes at a plurality of preset positions in the first scrambling code as a first check code; The first verification code, the address of the gateway device, and the total time of the current time group are sent to the peripheral device, so that the peripheral device determines the second scrambling code according to the address of the gateway device, the total time of the current time group, and the network key of the peripheral device, selects a byte segment formed by bytes at multiple positions preset in the second scrambling code as the second verification code, and completes the network access operation of the peripheral device for the gateway device when the second verification code is the same as the first verification code.
2. The network access communication method according to claim 1, characterized in that: The gateway device is a logistics terminal device, the peripheral devices are arranged on the logistics items, and the peripheral devices on each of the logistics items are communicatively connected with the logistics terminal device.
3. The network access communication method according to claim 1, characterized in that: The determining of the first scrambling code according to the address of the gateway device, the total time of the current time group, and the network key of the gateway device includes: Determine the plain text according to the address of the gateway device and the total time of the current time group; The plain text and the network key of the gateway device are input into a preset encryption engine to obtain the first scrambling code.
4. The network access communication method according to claim 1, characterized in that: After determining the first scrambling code according to the address of the gateway device, the total time of the current time group, and the network key of the gateway device, the method further includes: Scramble the current original PDU field of the gateway device according to the first scrambling code to obtain a scrambled PDU field; wherein the current original PDU field is basic communication data between the peripheral device and the gateway device; The gateway device also sends the scrambled PDU field to the peripheral device; the peripheral device determines a second scrambling code based on the network key of the peripheral device, the address of the gateway device, and the total time of the current time group, and determines the current original PDU field based on the second scrambling code and the scrambled PDU field.
5. The network access communication method according to claim 4, characterized in that: The method further comprises: Determining a first signal synchronization word according to the first scrambling code; The first signal synchronization word is sent to the peripheral device, so that when the first signal synchronization word is the same as the second signal synchronization word calculated by the peripheral device, the peripheral device performs data exchange with the gateway device.
6. The network access communication method according to claim 5, characterized in that: The step of determining a first signal synchronization word according to the first scrambling code comprises: Selecting a first byte segment of a preset length starting from the lower bits of the first scrambling code; Performing a validity check on the first byte segment of the preset length according to a preset validity condition; If the validity check fails, a second byte segment of a preset length that is different from the first byte segment of the preset length is reselected from the first scrambling code until the second byte segment of the preset length passes the validity check, and the second byte segment of the preset length is used as the first signal synchronization word.
7. A network access communication method, characterized in that: The invention is applied to a peripheral device, wherein the peripheral device is used to communicate with a gateway device, wherein all gateway devices and all peripheral devices form a large network in a mixed mode by using the same network key, and different network keys are configured for different gateway devices to form a large network in an independent mode. There is one gateway device and multiple peripheral devices in the large network in the independent mode, and the communication between the gateway device and the peripheral device is divided into multiple time groups. After each time group, the total time of the current time group is increased by one. The method comprises: Receiving a first verification code, an address of the gateway device, and a total time of a current time group sent by the gateway device; Determining a second scrambling code according to the network key of the peripheral device, the address of the gateway device, and the total time of the current time group; Selecting a byte segment formed by bytes at a plurality of preset positions in the second scrambling code as a second check code; If the second verification code is the same as the first verification code, the network access operation of the peripheral device to the gateway device is completed.
8. The network access communication method according to claim 7, characterized in that: The method further comprises: Receiving a scrambled PDU field sent by the gateway device; According to the second scrambling code, the scrambled PDU field is scrambled to obtain a current original PDU field; the current original PDU field is basic communication data between the peripheral device and the gateway device; Receiving a first signal synchronization word sent by the gateway device; Determining a second signal synchronization word according to the second scrambling code; If the second signal synchronization word is the same as the first signal synchronization word, the peripheral device exchanges data with the gateway device.
9. A gateway device, characterized in that: include: at least one first processor; as well as, a first memory communicatively connected to the at least one first processor; wherein, The first memory stores instructions that can be executed by the at least one first processor, and the instructions are executed by the at least one first processor to enable the at least one first processor to execute the network access communication method as claimed in any one of claims 1 to 6.
10. A peripheral device, characterized in that: include: at least one second processor; as well as, a second memory communicatively connected to the at least one second processor; wherein, The second memory stores instructions that can be executed by the at least one second processor, and the instructions are executed by the at least one second processor so that the at least one second processor can execute the network access communication method as claimed in any one of claims 7 to 8.
Citation Information
Patent Citations
Zigbee-based network access method and related device
CN112533203A
Short-distance wireless multi-device data synchronization method
CN116489172A