Method for transmitting data between master terminal and slave terminal, master terminal, slave terminal and electronic equipment

By introducing the concepts of type queues and event queues between the master and slave ends of the POS device, the problem that the slave end cannot actively send data under the SPI communication protocol is solved, and the data transmission efficiency and processing capabilities of the POS device are improved.

CN120029793APending Publication Date: 2025-05-23SHENZHEN XINGUODU TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411939089.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

In the prior art, the SPI communication protocol makes it impossible for the slave device to actively send data to the master, resulting in a decrease in the processing efficiency of the POS device.

Method used

By introducing the concepts of type queues and event queues between the master and slave, the master obtains the type queue based on the active upload request of the slave, and then obtains the event queue, and sends the uploaded data to the corresponding APP application.

Benefits of technology

It realizes the ability to actively send data to the host, improves the data transmission efficiency of POS devices, and can handle timely events and messages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120029793A_ABST
    Figure CN120029793A_ABST
Patent Text Reader

Abstract

The invention discloses a method for transmitting data between a master terminal and a slave terminal, the master terminal, the slave terminal and electronic equipment, which are used for improving the data transmission efficiency of POS (Point Of Sale) equipment. The method for transmitting the data between the master end and the slave end comprises the steps that the master end obtains a type queue according to an uploading request, the uploading request is an initiative uploading request initiated by the slave end to the master end, and the type queue is an uploading type queue arranged according to a preset sequence; the master end obtains an event queue according to the type queue, the event queue is a queue of uploading events arranged according to a preset sequence, the uploading events comprise uploading data and uploading types, the uploading data are peripheral data collected by the slave end, and the uploading data correspond to the uploading types.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data transmission, and in particular to a method for data transmission between a master end and a slave end, a master end, a slave end and an electronic device. Background Art

[0002] At present, in order to ensure the security and efficiency of transactions, most POS devices adopt a dual CPU control solution, which is mainly composed of a main control chip (as the master end) and a security chip (as the slave end). The main control chip is responsible for processing the main business logic and interface interaction of the POS device, while the security chip focuses on encryption operations, data security protection, and management of external devices to ensure that sensitive information is not leaked. The collaboration between the two is crucial, so data interaction is required frequently between them. In order to achieve high-speed and stable data transmission, SPI (Serial Peripheral Interface) communication is generally used in the prior art as a data communication solution between dual CPUs.

[0003] As the functions of POS devices gradually diversify, the number of peripherals that security chips need to control is increasing, and according to the timeliness of some peripheral data (such as biometric verification results or NFC transaction information), the slave end should actively send data to the master end. However, in the SPI communication protocol, the slave end device usually cannot actively send data to the master end and can only wait for the query request from the master end, which greatly reduces the overall processing efficiency of the POS device. Summary of the invention

[0004] In order to solve the above technical problems, the present application provides a method for data transmission between a master end and a slave end, a master end, a slave end and an electronic device, which are used to improve the efficiency of data transmission of a POS device.

[0005] The technical solution provided in this application is described below:

[0006] In a first aspect, the present application provides a method for data transmission between a master end and a slave end, comprising:

[0007] The master end obtains a type queue according to an upload request, wherein the upload request is an active upload request initiated by the slave end to the master end, and the type queue is a queue of upload types arranged in a preset order;

[0008] The master end obtains an event queue according to the type queue, the event queue is a queue of uploaded events arranged according to the preset order, the uploaded events include uploaded data and the uploaded type, the uploaded data is the peripheral data collected by the slave end, and the uploaded data and the uploaded type correspond to each other.

[0009] Optionally, after the master end obtains the event queue according to the type queue, the method further includes:

[0010] The master end obtains the corresponding APP application according to the pre-acquired variable flag and the type queue, wherein the variable flag represents the binding relationship between the APP application and the uploaded type;

[0011] The master end sends the uploaded data in the event queue to the corresponding APP application.

[0012] Optionally, the master end obtains the type queue according to the sending request, including:

[0013] When the master end detects an upload request represented by a chip trigger notification signal, the master end sends a notification of receiving the upload request to a management server, so that the management server obtains the type queue from the slave end according to the notification of the upload request. The management server is a background server built into the master end.

[0014] Optionally, before the master end obtains the corresponding APP application according to the pre-acquired variable flag and the type queue, the method further includes:

[0015] The master end establishes a communication connection with multiple APP applications through the management server;

[0016] The master end receives subscription notifications sent by the multiple APP applications, where the subscription notifications include the variable flag.

[0017] Optionally, the master end obtains the corresponding APP application according to the pre-acquired variable flag and the type queue, including:

[0018] The master end parses the variable flag through the management server to obtain binding relationship information between multiple APP applications and multiple upload types;

[0019] The master end matches the sent type in the type queue with the binding relationship information to obtain a matching result;

[0020] If the matching result indicates that there is a successfully matched uploading type in the type queue, the master end obtains the corresponding APP application according to the successfully matched uploading type.

[0021] Optionally, the master end sending the uploaded data in the event queue to the corresponding APP application includes:

[0022] The master end obtains the upload data corresponding to the successfully matched upload type in the event queue;

[0023] The master end sends the corresponding uploaded data to the corresponding APP application through Socket forwarding.

[0024] A second aspect of the present application provides a method for data transmission between a master end and a slave end, comprising:

[0025] When the slave end detects that there is an upload event in the pre-collected peripheral data, the slave end binds the upload data and the upload type in the upload event, and arranges the upload events in a preset order to generate an event queue;

[0026] The slave end arranges the types of the multiple sent events according to the preset order to generate a type queue;

[0027] The slave end sends an upload request to the master end, and sends the type queue to the master end according to feedback of the upload request;

[0028] The slave end sends the event queue to the master end according to the type queue.

[0029] A third aspect of the present application provides a master end, including:

[0030] An acquisition type queue unit is used to acquire a type queue according to an upload request, wherein the upload request is an active upload request initiated by the slave end to the master end, and the type queue is a queue of upload types arranged in a preset order;

[0031] An event queue acquisition unit is used to acquire an event queue according to the type queue, wherein the event queue is a queue of uploaded events arranged according to the preset order, wherein the uploaded events include uploaded data and the uploaded type, wherein the uploaded data is the peripheral data collected by the slave end, and the uploaded data and the uploaded type correspond to each other.

[0032] A fourth aspect of the present application provides a slave end, including:

[0033] An event queue generating unit is used for binding the uploading data and the uploading type in the uploading event when the slave end detects that there is an uploading event in the pre-collected peripheral data, and arranging the uploading events in a preset order to generate an event queue;

[0034] A type queue generating unit is used to arrange the types of a plurality of sent events according to the preset order to generate a type queue;

[0035] A first sending unit, configured to send an uploading request to a master end, and send the type queue to the master end according to feedback of the uploading request;

[0036] The second sending unit is used to send the event queue to the master end according to the type queue.

[0037] A fifth aspect of the present application provides an electronic device, the electronic device comprising:

[0038] Processor, memory, input-output unit, and bus;

[0039] The processor is connected to the memory, the input and output unit, and the bus;

[0040] The memory stores a program, and the processor calls the program to execute the method for data transmission between the master end and the slave end according to the first aspect and any optional item in the first aspect or the second aspect.

[0041] In a sixth aspect, the present application provides a computer-readable storage medium, on which a program is stored. When the program is executed on a computer, the method for data transmission between a master end and a slave end according to the first aspect and any optional item in the first aspect or the second aspect is executed.

[0042] It can be seen from the above technical solutions that this application has the following advantages:

[0043] The present application provides a method for data transmission between a master and a slave. First, the master obtains a type queue according to an upload request. The upload request is an active upload request initiated by the slave to the master, and the type queue is a queue of upload types arranged in a preset order; then the master obtains an event queue according to the type queue. The event queue is a queue of upload events arranged in a preset order. The upload event includes upload data and upload type. The upload data is the peripheral data collected by the slave, and the upload data and the upload type correspond to each other. The master in the present application obtains the type queue of the slave through the upload request, and then obtains the event queue according to the type queue, and then processes the upload event according to the arrangement order in the event queue. The upload request is actively sent by the slave to the master and triggers subsequent steps. Compared with the polling method of the master, it is more efficient and can process time-sensitive events and messages in a timely manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solution in the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0045] Figure 1 A flowchart of an embodiment of a method for data transmission between a master end and a slave end provided in the present application;

[0046] Figure 2 A flowchart of another embodiment of the method for data transmission between a master end and a slave end provided by the present application;

[0047] Figure 3 A flowchart of another embodiment of the method for data transmission between a master end and a slave end provided by the present application;

[0048] Figure 4 A flowchart of another embodiment of the method for data transmission between a master end and a slave end provided by the present application;

[0049] Figure 5 A flowchart of another embodiment of the method for data transmission between a master end and a slave end provided by the present application;

[0050] Figure 6 A flowchart of another embodiment of the method for data transmission between a master end and a slave end provided by the present application;

[0051] Figure 7 A schematic diagram of the structure of an embodiment of the master end provided in this application;

[0052] Figure 8 A schematic diagram of the structure of an embodiment of the slave end provided in this application;

[0053] Fig. 9 A schematic diagram of the structure of an embodiment of an electronic device provided in this application. DETAILED DESCRIPTION

[0054] The present application provides a method for data transmission between a master end and a slave end, a master end, a slave end and an electronic device, which are used to improve the efficiency of data transmission of a POS device.

[0055] It should be noted that the method for data transmission between the master end and the slave end provided in this application can be applied to POS devices using dual CPUs. The dual CPUs include a master end and a slave end, that is, the method of this application can be applied to the master end and the slave end. The master end and the slave end communicate with each other to perform data transmission. The master end uses a main control chip as the core processor, which is responsible for the main data processing and control functions; the slave end uses a security chip as the core processor, which is responsible for processing security-related data and operations, as well as collecting and storing data from external devices. For the convenience of explanation, this application uses the master end and the slave end as the execution subjects for example.

[0056] It should also be noted that the terms "first", "second", etc. in the specification and drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order, sequence or importance.

[0057] See also Figure 1 , Figure 1An embodiment of a method for data transmission between a master end and a slave end provided in the present application is applied to a master end. The method for data transmission between a master end and a slave end includes:

[0058] Step S101, the master end obtains a type queue according to a sending request, the sending request is an active sending request initiated by the slave end to the master end, and the type queue is a queue of sending types arranged according to a preset order;

[0059] Step S102, the master end obtains the event queue according to the type queue. The event queue is a queue of uploaded events arranged according to a preset order. The uploaded events include uploaded data and uploaded types. The uploaded data is the peripheral data collected by the slave end, and the uploaded data and uploaded types correspond to each other.

[0060] The method for data transmission between the master end and the slave end of the present invention is as follows: first, the master end obtains a type queue according to an upload request, the upload request is an active upload request initiated by the slave end to the master end, and the type queue is a queue of upload types arranged according to a preset order; then the master end obtains an event queue according to the type queue, the event queue is a queue of upload events arranged according to a preset order, the upload event includes upload data and upload type, the upload data is the peripheral data collected by the slave end, and the upload data and the upload type correspond to each other. The master end in the present application obtains the type queue of the slave end through the upload request, and then obtains the event queue according to the type queue, and then processes the upload event according to the arrangement order in the event queue. The upload request is actively sent by the slave end to the master end and triggers subsequent steps. Compared with the polling method of the master end, it is more efficient and can process time-sensitive events and messages in a timely manner.

[0061] In step S101 of some embodiments, the master end obtains a type queue according to a sending request, the sending request is a request for active sending initiated by the slave end to the master end, and the type queue is a queue of sending types arranged according to a preset order. Because the slave end, as a slave device of SPI communication, cannot actively send data to the master end, the master end generally obtains data autonomously, but the master end autonomously polls regularly, which is time-consuming and occupies a large amount of operating resources. Therefore, this embodiment adopts the method of making a request from the slave end to the master end to remind the master end to receive data, that is, the master end receives the sending request sent by the slave end, and sends feedback of the consent request to the slave end, and then obtains the type queue sorted by the slave end. It should be noted that the master end receives the sending request sent by the slave end specifically as follows: when the master end detects the sending request represented by the chip (master control chip) triggering the notification signal, the master end sends the notification of receiving the sending request to the management server, so that the management server obtains the type queue from the slave end according to the notification of the sending request, and the management server is a background server built into the master end. The chip triggering notification signal represents the sending request, which means that the notification signal pin (SPI_INT pin) of the main control chip triggers a falling edge interrupt so that the master end detects the notification signal, and the notification signal represents the sending request from the slave end to the master end.

[0062] It should also be noted that the type queue includes type information of at least one uploaded event. When the number of uploaded events is more than one, the types of uploaded events are arranged in a preset order. For example, they can be sorted according to the time when the slave end collects the peripheral data, or according to the urgency of processing the uploaded events, or they can be sorted according to the size of the peripheral data. There is no specific limitation here.

[0063] In step S102 of some embodiments, the master end obtains the event queue according to the type queue. The event queue is a queue of events sent according to a preset order. The sent events include sent data and sent types. The sent data is the peripheral data collected by the slave end, and the sent data and the sent types correspond to each other. After the master end obtains the type queue in step S101, the event queue sent from the slave end is received and stored by the management server mentioned in step S101 according to the content in the type queue. Among them, the event queue includes at least one sent event, and the event queue and the type queue correspond to each other. In order to generate the event queue, the slave end first associates the type of the sent event with the sent data so that the sent data and the sent type correspond to each other, so that the event queue can correspond to the type queue, that is, the sent events in the event queue are also arranged according to the preset order mentioned in step S101. For example, when the order of the type queue is "transaction upload type, commodity upload type, payment upload type, security upload type, peripheral upload type, system upload type and configuration upload type", the order of the event queue is "transaction event, commodity event, payment event, security event, peripheral event, system event and configuration event". Among them, transaction events include transaction upload type and transaction time, transaction parties, transaction process, transaction status and other related upload data; commodity events include commodity upload type and commodity number, name, price, quantity and other related upload data; payment events include payment upload type and payment method, payment result, payment voucher and other related upload data; security events include security upload type and payment security information, illegal access, data tampering and other related upload data; peripheral events include peripheral upload type and peripheral status information, peripheral operation results and other related upload data; system events include system upload type and system startup, shutdown, restart and other related upload data; configuration events include configuration upload type and network configuration, printing configuration and other related upload data. In summary, the master end obtains the event queue and sends the event queue to the management server for storage, so that the master end can process the data sent from the event queue in subsequent steps.

[0064] Reference Figure 2After the master end obtains the event queue in step S102, it should also process the events in the event queue in order, especially send the uploaded data in the uploaded event to various APP applications, so that the APP applications can process the uploaded data in time, which may include, but is not limited to, the following:

[0065] Step S201, the master end obtains the corresponding APP application according to the pre-acquired variable flag and type queue, and the variable flag represents the binding relationship between the APP application and the uploaded type;

[0066] Step S202: the master end sends the uploaded data in the event queue to the corresponding APP application.

[0067] In steps S201 to S202 of some embodiments, the master end first obtains the corresponding APP application according to the pre-acquired variable flag and type queue, the variable flag represents the binding relationship between the APP application and the upload type, and then sends the upload data in the event queue to the corresponding APP application. Before processing the upload data in the event queue, the master end has stored the pre-acquired variable flag, which instructs the master end to send the upload data to the designated location (i.e., various APP applications), that is, the variable flag represents the binding relationship between the upload type and various APP applications. If a certain APP application can process a certain type of upload data, the master end should send the certain type of upload data to a certain APP application to avoid chaotic data transmission. If there is no variable flag representing the binding relationship to guide the sending operation of the master end, the master end cannot search and filter out the corresponding APP application according to the upload type in multiple APP applications in the POS device, and cannot achieve accurate notification and transmission.

[0068] Reference Figure 3 According to some embodiments of the present invention, the variable flag obtained in advance in step S201 is particularly important. The method for obtaining the variable flag may specifically include, but is not limited to, the following:

[0069] Step S301, the master end establishes communication connections with multiple APP applications through the management server;

[0070] Step S302: the master end receives subscription notifications sent by multiple APP applications, where the subscription notifications include variable flags.

[0071] In steps S301 to S302 of some embodiments, the master end first establishes a communication connection with multiple APP applications through a management server, and then receives subscription notifications sent by multiple APP applications, and the subscription notifications include variable flags. The APP application first sends a connection request to the management server, and the management server verifies the identity and authority of the APP application to ensure the security of the connection. After the verification is passed, the management server will establish a communication channel between the master end and the APP application. The master end performs subsequent data exchange and communication with the APP application through the communication channel. Then the master end receives subscription notifications sent by multiple APP applications, and these subscription notifications contain variable flags with a binding relationship between the APP application and the upload type. That is, the subscription notification is a request sent by the APP application to the master end, which is used to inform the master end APP application which types of upload data it wants to receive. In addition, the variable flag may be a specific data field, status code or other type of identifier. The APP application sends a subscription notification to the master end through the previously established communication connection. After the master end receives the subscription notification, it parses the variable flag information therein. According to the variable flag, the master end establishes a corresponding screening mechanism internally so that it can send the upload data to the APP application in time when obtaining a new upload event. Through step S301 to step S302, a stable and reliable communication, subscription and screening mechanism is established between the master end and multiple APP applications, providing a solid foundation for subsequent real-time data synchronization and status detection.

[0072] Reference Figure 4 According to some embodiments of the present invention, after obtaining the variable flag through steps S301 to S302, the master end in step S201 obtains the corresponding APP application according to the pre-acquired variable flag and type queue, which may specifically include, but is not limited to, the following:

[0073] Step S401: The master end parses the variable flag through the management server to obtain the binding relationship information between multiple APP applications and multiple sending types;

[0074] Step S402, the master end matches the sent type in the type queue with the binding relationship information to obtain a matching result;

[0075] Step S403: If the matching result indicates that there is a successfully matched uploading type in the type queue, the host end obtains the corresponding APP application according to the successfully matched uploading type.

[0076] In steps S401 to S403 of some embodiments, the master end first parses the variable flag through the management server to obtain the binding relationship information between multiple APP applications and multiple upload types, and then matches the upload type in the type queue with the binding relationship information to obtain a matching result; if the matching result indicates that there is a successfully matched upload type in the type queue, the master end obtains the corresponding APP application according to the successfully matched upload type. The variable flag is included when the APP application sends a subscription notification in step S302. The master end receives these variable flags through the management server and parses them to extract the key information therein, that is, the binding relationship information. The binding relationship information refers to the corresponding relationship between the APP application and the upload type. By parsing the variable flag, the master end can obtain which types of upload data each APP application wants to receive. After the master end parses the variable flag, the binding relationship information therein is stored in a database or memory structure for subsequent quick access and update. When a new APP application is added or the subscription requirements of an existing APP application change, the master end will update the binding relationship information accordingly.

[0077] Furthermore, the master end will match the upload type with the binding relationship information obtained in step S401 to determine which APP applications should receive the upload data corresponding to these upload types. The matching result may be a data structure containing a list of successfully matched APP applications. If a certain upload type does not find a matching APP application in the binding relationship information, the upload type can also be marked as unmatched or otherwise processed. If the matching result indicates that there is a successfully matched upload type in the type queue, the master end obtains the corresponding APP application based on the successfully matched upload type, and sends the upload data to these APP applications through the previously established communication connection. Thus, the master end can efficiently process subscription requests from multiple APP applications, and send upload data to the corresponding APP applications based on these requests. This helps to achieve functions such as real-time data synchronization, status detection, and business logic processing.

[0078] Reference Figure 5 According to some embodiments of the present invention, after obtaining the successfully matched upload type and the corresponding APP application through steps S401 to S403, the master end in step S202 sends the upload data in the event queue to the corresponding APP application, which may specifically include, but is not limited to, the following:

[0079] Step S501, the master end obtains the upload data corresponding to the successfully matched upload type in the event queue;

[0080] Step S502: the master end sends the corresponding uploaded data to the corresponding APP application through Socket forwarding.

[0081] In steps S501 to S502 of some embodiments, the master end first obtains the upload data corresponding to the successfully matched upload type in the event queue, and then sends the corresponding upload data to the corresponding APP application through the Socket forwarding method. After finding the APP application corresponding to the successfully matched upload type in step S403, the master end finds the corresponding upload data according to the successfully matched upload type to complete the information screening in the event queue. Furthermore, before sending the data to the APP application, the master end may need to perform some preprocessing on the data, such as formatting, encryption, etc. Then the master end establishes a Socket connection with the APP application, and Socket is a network programming interface that allows network communication between different computers or processes. Once the Socket connection is established and ready, the master end will send the upload data to the APP application through this communication channel to ensure that the data transmission between the master end and the slave end is effective and meaningful.

[0082] Reference Figure 6 , Figure 6 Another embodiment of the method for data transmission between a master end and a slave end provided in the present application is applied to a slave end. The method for data transmission between a master end and a slave end includes:

[0083] Step S601, when the slave end detects that there is an upload event in the pre-collected peripheral data, the slave end binds the upload data and the upload type in the upload event, and arranges the upload events in a preset order to generate an event queue;

[0084] Step S602, the slave terminal arranges the types of multiple sent events in a preset order to generate a type queue;

[0085] Step S603, the slave end stores the event queue and the type queue in a data detection server, which is a background server built into the slave end;

[0086] Step S604, the slave end sends an upload request to the master end, and sends the type queue to the master end according to the feedback of the upload request;

[0087] Step S605: The slave end sends the event queue to the master end according to the type queue.

[0088] In steps S601 to S605 of some embodiments, when the slave detects that there is an upload event in the pre-collected peripheral data, the slave binds the upload data and the upload type in the upload event, and arranges the upload events in a preset order to generate an event queue; then the slave arranges the types of multiple upload events in a preset order to generate a type queue, and stores the event queue and the type queue in a data detection server, which is a background server built into the slave; then the slave sends an upload request to the master, and sends the type queue to the master according to the feedback of the upload request; finally, the slave sends the event queue to the master according to the type queue. The slave screens out the upload data with active upload requirements from the pre-collected peripheral data, and binds the upload data and the upload type to form a complete upload event, and then arranges the upload events in the preset order mentioned in step S101 to generate an event queue. The slave will extract the upload type of each upload event from the event queue, and then arrange these upload types in a preset order (the same as the order of the event queue) to generate a type queue. The data detection server is a built-in background server of the slave, which is used to store and manage the data and events collected by the slave. The slave will store the generated event queue and type queue in the data detection server. Ensure the accessibility of the data for subsequent analysis and processing. Then the slave will send a upload request to the master to indicate that it is ready to send data. After receiving the upload request, the master may send a feedback message to instruct the slave to continue sending data. According to the feedback from the master, the slave will send the type queue to the master. In this way, the master can know the upload type and order corresponding to the upload data to be received. After the slave sends the type queue, the slave will prepare to send the event queue. After receiving the event queue, the master will parse and process the upload event according to the order of the event queue to extract the upload data and perform corresponding operations. As a result, the slave end can efficiently collect, process and send the uploaded data, while the master end can receive and process the data in an orderly manner, ensuring the accuracy and reliability of the data while also improving the overall performance and efficiency of the system.

[0089] The above embodiment describes the method for data transmission between the master end and the slave end provided by the present application. The master end, the slave end, the electronic device and the storage medium provided by the present application are described below:

[0090] See also Figure 7 , the present application provides an embodiment of a master end, the master end comprising:

[0091] The acquisition type queue unit 701 is used to acquire the type queue according to the sending request, the sending request is an active sending request initiated by the slave end to the master end, and the type queue is a queue of sending types arranged according to a preset order;

[0092] The event queue acquisition unit 702 is used to acquire the event queue according to the type queue. The event queue is a queue of uploaded events arranged according to a preset order. The uploaded events include uploaded data and uploaded types. The uploaded data is the peripheral data collected from the end, and the uploaded data and the uploaded type correspond to each other.

[0093] Optionally, after acquiring the event queue unit 702, the method further includes:

[0094] The APP application acquisition unit 703 is used to acquire the corresponding APP application according to the pre-acquired variable flag and type queue, where the variable flag represents the binding relationship between the APP application and the uploaded type;

[0095] The third sending unit 704 is used to send the uploaded data in the event queue to the corresponding APP application.

[0096] Optionally, the acquisition type queue unit 701 is specifically used for:

[0097] When the master detects the uplink request represented by the chip trigger notification signal, it sends a notification of receiving the uplink request to the management server, so that the management server obtains the type queue from the slave according to the notification of the uplink request. The management server is a background server built into the master.

[0098] Optionally, before obtaining the APP application unit 703, the method further includes:

[0099] A connection establishing unit 705 is used to establish a communication connection with multiple APP applications through a management server;

[0100] The subscription notification unit 706 is used to receive subscription notifications sent by multiple APP applications, where the subscription notifications include variable flags.

[0101] Optionally, the APP application acquisition unit 703 is specifically used for:

[0102] By parsing the variable flags through the management server, the binding relationship information between multiple APP applications and multiple upload types is obtained;

[0103] Match the sent type in the type queue with the binding relationship information to obtain a matching result;

[0104] If the matching result indicates that there is a successfully matched upload type in the type queue, the corresponding APP application is obtained according to the successfully matched upload type.

[0105] Optionally, the sending unit 704 is specifically configured to:

[0106] The master end obtains the upload data corresponding to the successfully matched upload type in the event queue;

[0107] The master end sends the corresponding uploaded data to the corresponding APP application through Socket forwarding.

[0108] See also Figure 8 , the present application provides an embodiment of a slave end, the slave end comprising:

[0109] The event queue generating unit 801 is used for binding the uploading data and the uploading type in the uploading event when the slave terminal detects that there is an uploading event in the pre-collected peripheral data, and arranging the uploading events in a preset order to generate an event queue;

[0110] A type queue generating unit 802 is used to arrange the types of multiple sent events in a preset order to generate a type queue;

[0111] The first sending unit 803 is used to send an uploading request to the master end, and send the type queue to the master end according to the feedback of the uploading request;

[0112] The second sending unit 804 is used to send the event queue to the master end according to the type queue.

[0113] This application also provides an electronic device, see Fig. 9 , the electronic device comprises:

[0114] Processor 901, memory 902, input and output unit 903, bus 904;

[0115] The processor 901 is connected to the memory 902, the input and output unit 903 and the bus 904;

[0116] The memory 902 stores a program, and the processor 901 calls the program to execute the following steps: Figures 1 to 6 A method for data transmission between a master end and a slave end as shown in any one of the embodiments.

[0117] The present application also relates to a computer-readable storage medium, on which a program is stored, and when the program is run on a computer, the computer executes the following Figures 1 to 6 A method for data transmission between a master end and a slave end as shown in any one of the embodiments.

[0118] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0119] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0120] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0121] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0122] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.

Claims

1. A method for data transmission between a master end and a slave end, characterized in that: The method comprises: The master end obtains a type queue according to an upload request, wherein the upload request is an active upload request initiated by the slave end to the master end, and the type queue is a queue of upload types arranged in a preset order; The master end obtains an event queue according to the type queue, the event queue is a queue of uploaded events arranged according to the preset order, the uploaded events include uploaded data and the uploaded type, the uploaded data is the peripheral data collected by the slave end, and the uploaded data and the uploaded type correspond to each other.

2. The method according to claim 1, characterized in that After the master end obtains the event queue according to the type queue, the method further includes: The master end obtains the corresponding APP application according to the pre-acquired variable flag and the type queue, wherein the variable flag represents the binding relationship between the APP application and the uploaded type; The master end sends the uploaded data in the event queue to the corresponding APP application.

3. The method according to claim 2, characterized in that The master end obtains the type queue according to the sending request, including: When the master end detects an upload request represented by a chip trigger notification signal, the master end sends a notification of receiving the upload request to a management server, so that the management server obtains the type queue from the slave end according to the notification of the upload request. The management server is a background server built into the master end.

4. The method according to claim 3, characterized in that Before the master end obtains the corresponding APP application according to the pre-acquired variable flag and the type queue, it also includes: The master end establishes a communication connection with multiple APP applications through the management server; The master end receives subscription notifications sent by the multiple APP applications, where the subscription notifications include the variable flag.

5. The method according to claim 4, characterized in that The master end obtains the corresponding APP application according to the pre-acquired variable flag and the type queue, including: The master end parses the variable flag through the management server to obtain binding relationship information between multiple APP applications and multiple upload types; The master end matches the sent type in the type queue with the binding relationship information to obtain a matching result; If the matching result indicates that there is a successfully matched uploading type in the type queue, the master end obtains the corresponding APP application according to the successfully matched uploading type.

6. The method according to claim 5, characterized in that The master end sending the uploaded data in the event queue to the corresponding APP application includes: The master end obtains the upload data corresponding to the successfully matched upload type in the event queue; The master end sends the corresponding uploaded data to the corresponding APP application through Socket forwarding.

7. A method for data transmission between a master end and a slave end, characterized in that: The method comprises: When the slave end detects that there is an upload event in the pre-collected peripheral data, the slave end binds the upload data and the upload type in the upload event, and arranges the upload events in a preset order to generate an event queue; The slave end arranges the types of the multiple sent events according to the preset order to generate a type queue; The slave end sends an upload request to the master end, and sends the type queue to the master end according to feedback of the upload request; The slave end sends the event queue to the master end according to the type queue.

8. A master end, characterized in that: The master end comprises: An acquisition type queue unit is used to acquire a type queue according to an upload request, wherein the upload request is an active upload request initiated by the slave end to the master end, and the type queue is a queue of upload types arranged in a preset order; An event queue acquisition unit is used to acquire an event queue according to the type queue, wherein the event queue is a queue of uploaded events arranged according to the preset order, wherein the uploaded events include uploaded data and the uploaded type, wherein the uploaded data is the peripheral data collected by the slave end, and the uploaded data and the uploaded type correspond to each other.

9. A slave end, characterized in that: The slave end comprises: An event queue generating unit is used for binding the uploading data and the uploading type in the uploading event when the slave end detects that there is an uploading event in the pre-collected peripheral data, and arranging the uploading events in a preset order to generate an event queue; A type queue generating unit is used to arrange the types of a plurality of sent events according to the preset order to generate a type queue; A first sending unit, configured to send an uploading request to a master end, and send the type queue to the master end according to feedback of the uploading request; The second sending unit is used to send the event queue to the master end according to the type queue.

10. An electronic device, characterized in that: The electronic device comprises: Processor, memory, input-output unit, and bus; The processor is connected to the memory, the input and output unit, and the bus; The memory stores a program, and the processor calls the program to execute the method for data transmission between a master end and a slave end as claimed in any one of claims 1 to 7.