WO2022042140A1 - Data processing method and apparatus, electronic device, and storage medium - Google Patents

Data processing method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2022042140A1
WO2022042140A1 PCT/CN2021/107458 CN2021107458W WO2022042140A1 WO 2022042140 A1 WO2022042140 A1 WO 2022042140A1 CN 2021107458 W CN2021107458 W CN 2021107458W WO 2022042140 A1 WO2022042140 A1 WO 2022042140A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
message
field
information
identifier
Prior art date
Application number
PCT/CN2021/107458
Other languages
French (fr)
Chinese (zh)
Inventor
尹康凯
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2022042140A1 publication Critical patent/WO2022042140A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L5/00Arrangements affording multiple use of the transmission path
    • H04L5/003Arrangements for allocating sub-channels of the transmission path
    • H04L5/0053Allocation of signaling, i.e. of overhead other than pilot signals

Definitions

  • the present application relates to the field of communications, in particular to the field of data processing, and in particular to a data processing method, apparatus, electronic device and storage medium.
  • the embodiments of the present application provide a data processing method, an apparatus, an electronic device, and a storage medium.
  • An embodiment of the present application provides a data processing method, which is applied to a first electronic device.
  • the method includes: determining first information based on a first identifier and a second identifier; the first identifier representing a requested service; the first identifier The second identifier represents the execution action related to the service; the first information represents the data that needs to be sent to the second electronic device to complete the execution action;
  • the first information is transmitted to the second electronic device.
  • the embodiment of the present application also provides a data processing device, including:
  • a determining unit configured to determine first information based on the first identifier and the second identifier; the first identifier represents a requested service; the second identifier represents an execution action related to the service; the first information represents completion the data that needs to be sent to the second electronic device to perform the action;
  • the message interaction unit is configured to transmit the first information to the second electronic device during the process of message interaction with the second electronic device.
  • Embodiments of the present application also provide an electronic device, including: a processor and a memory configured to store a computer program that can be executed on the processor,
  • the processor is configured to execute the steps of the above data processing method when running the computer program.
  • the embodiments of the present application further provide a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above data processing method are implemented.
  • Embodiments of the present application further provide a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, implements the steps of any of the foregoing data processing methods.
  • FIG. 1 is an interaction diagram of a data processing method provided by an embodiment of the present application
  • FIG. 2 is a schematic flowchart of the implementation of the first electronic device transmitting the first information in the data processing method provided by the embodiment of the present application;
  • FIG. 3 is a schematic flowchart of an implementation of a first electronic device transmitting first information in a data processing method provided by another embodiment of the present application;
  • FIG. 4 is an interaction diagram of a data processing method provided by another embodiment of the present application.
  • FIG. 5 is an interaction diagram of a data processing method provided by another embodiment of the present application.
  • FIG. 6 is an interaction diagram of a data processing method provided by an application embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a data processing apparatus provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a data processing apparatus provided by another embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a data processing apparatus provided by another embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of a hardware composition of an electronic device provided by an embodiment of the present application.
  • the electronic device sends an upgrade request carrying version information to the server, the server determines the corresponding upgrade package based on the version information carried in the received upgrade request, and encapsulates the upgrade package into multiple data packages, and the server stores each data corresponding to the upgrade package.
  • the package is sent to the electronic device.
  • the electronic device sends a corresponding response message or confirmation message when receiving the first data packet sent by the server, and the response message or confirmation message is used to identify the received
  • the server sends the second data packet to the electronic device after receiving the response message sent by the electronic device; the server resends the first data packet when it does not receive the response message sent by the electronic device.
  • the server sends a corresponding notification message to the electronic device after sending all the data packets corresponding to the upgrade package to the electronic device, and the electronic device sends a response message corresponding to the notification message to the server when receiving the notification message.
  • an embodiment of the present application provides a data processing method, which determines the first information based on the first identifier and the second identifier; and transmits the first information to the second electronic device through message interaction with the second electronic device.
  • the data processing method can be applied to different transactions that require at least two data interactions to be completed.
  • the first identifier represents the requested service
  • the second identifier represents the execution action related to the service
  • the first information represents the data that needs to be sent to the second electronic device to complete the execution action.
  • the data processing method further includes:
  • the transmitting the first information to the second electronic device during the message interaction with the second electronic device includes:
  • the first message In the case of receiving the first message sent by the second electronic device, perform message interaction with the second electronic device, and transmit the first information to the second electronic device; the first message represents the The second electronic device receives the first identification and the second identification.
  • the data processing method further includes:
  • the transmitting the first information to the second electronic device during the message interaction with the second electronic device includes:
  • the messages that the first electronic device interacts with the second electronic device are packaged according to a set message format; wherein,
  • the set message format includes: a first field, a second field, a third field and a fourth field; the first field is used to write a first sequence number; the first sequence number is used to identify the data; the second field is used to write the second serial number; the second serial number is used to identify that the electronic device has received all valid messages whose serial number is less than or equal to the second serial number; the third field represents the valid messages that can be cached by the electronic device The number of messages; the valid message represents a message carrying data; the fourth field is used to carry data.
  • the transmitting the first information to the second electronic device during the message interaction with the receiving end includes:
  • each second message in the at least one second message corresponds to carrying all or part of the data in the first information
  • the at least one second message is sent to the second electronic device.
  • the sending the at least one second message to the second electronic device includes:
  • At least one second message in the at least one second message is continuously sent to the second electronic device based on the third field in the last message received by the first electronic device.
  • the third field in the message last received by the first electronic device indicates that the number of valid messages currently cacheable by the second electronic device is greater than or equal to the number of the at least one second message.
  • the continuously sending at least one second message in the at least one second message to the second electronic device includes:
  • All second messages in the at least one second message are continuously sent to the second electronic device.
  • the third field in the message last received by the first electronic device indicates that the number of valid messages currently cacheable by the second electronic device is less than the total number of messages of the at least one second message.
  • continuously sending the at least one second message to the second electronic device includes:
  • a first number of second messages in the at least one second message are continuously sent to the second electronic device; wherein the first number is less than or equal to the number of messages currently cacheable by the second electronic device.
  • the data processing method further includes:
  • the third sequence number is different from the fourth sequence number, based on the first sequence number and the second sequence number, retransmit at least one second message in the at least one second message to the second electronic device; in,
  • the third sequence number represents the sequence number represented by the second field in the last received message sent by the second electronic device; the fourth sequence number represents the sequence number represented by the second field in the last message sent by the first electronic device.
  • the sequence number represented by the first field is the sequence number represented by the first field.
  • the sequence number represented by the first field in the third message is the same as that of the first electronic device.
  • the sequence numbers represented by the first field in the last valid message sent are the same.
  • the first identifier is a service instance identifier SIID.
  • the second identifier is an instance identifier IID.
  • the service includes at least one of over-the-air technology OTA upgrade, security authentication, and negotiated key.
  • FIG. 1 shows an interaction diagram of a data processing method provided by an embodiment of the present application. 1, the data processing method in this embodiment includes:
  • the first electronic device determines first information based on the first identifier and the second identifier; the first identifier represents a requested service; the second identifier represents an execution action related to the service; the first information represents Data sent to the second electronic device required to complete the execution action.
  • the first identifier may correspond to a service instance identifier (SIID, Service Instance ID), or correspond to an application layer service identifier.
  • SIID Service Instance ID
  • the service instance is used to implement the corresponding service
  • the application layer service is used to provide the corresponding service
  • the service includes at least one of OTA upgrade, security authentication, and negotiated secret key.
  • the second identifier may be an instance identifier (IID, Instance ID), which is used to identify an instance corresponding to the application layer service, and the instance represents an execution action related to the service corresponding to the first identifier.
  • the instances may include at least one of the following: an OTA upgrade instance, a security authentication instance, and a negotiated key instance.
  • one first identifier corresponds to at least one second identifier.
  • Different second identifiers corresponding to the same first identifier represent different execution actions related to the service corresponding to the first identifier.
  • the first information may include information such as the identifier and version number of the object to be upgraded; the object to be upgraded includes An application program in the first electronic device, firmware in the first electronic device, and the like.
  • Firmware refers to the program written in Erasable Programmable Read-Only Memory (EPROM, Erasable Programmable ROM) or Electrically Erasable Programmable Read-Only Memory (EEPROM, Electrically Erasable Programmable Read-only Memory) of an electronic device.
  • EPROM Erasable Programmable Read-Only Memory
  • EEPROM Electrically Erasable Programmable Read-only Memory
  • the first information includes relevant data that the first electronic device needs to send to the second electronic device to perform security authentication.
  • the first electronic device transmits the first information to the second electronic device during the message interaction process with the second electronic device.
  • the first electronic device may encapsulate the first information into at least one message, and transmit the at least one message to the second electronic device.
  • the message is used to carry part or all of the data in the first information.
  • the first electronic device may continuously send all messages corresponding to the first information to the second electronic device.
  • the first electronic device may also send all the messages in the at least two messages to the second electronic device in batches.
  • the number of messages per batch is at least one.
  • the first electronic device continuously sends all the messages in each batch to the second electronic device.
  • the first electronic device continuously sends all the messages in the at least two messages in the first batch to the second electronic device, and after receiving the second electronic device.
  • the electronic device sends a confirmation message for the first batch of messages, it sends at least one message corresponding to the first information to the second electronic device.
  • the confirmation message represents that the second electronic device has received at least one message corresponding to the first information.
  • the first electronic device receives any message sent by the second electronic device.
  • the first electronic device determines the corresponding packet loss data from the first information based on the identifier of the received data represented by the message sent by the second electronic device , and re-send the determined packet loss data to the second electronic device.
  • the requested service is represented by the first identifier
  • the execution action related to the service is represented by the second identifier.
  • the first information determined by the first identifier and the second identifier, and the data processing method can be applied to different transactions that can be completed by at least two data interactions. After sending a message, the first electronic device can send the next message without waiting for a response message corresponding to the message, which can improve data interaction efficiency and data processing efficiency.
  • the messages that the first electronic device interacts with the second electronic device are packaged according to a set message format; wherein,
  • the set message format includes: a first field, a second field, a third field and a fourth field; the first field is used to write a first sequence number; the written first sequence number is a use sequence number, used for Identifies the data carried in the corresponding message, which is used to track whether the message has been delivered; the second field is used to write the second sequence number; the second sequence number is the confirmation sequence number, which is used to identify that the electronic device has received the sequence number less than or equal to All valid messages of the second serial number are used to notify the other party that all messages before the serial number represented by Ack have been received; the third field is a window field, used to represent the number of valid messages that can be cached by the electronic device, used to prompt The other party, before receiving any Ack message, how many messages the other party can send to us; the valid message represents a message carrying data; the fourth field is used to carry data.
  • the first field corresponds to Seq, which is used to identify a valid message, and the valid message represents a message carrying data in the fourth field;
  • the second field corresponds to Ack, and the third field corresponds to the window Win.
  • the first sequence numbers in the first fields of different valid messages are consecutive and increasing; the second sequence numbers written in the second fields cannot cover the first sequence numbers in the first fields of the valid messages that are not received.
  • the first electronic device continuously sends 5 pieces of valid information to the second electronic device, and the first fields of the 5 pieces of valid information are 1, 2, 3, 4, and 5 respectively.
  • the second electronic device When the first sequence number of the first field of the sent valid message corresponds to 1, 2, 3, and 5, since the second electronic device has not received the valid message with the first sequence number of the first field being 4, the second electronic device does not receive the valid message whose first sequence number is 4.
  • the electronic device responds to a valid message sent by the first electronic device, the second sequence number written in the second field of the corresponding message is 3, indicating that the second electronic device has received the first sequence number sent by the first electronic device. All valid messages less than or equal to 3.
  • Seq can be incremented from 0 according to the increment value of 1.
  • Seq increments to (2 32 -1) the Seq of the next valid message corresponds to 0.
  • Seq can be incremented from 1 according to the increment value of 1.
  • Seq is incremented to 2 32 the Seq of the next valid message corresponds to 1.
  • the second sequence number written in the second field is dynamically updated with the first sequence number corresponding to the first field in the valid message received by the electronic device.
  • the fourth field in any message received by the electronic device is empty, it indicates that the message is not a valid message, and the electronic device does not need to respond to the message, that is, it does not need to send a message for identifying the received message. A confirmation message to this message.
  • the electronic device after the electronic device receives the message, without the need to send a valid message to the electronic device that sent the message, the electronic device no longer sends a separate confirmation message for identifying that the message has been received;
  • the sequence number represented by the second field in the first valid message sent by the electronic device after receiving the message, and the last valid message sent before the message is received.
  • the third field indicates that the number of valid messages that can be cached by the electronic device is greater than or equal to 2, so that the electronic device sending valid messages can continuously send at least two valid messages to the electronic device, and the electronic device receiving valid messages It is possible to reply when at least two valid messages are received, and it is not necessary to reply for each valid message, which can improve the efficiency of message transmission.
  • the third field indicates that the number of valid messages that can be cached by the electronic device may be determined based on the corresponding cache space and the maximum number of bits occupied by a valid message.
  • the number of currently cacheable valid messages represented by the third field is dynamically updated along with the processing progress of valid messages. For example, when the first electronic device has processed at least one cached valid message, the first electronic device updates the number of valid messages currently cached by the first electronic device in real time.
  • LocalSeq corresponds to the first field of the first electronic device
  • LocalAck corresponds to the second field of the first electronic device
  • LocalWin corresponds to the third field of the first electronic device
  • RemoteSeq corresponds to The first field of the second electronic device
  • RemoteAck corresponds to the second field of the second electronic device
  • RemoteWin corresponds to the third field of the second electronic device.
  • LocalWin represents the number of valid messages currently cacheable by the first electronic device, and is used to identify the total number of valid messages that the second electronic device can continuously send to the first electronic device
  • RemoteWin represents the current cacheable messages of the second electronic device
  • LocalSeq corresponds to the first field of the second electronic device
  • LocalAck corresponds to the second field of the second electronic device
  • LocalWin corresponds to the third field of the second electronic device
  • RemoteSeq corresponds to the second field of the second electronic device
  • the first field of the first electronic device, RemoteAck corresponds to the second field of the first electronic device
  • RemoteWin corresponds to the third field of the first electronic device.
  • LocalWin represents the number of valid messages currently cacheable by the second electronic device, and is used to identify the total number of valid messages that the first electronic device can continuously send to the second electronic device;
  • RemoteWin represents the current cacheable messages of the first electronic device The number of valid messages is used to identify the total number of valid messages that the second electronic device can continuously send to the first electronic device.
  • the third field indicates that the number of valid messages that can be cached by the electronic device is greater than or equal to 2.
  • whether the message has been delivered is tracked through the usage sequence number written in the first field, so that the orderly delivery of the message can be ensured, and the confirmation sequence number written in the second field is used to notify the other party that the message represented by Ack has been delivered. All messages before the serial number have been received, which can ensure the reliable transmission of the message, and can ensure that the electronic device can finally receive all the messages.
  • the third field is used to prompt the other party. Before receiving any Ack message, the other party can send us a message. No matter how many messages are sent, the electronic device does not need to respond every time a message is received, and the electronic device can continuously send at least two messages, thereby improving the transmission efficiency of messages.
  • FIG. 2 shows a schematic flowchart of the implementation of the first electronic device transmitting the first information in the data processing method provided by the embodiment of the present application.
  • the first electronic device transmits the first information to the second electronic device, including:
  • S201 Generate at least one second message based on the first information; each second message in the at least one second message corresponds to carrying all or part of the data in the first information.
  • the first electronic device encapsulates the first information into at least one second message according to the set message format.
  • the first information is encapsulated into at least two second messages.
  • the data carried by all the second messages in the at least two second messages constitute all the data of the first message, and the number of bits occupied by the data carried in the fourth field of each second message is less than or equal to the number of bits occupied by the set message format.
  • the second message may be marked as ActionMessage.
  • the second messages are all valid messages.
  • the second sequence number written in the second field in each second message is determined based on the sequence number represented by the first field in the last valid message sent by the second electronic device received by the first electronic device.
  • the third field in each second message is used to identify the number of valid messages currently cacheable by the first electronic device, so that the second electronic device can determine the total number of valid messages that can be continuously sent to the first electronic device.
  • S202 Send the at least one second message to the second electronic device.
  • the first information is encapsulated into at least one second message according to the set message format.
  • the first electronic device can continuously send at least two second messages carrying data of the first information to the second electronic device, that is, after sending one second message , it is not necessary to send the next second message after receiving the response message corresponding to the second message, thereby improving the interaction efficiency and the message transmission efficiency.
  • the first electronic device can carry the data of the first information in the message sent to the second electronic device, and can also represent the sequence number corresponding to the received valid message, which can improve data processing. effectiveness.
  • the sending the at least one second message to the second electronic device includes: based on a third field in a message last received by the first electronic device, sending the at least one second message to the second electronic device. At least one of the second messages is continuously sent to the second electronic device.
  • the first electronic device determines the number of valid messages currently cacheable by the second electronic device based on the third field in the last received message, and based on the number of valid messages currently cached by the second electronic device, at least At least one second message in the one second message is continuously sent to the second electronic device, so that all the second messages corresponding to the first information are transmitted to the second electronic device.
  • the third field in the message last received by the first electronic device represents the number of valid messages currently cacheable by the second electronic device
  • the number of valid messages that can be cached initially by the second electronic device is When the number is greater than or equal to 2, the first electronic device can continuously send at least two second messages carrying data of the first information to the second electronic device, which can improve the efficiency of the second messages.
  • the third field in the message last received by the first electronic device indicates that the number of valid messages currently cacheable by the second electronic device is greater than or equal to the number of the at least one second message.
  • the continuously sending at least one second message in the at least one second message to the second electronic device includes: sending all the second messages in the at least one second message continuously to the second electronic device.
  • the first electronic device determines the number of valid messages currently cacheable by the second electronic device based on the third field in the last received message, when the number of valid messages currently cached by the second electronic device is When the total amount of the at least one second message generated based on the first information is greater than or equal to the total amount of messages, all the second messages in the at least one second message are continuously sent to the second electronic device.
  • the first electronic device stores the 10 second messages as second messages. The message is continuously sent to the second electronic device.
  • the first electronic device when the number of messages currently cacheable by the second electronic device is less than the total number of messages of at least one second message generated based on the first information, the first electronic device stores the at least one second message corresponding to the first information.
  • the first number of second messages in are continuously sent to the second electronic device.
  • the first number is less than or equal to the number of messages currently cacheable by the second electronic device.
  • the first number may be greater than or equal to two.
  • the second electronic device When the second electronic device receives at least one second message and has processed the at least one second message, the second electronic device updates the number of valid messages currently cacheable by the second electronic device.
  • the first electronic device determines whether the second electronic device has received the first number of messages based on the second sequence number represented by the second field in the third message. All of the second messages in the second message.
  • the third message is used to identify that the second electronic device has received at least one second message sent by the first electronic device.
  • the second sequence number represented by the second field in the third message is equal to the first sequence number with the largest value corresponding to the first field in the first message of the first quantity, it means that the second electronic device has received the first quantity All second messages in the second message.
  • the first electronic device continuously sends the second number of second messages to the second electronic device based on the third field in the third message representing the number of valid messages currently cacheable by the second electronic device.
  • the second number of second messages are all unsent second messages in the second messages corresponding to the first information.
  • the second sequence number represented by the second field in the third message is smaller than the first sequence number with the largest value corresponding to the first field of the first message of the first quantity, it means that the second electronic device has received the second message of the first quantity Part of the second message in .
  • the first electronic device represents the number of valid messages currently cacheable by the second electronic device, and based on the second field in the third message, continuously forwards the third number of second messages to the second electronic device.
  • the third number of second messages includes unsent second messages among the second messages corresponding to the first information and second messages that are not received by the second electronic device among the first number of second messages.
  • the second message that is not received by the second electronic device represents a second message in which the first sequence number of the first field is greater than the second sequence number corresponding to the second field in the third message.
  • the third field in the message last received by the first electronic device indicates that the number of valid messages currently cacheable by the second electronic device is greater than or equal to the at least one second message In the case of the total number of messages, it means that the second electronic device can cache all the second messages corresponding to the first information. Therefore, the first electronic device continuously sends all the second messages corresponding to the first information to the second electronic device. The transmission efficiency of the second message is improved.
  • FIG. 3 shows a schematic flowchart of an implementation of the first electronic device transmitting the first information in the data processing method provided by another embodiment of the present application.
  • the method further includes:
  • S203 In the case that the third sequence number is different from the fourth sequence number, based on the first sequence number and the second sequence number, resend at least one second message in the at least one second message to the second electronic device message; wherein, the third sequence number represents the sequence number represented by the second field in the message sent by the second electronic device last received; the fourth sequence number represents the last sequence number sent by the first electronic device. The sequence number represented by the first field in the second message.
  • the third sequence number and the fourth sequence number are different, it means that the second electronic device has not successfully received all the second messages that have been sent by the first electronic device.
  • the first electronic device determines the second message corresponding to the fourth sequence number greater than the third sequence number, obtains the second message that is not received by the second electronic device, and replays the second message to the second electronic device. Send the determined second message.
  • the third sequence number when the third sequence number is different from the fourth sequence number, it means that the second electronic device has not received all the second messages sent by the first electronic device, and the first electronic device is based on the third sequence number and the fourth sequence number.
  • the fourth sequence number can be used to determine the second message that has not been received by the second electronic device from the second message sent by the first electronic device, so that the determined second message can be resent to the second electronic device to ensure that the second message is not received by the second electronic device.
  • the second electronic device can finally receive all the second messages corresponding to the first information to ensure the reliability of message transmission.
  • the first electronic device corresponds to a service requester
  • FIG. 4 shows an interaction diagram of a data processing method provided by another embodiment of the present application. 4, the data processing method in this embodiment includes:
  • S401 The first electronic device sends the first identification and the second identification to the second electronic device.
  • the first electronic device may determine the service requested by the user based on the detected user operation, thereby determining the corresponding first identification and the second identification, and send the first identification and the second identification to the second electronic device.
  • the first electronic device may determine all execution actions related to the service based on the setting implementation process corresponding to the service requested by the user, and based on the set execution sequence corresponding to the execution actions related to the service , to determine the current execution action, so as to obtain the corresponding second identifier.
  • the first electronic device may send a start message, for example, ActionStart, to the second electronic device.
  • the number of valid messages, and the fourth field is used to carry the first identifier and the second identifier.
  • the first electronic device determines first information based on the first identifier and the second identifier; the first identifier represents a requested service; the second identifier represents an execution action related to the service; the first information represents Data sent to the second electronic device required to complete the execution action.
  • the first electronic device determines the first information based on the first identifier and the second identifier in the foregoing embodiment, and details are not described here.
  • the first electronic device may execute S401 first and then execute S402, or may execute S402 first and then execute S401, or may execute S401 and S402 at the same time.
  • the second electronic device sends a first message to the first electronic device; the first message indicates that the second electronic device receives the first identifier and the second identifier.
  • the second electronic device In the case of receiving the first identification and the second identification sent by the first electronic device, the second electronic device sends a first message to the first electronic device to notify the first electronic device that the second electronic device has received the first identification and secondary identification.
  • the second electronic device saves the data in the third field in the ActionStart and sends an ActionMessage to the first electronic device when it receives the ActionStart carrying the first and second identifiers.
  • the ActionMessage is used to respond to ActionStart, indicating that ActionStart has been received.
  • the first sequence number written in the first field in ActionStart is 1
  • the second sequence number written in the second field in the ActionMessage is 1.
  • the data (at least one of numbers and letters) written in the third field in the ActionMessage represents the number of valid messages currently cacheable by the second electronic device.
  • the fourth field in the ActionMessage can be empty.
  • the ActionMessage is used as a confirmation message only to respond to the ActionStart sent by the first electronic device, so as to notify the first electronic device that the current second electronic device has The first identification and the second identification are received.
  • the first sequence number written in the first field in the ActionMessage is 0, indicating that the fourth field in the ActionMessage is empty.
  • the fourth field in the ActionMessage can also carry part or all of the data in the second information.
  • the second information is determined by the second electronic device based on the first identification and the second identification.
  • the second information indicates that the execution corresponding to the second identification is completed.
  • the first sequence number written in the first field in the ActionMessage is 1, which indicates that the fourth field in the ActionMessage carries data.
  • S404 In the case of receiving the first message sent by the second electronic device, the first electronic device performs message interaction with the second electronic device, and transmits the first information to the second electronic device.
  • the first electronic device when receiving the first message sent by the second electronic device, transmits the first information determined in S402 to the second electronic device.
  • the first electronic device transmits the first information determined in S402 to the second electronic device.
  • the first electronic device when the first electronic device receives the ActionMessage sent by the second electronic device based on ActionStart, it saves the data in the third field in the ActionMessage, so that the first electronic device transmits the first information to the third field based on the data in the third field in the ActionMessage.
  • Two electronic equipment when the first electronic device receives the ActionMessage sent by the second electronic device based on ActionStart, it saves the data in the third field in the ActionMessage, so that the first electronic device transmits the first information to the third field based on the data in the third field in the ActionMessage.
  • the data corresponding to the first information is carried in the fourth field in at least one ActionMessage.
  • the first electronic device sends the first identification and the second identification to the second electronic device, and does not receive the first message sent by the second electronic device within a set period of time, it represents the second electronic device.
  • the first identification and the second identification are not received, and here, S401 is performed again to resend the first identification and the second identification to the second electronic device.
  • the first electronic device may send an end request to the second electronic device to release related resources when the execution action related to the service corresponding to the first identifier is completed, and the end request may correspond to TransactionEndReq.
  • the second electronic device sends a message for identifying the end of the confirmation to the first electronic device based on the received parsing results of all ActionMessages, for example, GenericEndResp, the second electronic device Mark the corresponding execution action as completed.
  • the parsing result indicates that all ActionMessages are parsed normally
  • the GenericEndResp indicates that the execution is normal
  • the second electronic device may, based on the sequence numbers represented by the first fields in all received ActionMessages, convert the values carried in the fourth fields of all ActionMessages. data, splicing to obtain the first information; when the parsing result indicates that any ActionMessage parsing is abnormal, GenericEndResp indicates that the execution is abnormal.
  • the first electronic device may report the processing result to the application layer based on the GenericEndResp.
  • the GenericEndResp representation is abnormally executed, a notification message for identifying the processing failure is reported to the application layer; when the GenericEndResp representation is executed normally, a notification message for identifying the processing success is reported to the application layer.
  • the notification message carries the first identifier and the second identifier.
  • the second electronic device after the first electronic device sends the first identification and the second identification to the second electronic device, after receiving a message sent by the second electronic device to indicate that the first identification and the second identification have been received
  • the second electronic device interacts with the second electronic device, and transmits the first information determined based on the first identification and the second identification to the second electronic device, thereby ensuring that the second device can receive the first identification and the second electronic device.
  • the second identification so as to complete the execution action related to the service requested by the first electronic device based on the first information, so that the first electronic device can obtain the corresponding service.
  • the first electronic device corresponds to a service provider
  • FIG. 5 shows an interaction diagram of a data processing method provided by another embodiment of the present application. 5, the data processing method in this embodiment includes:
  • S501 The second electronic device sends the first identification and the second identification to the first electronic device.
  • the second electronic device may send a startup message to the first electronic device.
  • the number of valid messages, the fourth field carries the first identifier and the second identifier.
  • the first electronic device receives the first identifier and the second identifier sent by the second electronic device.
  • the first electronic device receives the first identification and the second identification sent by the second electronic device, based on the set first identification and the set second identification, the first identification and the second identification sent by the second electronic device The second identification is verified to obtain a verification result.
  • the first electronic device finds from the set first identification that it is the same as or matches with the first identification sent by the second electronic device, it indicates that the first identification sent by the second electronic device is valid;
  • the set first identifier is found to be different from or does not match the first identifier sent by the second electronic device, it indicates that the first identifier sent by the second electronic device is invalid.
  • the first electronic device finds the same or matches with the second identification sent by the second electronic device from the set second identification, it indicates that the second identification sent by the second electronic device is valid; When it is found that it is different from or does not match the second identifier sent by the second electronic device, it indicates that the second identifier sent by the second electronic device is invalid.
  • the first information is transmitted to the second electronic device by performing message interaction with the second electronic device.
  • the first electronic device can determine the number of valid messages currently cacheable by the second electronic device based on the third field in the startup message sent by the second electronic device, so as to be based on the number of valid messages currently cacheable by the second electronic device , and transmit the first information to the second electronic device.
  • the data processing flow ends.
  • the first electronic device determines the first information based on the first identifier and the second identifier only when it confirms that the received first identifier and the second identifier are valid.
  • the first information is transmitted to the second electronic device, and when the received first identification or the second identification is invalid, the data processing flow is ended, thereby ensuring that the second electronic device is sent to the second electronic device.
  • the returned first information is the data corresponding to the service requested by the first electronic device, so as to ensure the correctness of the data, so as to provide the corresponding service for the first electronic device.
  • FIG. 6 shows an interaction diagram of a data processing method provided by the application embodiment of the present application.
  • the data processing method includes:
  • the terminal sends the first identifier and the second identifier to the server.
  • the first identifier represents a requested service; the second identifier represents an execution action related to the service.
  • the first identifier may correspond to an OTA service instance identifier, and the first identifier represents that the requested service corresponds to an OTA upgrade service.
  • the second identifier represents an execution action related to the OTA service, for example, an OTA upgrade.
  • the terminal sends ActionStart to the server.
  • the server sends a first message to the terminal under the condition of confirming that both the first identifier and the second identifier are valid; the first message indicates that the server has received the first identifier and the second identifier logo.
  • the terminal determines first information based on the first identifier and the second identifier; the first information represents data that needs to be sent to the server to complete the execution action.
  • the first information may include information such as the identifier and version number of the object to be upgraded; the object to be upgraded includes the application program in the terminal, the firmware in the terminal, and the like.
  • S601 and S603 may be executed simultaneously.
  • S604 In the case of receiving the first message sent by the server, the terminal performs message interaction with the server, and transmits the first information to the server.
  • the terminal encapsulates the first information into at least one ActionMessage; the data carried by all ActionMessages in the at least one ActionMessage constitutes all data of the first information.
  • the fourth field in ActionMessage is used to carry the data of the first information.
  • the first information can be encapsulated into an ActionMessage.
  • the server determines second information based on the first identifier, the second identifier, and the first information; the second information represents data that needs to be sent to the terminal to complete the execution action.
  • the second information includes the corresponding upgrade package.
  • S606 The server performs message interaction with the terminal, and transmits the second information to the terminal.
  • the server since the upgrade package occupies a large number of bits, the server generates at least two ActionMessages based on the second information, and the data carried in the fourth field in all ActionMessages in the at least two ActionMessages constitute all data of the second information.
  • the first number of ActionMessages in the at least two ActionMessages are continuously sent to the terminal.
  • the first number is less than or equal to the number of valid messages currently buffered by the terminal.
  • S607 The terminal sends a third message to the server when at least part of the data of the second information is received.
  • the terminal In the case of receiving the ActionMessage corresponding to the second information sent by the server, the terminal sends a third message to the server.
  • the sequence number written in the second field in the third message indicates that the terminal has received all ActionMessages whose sequence number represented by the first field in the ActionMessage sent by the server is less than or equal to the sequence number represented by the second field in the third message.
  • the terminal may determine whether to receive the sequence number represented by the first field of each ActionMessage in the at least two ActionMessages sent by the server. Whether the sequence numbers represented by the first field of the ActionMessage are continuous, and when the determination result indicates that the sequence numbers represented by the first field of the ActionMessage received are discontinuous, a third message is sent to the server. The terminal may also send the third message to the server when the determination result indicates that the sequence numbers represented by the first field of the ActionMessage are consecutive, and the maximum sequence number represented by the first field of the ActionMessage is equal to the number of valid messages that the terminal can currently cache.
  • sequence numbers represented by the first field of at least two ActionMessages sent by the server correspond to: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, and the terminal receives
  • the server sends 14 ActionMessages in S607, there is still an unsent ActionMessage corresponding to the second message.
  • the sequence number represented by the first field of the third message is the same as the sequence number represented by the first field in the last valid message (eg, ActionStart) sent by the terminal to the server.
  • the fourth field in the third message is empty, and the sequence number represented by the second field in the third message is the same as the maximum sequence number corresponding to the first field in the ActionMessage generated based on the second information, it indicates that the terminal has received the For all messages carrying the data of the upgrade package, at this time, the server does not need to respond to the third message, that is, the server does not need to send a separate message for the third message to identify that the third message has been received.
  • S608 The terminal sends an end request message to the server.
  • the terminal sends an end request message, for example, TransactionEndReq, to the server in the case of receiving all the ActionMessages used to carry the data of the upgrade package.
  • the sequence number represented by the first field in the end request message is the same as the sequence number represented by the first field in the last valid message sent by the terminal to the server.
  • the sequence number represented by the second field in the end message is the same as the sequence number represented by the first field in the ActionMessage for carrying the data of the second information sent by the server last time.
  • the server When the server receives the end request message sent by the terminal, and the received third message sent by the terminal indicates that the terminal has received all the messages used to carry the data of the upgrade package, the server sends a confirmation end message to the server, and sends the second message to the server.
  • the execution action of the identity token is marked as completed.
  • the terminal parses all the ActionMessages corresponding to the second information to obtain the analysis results.
  • the parsing result includes the sequence number represented by the first field corresponding to each ActionMessage and the data carried by the corresponding fourth field.
  • the terminal can successfully parse out the data carried by all ActionMessages, it reports a message to the application layer to identify the normal execution; based on the sequence number of the first field corresponding to each ActionMessage in the parsing result, the terminal parses the data carried by the corresponding fourth field Perform sorting to obtain sorted data, and report the sorted data to the application layer.
  • the sorted data forms corresponding second information (ie, an upgrade package), which is used for the OTA upgrade service corresponding to the first identifier to use the upgrade package to perform OTA upgrade on the corresponding application or firmware.
  • the server can continuously send at least two ActionMessages to the terminal, and the terminal does not need to respond to each ActionMessage, thereby improving the transmission efficiency of the OTA upgrade package and the speed of the OTA upgrade.
  • the embodiment of the present application further provides a data processing apparatus, which is arranged on an electronic device.
  • the data processing device includes:
  • the determining unit 71 is configured to determine first information based on the first identifier and the second identifier; the first identifier represents a requested service; the second identifier represents an execution action related to the service; the first information represents data that needs to be sent to the second electronic device to complete the execution action;
  • the message interaction unit 72 is configured to transmit the first information to the second electronic device during the process of message interaction with the second electronic device.
  • the first identifier is a service instance identifier SIID.
  • the second identifier is an instance identifier IID.
  • the service includes at least one of over-the-air technology OTA upgrade, security authentication, and negotiated key.
  • the data processing apparatus further includes:
  • a sending unit 73 configured to send the first identification and the second identification to the second electronic device
  • the message interaction unit 72 is specifically configured to: in the case of receiving the first message sent by the second electronic device, perform message interaction with the second electronic device, and transmit the first information to the second electronic device;
  • the first message represents that the second electronic device has received the first identification and the second identification.
  • the data processing apparatus further includes:
  • a receiving unit 74 configured to receive the first identification and the second identification sent by the second electronic device
  • the message interaction unit 72 is specifically configured to: in the case of confirming that both the first identification and the second identification are valid, perform message interaction with the second electronic device, and transmit the first information to the second electronic device .
  • the message that the first electronic device interacts with the second electronic device is encapsulated in a set message format; wherein the set message format includes: a first field, a second field, The third field and the fourth field; the first field is used to write the first sequence number; the first sequence number is used to identify the data carried in the corresponding message; the second field is used to write the second sequence number; the second The sequence number is used to identify that the electronic device has received all valid messages whose sequence numbers are less than or equal to the second sequence number; the third field represents the number of valid messages that can be cached by the electronic device; the valid messages represent messages that carry data; the The fourth field is used to carry data.
  • the set message format includes: a first field, a second field, The third field and the fourth field; the first field is used to write the first sequence number; the first sequence number is used to identify the data carried in the corresponding message; the second field is used to write the second sequence number; the second The sequence number is used to identify that the electronic device has received all valid messages whose sequence numbers are
  • the message interaction unit 72 is specifically configured as:
  • each second message in the at least one second message corresponds to carrying all or part of the data in the first information
  • the at least one second message is sent to the second electronic device.
  • the message interaction unit 72 is specifically configured to: based on the third field in the message last received by the first electronic device, continuously send at least one second message in the at least one second message to the The second electronic device sends.
  • the third field in the message last received by the first electronic device indicates that the number of valid messages currently cacheable by the second electronic device is greater than or equal to the number of the at least one second message.
  • the message interaction unit 72 is specifically configured to: continuously send all the second messages in the at least one second message to the second electronic device.
  • the third field in the message last received by the first electronic device indicates that the number of valid messages currently cacheable by the second electronic device is less than the total number of messages of the at least one second message.
  • the message interaction unit 72 is specifically configured as:
  • a first number of second messages in the at least one second message are continuously sent to the second electronic device; wherein the first number is less than or equal to the number of messages currently cacheable by the second electronic device.
  • the message interaction unit 72 is further configured to:
  • the third sequence number is different from the fourth sequence number, based on the first sequence number and the second sequence number, retransmit at least one second message in the at least one second message to the second electronic device; in,
  • the third sequence number represents the sequence number represented by the second field in the last received message sent by the second electronic device; the fourth sequence number represents the sequence number represented by the second field in the last message sent by the first electronic device.
  • the sequence number represented by the first field is the sequence number represented by the first field.
  • the sequence number represented by the first field in the third message is the same as that of the first electronic device.
  • the sequence numbers represented by the first field in the last valid message sent are the same.
  • each unit included in the data processing apparatus can be implemented by a processor in the data processing apparatus.
  • the processor needs to run the programs stored in the memory to realize the functions of the above program modules.
  • FIG. 10 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application. As shown in FIG. 10 , the electronic device includes:
  • Communication interface 1 which can exchange information with other devices such as network devices;
  • the processor 2 is connected to the communication interface 1 to realize information interaction with other devices, and is used to execute the data processing method provided by one or more of the above technical solutions when running the computer program.
  • the computer program is instead stored on the memory 3 .
  • bus system 4 is used to realize the connection communication between these components.
  • the bus system 4 also includes a power bus, a control bus and a status signal bus.
  • the various buses are designated as bus system 4 in FIG. 10 .
  • the memory 3 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program used to operate on an electronic device.
  • the memory 3 may be a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memory.
  • the non-volatile memory can be a read-only memory (ROM, Read Only Memory), a programmable read-only memory (PROM, Programmable Read-Only Memory), an erasable programmable read-only memory (EPROM, Erasable Programmable Read-only memory) Only Memory), Electrically Erasable Programmable Read-Only Memory (EEPROM, Electrically Erasable Programmable Read-Only Memory), Magnetic Random Access Memory (FRAM, ferromagnetic random access memory), Flash Memory (Flash Memory), Magnetic Surface Memory , CD-ROM, or CD-ROM (Compact Disc Read-Only Memory); magnetic surface memory can be disk memory or tape memory.
  • RAM Random Access Memory
  • SRAM Static Random Access Memory
  • SSRAM Synchronous Static Random Access Memory
  • DRAM Dynamic Random Access Memory
  • SDRAM Synchronous Dynamic Random Access Memory
  • DDRSDRAM Double Data Rate Synchronous Dynamic Random Access Memory
  • ESDRAM Enhanced Type Synchronous Dynamic Random Access Memory
  • SLDRAM Synchronous Link Dynamic Random Access Memory
  • DDRRAM Direct Memory Bus Random Access Memory
  • DRRAM Direct Rambus Random Access Memory
  • the methods disclosed in the above embodiments of the present application may be applied to the processor 2 or implemented by the processor 2 .
  • the processor 2 may be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above-mentioned method can be completed by a hardware integrated logic circuit in the processor 2 or an instruction in the form of software.
  • the above-mentioned processor 2 may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like.
  • the processor 2 may implement or execute the methods, steps, and logical block diagrams disclosed in the embodiments of this application.
  • a general purpose processor may be a microprocessor or any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software module may be located in a storage medium, the storage medium is located in the memory 3, and the processor 2 reads the program in the memory 3, and completes the steps of the foregoing method in combination with its hardware.
  • the embodiment of the present application further provides a storage medium, that is, a computer storage medium, specifically a computer-readable storage medium, for example, including a memory 3 storing a computer program, and the above-mentioned computer program can be executed by the processor 2, to complete the steps described in the preceding method.
  • the computer-readable storage medium may be memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disk, or CD-ROM.
  • the disclosed apparatus, terminal and method may be implemented in other manners.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined, or Can be integrated into another system, or some features can be ignored, or not implemented.
  • the coupling, or direct coupling, or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be electrical, mechanical or other forms. of.
  • the unit described above as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it may be located in one place or distributed to multiple network units; Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may all be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above integration
  • the unit can be implemented either in the form of hardware or in the form of hardware plus software functional units.
  • the aforementioned program can be stored in a computer-readable storage medium, and when the program is executed, execute It includes the steps of the above method embodiments; and the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic disk or an optical disk and other media that can store program codes.
  • the above-mentioned integrated units of the present application are implemented in the form of software function modules and sold or used as independent products, they may also be stored in a computer-readable storage medium.
  • the computer software products are stored in a storage medium and include several instructions for A computer device (which may be a personal computer, a server, or a network device, etc.) is caused to execute all or part of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic disk or an optical disk and other mediums that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Information Transfer Between Computers (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

Disclosed in embodiments of the present application are a data processing method and apparatus, an electronic device, and a storage medium. The data processing method comprises: determining first information on the basis of a first identifier and a second identifier, the first identifier representing a requested service, the second identifier representing a service-related execution action, and the first information representing data that needs to be sent to a second electronic device for the completion of the execution action; and during message interaction with the second electronic device, transmitting the first information to the second electronic device.

Description

数据处理方法、装置、电子设备及存储介质Data processing method, device, electronic device and storage medium
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请基于申请号为202010899538.6,申请日为2020年08月31日的中国专利申请提出,并要求上述中国专利申请的优先权,上述中国专利申请的全部内容在此引入本申请作为参考。This application is based on the Chinese patent application with the application number of 202010899538.6 and the filing date of August 31, 2020, and claims the priority of the above-mentioned Chinese patent application. The entire content of the above-mentioned Chinese patent application is incorporated herein by reference.
技术领域technical field
本申请涉及通信领域,特别是涉及数据处理领域,具体涉及一种数据处理方法、装置、电子设备及存储介质。The present application relates to the field of communications, in particular to the field of data processing, and in particular to a data processing method, apparatus, electronic device and storage medium.
背景技术Background technique
相关技术中,针对需要经过至少两次数据交互才能完成的事务,例如,安全认证、空中下载技术(OTA,Over the Air Technology)升级等,没有通用的处理流程适用于不同的事务。In the related art, for transactions that require at least two data interactions to be completed, for example, security authentication, Over the Air Technology (OTA, Over the Air Technology) upgrade, etc., there is no general processing flow applicable to different transactions.
发明内容SUMMARY OF THE INVENTION
为解决相关技术问题,本申请实施例提供了一种数据处理方法、装置、电子设备及存储介质。In order to solve the related technical problems, the embodiments of the present application provide a data processing method, an apparatus, an electronic device, and a storage medium.
本申请实施例提供一种数据处理方法,应用于第一电子设备,所述方法包括:基于第一标识和第二标识确定出第一信息;所述第一标识表征请求的服务;所述第二标识表征所述服务相关的执行动作;所述第一信息表征完成所述执行动作所需要向第二电子设备发送的数据;An embodiment of the present application provides a data processing method, which is applied to a first electronic device. The method includes: determining first information based on a first identifier and a second identifier; the first identifier representing a requested service; the first identifier The second identifier represents the execution action related to the service; the first information represents the data that needs to be sent to the second electronic device to complete the execution action;
在与第二电子设备进行消息交互的过程中,将所述第一信息传输至所述第二电子设备。During the message interaction process with the second electronic device, the first information is transmitted to the second electronic device.
本申请实施例还提供了一种数据处理装置,包括:The embodiment of the present application also provides a data processing device, including:
确定单元,配置为基于第一标识和第二标识确定出第一信息;所述第一标识表征请求的服务;所述第二标识表征所述服务相关的执行动作;所述第一信息表征完成所述执行动作所需要向第二电子设备发送的数据;a determining unit, configured to determine first information based on the first identifier and the second identifier; the first identifier represents a requested service; the second identifier represents an execution action related to the service; the first information represents completion the data that needs to be sent to the second electronic device to perform the action;
消息交互单元,用于在与第二电子设备进行消息交互的过程中,将所述第一信息传输至所述第二电子设备。The message interaction unit is configured to transmit the first information to the second electronic device during the process of message interaction with the second electronic device.
本申请实施例还提供了一种电子设备,包括:处理器和配置为存储能够在处理器上运行的计算机程序的存储器,Embodiments of the present application also provide an electronic device, including: a processor and a memory configured to store a computer program that can be executed on the processor,
其中,所述处理器配置为运行所述计算机程序时,执行上述数据处理方法的步骤。Wherein, the processor is configured to execute the steps of the above data processing method when running the computer program.
本申请实施例还提供了一种存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述数据处理方法的步骤。The embodiments of the present application further provide a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above data processing method are implemented.
本申请实施例还提供了一种存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述任一数据处理方法的步骤。Embodiments of the present application further provide a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, implements the steps of any of the foregoing data processing methods.
附图说明Description of drawings
图1为本申请实施例提供的一种数据处理方法的交互图;FIG. 1 is an interaction diagram of a data processing method provided by an embodiment of the present application;
图2为本申请实施例提供的数据处理方法中第一电子设备传输第一信息的实现流程示意图;FIG. 2 is a schematic flowchart of the implementation of the first electronic device transmitting the first information in the data processing method provided by the embodiment of the present application;
图3为本申请另一实施例提供的数据处理方法中第一电子设备传输第一信息的实现流程示意图;FIG. 3 is a schematic flowchart of an implementation of a first electronic device transmitting first information in a data processing method provided by another embodiment of the present application;
图4为本申请另一实施例提供的一种数据处理方法的交互图;FIG. 4 is an interaction diagram of a data processing method provided by another embodiment of the present application;
图5为本申请另一实施例提供的一种数据处理方法的交互图;FIG. 5 is an interaction diagram of a data processing method provided by another embodiment of the present application;
图6为本申请应用实施例提供的一种数据处理方法的交互图;FIG. 6 is an interaction diagram of a data processing method provided by an application embodiment of the present application;
图7为本申请实施例提供的数据处理装置的结构示意图;7 is a schematic structural diagram of a data processing apparatus provided by an embodiment of the present application;
图8为本申请另一实施例提供的数据处理装置的结构示意图;FIG. 8 is a schematic structural diagram of a data processing apparatus provided by another embodiment of the present application;
图9为本申请另一实施例提供的数据处理装置的结构示意图;FIG. 9 is a schematic structural diagram of a data processing apparatus provided by another embodiment of the present application;
图10为本申请实施例提供的电子设备的硬件组成结构示意图。FIG. 10 is a schematic structural diagram of a hardware composition of an electronic device provided by an embodiment of the present application.
具体实施方式detailed description
相关技术中,需要经过至少两次数据交互才能完成的不同事务,例如,安全认证、协商秘钥、OTA升级等,通常对应不同的处理流程,没有通用的处理流程适用于需要经过至少两次数据交互才能完成的不同的事务。其中,OTA升级方法如下:In related technologies, different transactions that require at least two data interactions, such as security authentication, negotiated secret keys, OTA upgrades, etc., usually correspond to different processing procedures. Different transactions that can only be done interactively. Among them, the OTA upgrade method is as follows:
电子设备向服务器发送携带版本信息的升级请求,服务器基于接收到的升级请求携带的版本信息,确定出对应的升级包,将升级包封装成多个数据包,服务器将升级包对应的每个数据包发送至电子设备。在服务器向电子设备发送升级包对应的数据包的过程中,电子设备在接收到服务器发送的第一数据包时发送对应的应答消息或确认消息,该应答消息或确认消息用于标识已收到对应的数据包,服务器在接收到电子设备发送的应答消息的情况下,再向电子设备发送第二数据包;服务器在未接收到电子设备发送的应答消息的情况下,重发第一数据包。服务器在向电子设备发送完升级包对应的所有数据包的情况下,向电子设备发送对应的通知消息,电子设备在接收到该通知消息时,向服务器发送该通知消息对应的应答消息。The electronic device sends an upgrade request carrying version information to the server, the server determines the corresponding upgrade package based on the version information carried in the received upgrade request, and encapsulates the upgrade package into multiple data packages, and the server stores each data corresponding to the upgrade package. The package is sent to the electronic device. In the process that the server sends the data packet corresponding to the upgrade package to the electronic device, the electronic device sends a corresponding response message or confirmation message when receiving the first data packet sent by the server, and the response message or confirmation message is used to identify the received For the corresponding data packet, the server sends the second data packet to the electronic device after receiving the response message sent by the electronic device; the server resends the first data packet when it does not receive the response message sent by the electronic device. . The server sends a corresponding notification message to the electronic device after sending all the data packets corresponding to the upgrade package to the electronic device, and the electronic device sends a response message corresponding to the notification message to the server when receiving the notification message.
为了解决上述技术问题,本申请实施例提供了一种数据处理方法,基于第一标识和第二标识确定出第一信息;通过与第二电子设备进行消息交互,将第一信息传输至第二电子设备。该数据处理方法可以适用于需要经过至少两次数据交互才能完成的不同的事务。其中,第一标识表征请求的服务;第二标识表征所述服务相关的执行动作;第一信息表征完成所述执行动作所需要向第二电子设备发送的数据。In order to solve the above technical problems, an embodiment of the present application provides a data processing method, which determines the first information based on the first identifier and the second identifier; and transmits the first information to the second electronic device through message interaction with the second electronic device. Electronic equipment. The data processing method can be applied to different transactions that require at least two data interactions to be completed. Wherein, the first identifier represents the requested service; the second identifier represents the execution action related to the service; the first information represents the data that needs to be sent to the second electronic device to complete the execution action.
在一实施例中,所述数据处理方法还包括:In one embodiment, the data processing method further includes:
向所述第二电子设备发送所述第一标识和所述第二标识;sending the first identification and the second identification to the second electronic device;
所述在与第二电子设备进行消息交互的过程中,将所述第一信息传输至所述第二电子设备,包括:The transmitting the first information to the second electronic device during the message interaction with the second electronic device includes:
在接收到所述第二电子设备发送的第一消息的情况下,与第二电子设备进行消息交互,将所述第一信息传输至所述第二电子设备;所述第一消息表征所述第二电子设备接收到所述第一标识和所述第二标识。In the case of receiving the first message sent by the second electronic device, perform message interaction with the second electronic device, and transmit the first information to the second electronic device; the first message represents the The second electronic device receives the first identification and the second identification.
在一实施例中,所述数据处理方法还包括:In one embodiment, the data processing method further includes:
接收所述第二电子设备发送的所述第一标识和所述第二标识;receiving the first identification and the second identification sent by the second electronic device;
所述在与第二电子设备进行消息交互的过程中,将所述第一信息传输至所述第二电子设备,包括:The transmitting the first information to the second electronic device during the message interaction with the second electronic device includes:
在确认所述第一标识和所述第二标识均有效的情况下,与第二电子设备进行消息交互,将所述第一信息传输至所述第二电子设备。In the case of confirming that both the first identification and the second identification are valid, a message interaction is performed with the second electronic device, and the first information is transmitted to the second electronic device.
在一实施例中,所述第一电子设备与所述第二电子设备交互的消息按设定的消息格式进行封装;其中,In an embodiment, the messages that the first electronic device interacts with the second electronic device are packaged according to a set message format; wherein,
所述设定的消息格式包括:第一字段、第二字段、第三字段和第四字段;所述第一字段用于写入第一序号;第一序号用于标识对应的消息中承载的数据;所述第二字段用于写入第二序号;第二序号用于标识电子设备已接收到序号小于或等于第二序号的所有有效消息;所述第三字段表征电子设备可缓存的有效消息的数量;所述有效消息表征承载了数据的消息;所述第四字段用于承载数据。The set message format includes: a first field, a second field, a third field and a fourth field; the first field is used to write a first sequence number; the first sequence number is used to identify the data; the second field is used to write the second serial number; the second serial number is used to identify that the electronic device has received all valid messages whose serial number is less than or equal to the second serial number; the third field represents the valid messages that can be cached by the electronic device The number of messages; the valid message represents a message carrying data; the fourth field is used to carry data.
在一实施例中,所述在与接收端进行消息交互的过程中,将所述第一信息传输至所述第二电子设备,包括:In an embodiment, the transmitting the first information to the second electronic device during the message interaction with the receiving end includes:
基于所述第一信息生成至少一条第二消息;所述至少一条第二消息中的每条第二消息对应承载所述第一信息中的全部或部分数据;generating at least one second message based on the first information; each second message in the at least one second message corresponds to carrying all or part of the data in the first information;
将所述至少一条第二消息发送至所述第二电子设备。The at least one second message is sent to the second electronic device.
在一实施例中,所述将所述至少一条第二消息发送至所述第二电子设备,包括:In one embodiment, the sending the at least one second message to the second electronic device includes:
基于所述第一电子设备最近一次接收到的消息中的第三字段,将所述至少一条第二消息中的至少一条第二消息连续向所述第二电子设备发送。At least one second message in the at least one second message is continuously sent to the second electronic device based on the third field in the last message received by the first electronic device.
在一实施例中,在所述第一电子设备最近一次接收到的消息中的第三字段表征所述第二电子设备当前可缓存的有效消息的数量大于或等于所述至少一条第二消息的消息总量的情况下,所述将所述至少一条第二消息中的至少一条第二消息连续向所述第二电子设备发送,包括:In one embodiment, the third field in the message last received by the first electronic device indicates that the number of valid messages currently cacheable by the second electronic device is greater than or equal to the number of the at least one second message. In the case of the total number of messages, the continuously sending at least one second message in the at least one second message to the second electronic device includes:
将所述至少一条第二消息中的所有第二消息连续向所述第二电子设备发送。All second messages in the at least one second message are continuously sent to the second electronic device.
在一实施例中,在所述第一电子设备最近一次接收到的消息中的第三字段表征所述第二电子设备当前可缓存的有效消息的数量小于所述至少一条第二消息的消息总量的情况下,所述将所述至少一条第二消息中的至少一条第二消息连续向所述第二电子设备发送,包括:In one embodiment, the third field in the message last received by the first electronic device indicates that the number of valid messages currently cacheable by the second electronic device is less than the total number of messages of the at least one second message. In the case of the amount of the at least one second message, continuously sending the at least one second message to the second electronic device includes:
将所述至少一个第二消息中第一数量的第二消息连续向所述第二电子设备发送;其中,所述第一数量小于或等于所述第二电子设备当前可缓存的消息的数量。A first number of second messages in the at least one second message are continuously sent to the second electronic device; wherein the first number is less than or equal to the number of messages currently cacheable by the second electronic device.
在一实施例中,所述数据处理方法还包括:In one embodiment, the data processing method further includes:
在第三序号与第四序号不同的情况下,基于所述第一序号与所述第二序号,向所述第二电子设备重发所述至少一条第二消息中的至少一条第二消息;其中,In the case that the third sequence number is different from the fourth sequence number, based on the first sequence number and the second sequence number, retransmit at least one second message in the at least one second message to the second electronic device; in,
所述第三序号表征最后一次接收到的所述第二电子设备发送的消息中的第二字段表征的序号;所述第四序号表征所述第一电子设备最后一次发送的第二消息中的第一字段表征的序号。The third sequence number represents the sequence number represented by the second field in the last received message sent by the second electronic device; the fourth sequence number represents the sequence number represented by the second field in the last message sent by the first electronic device. The sequence number represented by the first field.
在一实施例中,在所述第一电子设备最近一次发送的第三消息的第四字段为空的情况下,所述第三消息中的第一字段表征的序号与所述第一电子设备最近一次发送的有效消息中的第一字段表征的序号相同。In an embodiment, if the fourth field of the third message sent by the first electronic device last time is empty, the sequence number represented by the first field in the third message is the same as that of the first electronic device. The sequence numbers represented by the first field in the last valid message sent are the same.
在一实施例中,所述第一标识为服务实例标识SIID。In an embodiment, the first identifier is a service instance identifier SIID.
在一实施例中,所述第二标识为实例标识IID。In one embodiment, the second identifier is an instance identifier IID.
在一实施例中,所述服务包括空中下载技术OTA升级、安全认证、协商秘钥中的至少一项。In one embodiment, the service includes at least one of over-the-air technology OTA upgrade, security authentication, and negotiated key.
以下结合说明书附图及具体实施例对本申请的技术方案做进一步的详细阐述。The technical solutions of the present application will be further elaborated below with reference to the accompanying drawings and specific embodiments of the description.
图1示出了本申请实施例提供的一种数据处理方法的交互图。参照图1,本实施例中的数据处理方法包括:FIG. 1 shows an interaction diagram of a data processing method provided by an embodiment of the present application. 1, the data processing method in this embodiment includes:
S101:第一电子设备基于第一标识和第二标识确定出第一信息;所述第一标识表征请求的服务;所述第二标识表征所述服务相关的执行动作;所述第一信息表征完成所述执行动作所需要向第二电子设备发送的数据。S101: The first electronic device determines first information based on the first identifier and the second identifier; the first identifier represents a requested service; the second identifier represents an execution action related to the service; the first information represents Data sent to the second electronic device required to complete the execution action.
这里,第一标识可以对应为服务实例标识(SIID,Service Instance ID),或者对应为应用层服务标识。服务实例用于实现对应的服务,应用层服务用于提供对应的服务,该服务包括OTA升级、安全认证、协商秘钥中的至少一项。Here, the first identifier may correspond to a service instance identifier (SIID, Service Instance ID), or correspond to an application layer service identifier. The service instance is used to implement the corresponding service, and the application layer service is used to provide the corresponding service, and the service includes at least one of OTA upgrade, security authentication, and negotiated secret key.
第二标识可以为实例标识(IID,Instance ID),用于标识应用层服务对应的实例,该实例表征与第一标识对应的服务相关的执行动作。在实际应用中,实例可以包括以下至少一项:OTA升级实例、安全认证实例、协商秘钥实例。The second identifier may be an instance identifier (IID, Instance ID), which is used to identify an instance corresponding to the application layer service, and the instance represents an execution action related to the service corresponding to the first identifier. In practical applications, the instances may include at least one of the following: an OTA upgrade instance, a security authentication instance, and a negotiated key instance.
需要说明的是,一个第一标识对应至少一个第二标识。同一第一标识对应的不同的第二标识表征与该第一标识对应的服务相关的不同执行动作。It should be noted that one first identifier corresponds to at least one second identifier. Different second identifiers corresponding to the same first identifier represent different execution actions related to the service corresponding to the first identifier.
在第一标识表征请求的服务对应为OTA升级的情况下,当第一电子设备为请求OTA升级服务的设备时,第一信息可以包括待升级对象的标识和版本号等信息;待升级对象包括第一电子设备中的应用程序、第一电子设备中的固件等。固件是指写入电子设备的可擦除可编程只读存储器(EPROM,Erasable Programmable ROM)或电可擦除可编程只读存储器(EEPROM,Electrically erasable Programmable Read-only Memory)中的程序。当第一电子设备为OTA提供升级服务的服务器时,第一信息包括对应的升级包,该升级包基于待升级对象的标识以及版本号确定出。In the case where the service requested by the first identifier represents an OTA upgrade, when the first electronic device is a device requesting an OTA upgrade service, the first information may include information such as the identifier and version number of the object to be upgraded; the object to be upgraded includes An application program in the first electronic device, firmware in the first electronic device, and the like. Firmware refers to the program written in Erasable Programmable Read-Only Memory (EPROM, Erasable Programmable ROM) or Electrically Erasable Programmable Read-Only Memory (EEPROM, Electrically Erasable Programmable Read-only Memory) of an electronic device. When the first electronic device is a server that provides an upgrade service for OTA, the first information includes a corresponding upgrade package, and the upgrade package is determined based on the identifier and version number of the object to be upgraded.
在第一标识表征请求的服务对应为安全认证的情况下,第一信息包括第一电子设备进行安全认证需要向第二电子设备发送的相关数据。In the case that the service corresponding to the request of the first identification representation is security authentication, the first information includes relevant data that the first electronic device needs to send to the second electronic device to perform security authentication.
S102:第一电子设备在与第二电子设备进行消息交互的过程中,将所述第一信息传输至所述第二电子设备。S102: The first electronic device transmits the first information to the second electronic device during the message interaction process with the second electronic device.
这里,第一电子设备可以将第一信息封装成至少一条消息,将至少一条消息传输至第二电子设备。其中,消息用于承载第一信息中的部分或全部数据。第一电子设备可以将第一信息对应的所有消息连续向第二电子设备发送。Here, the first electronic device may encapsulate the first information into at least one message, and transmit the at least one message to the second electronic device. The message is used to carry part or all of the data in the first information. The first electronic device may continuously send all messages corresponding to the first information to the second electronic device.
当第一信息封装成至少两条消息时,第一电子设备也可以将至少两条消息中的所有消息分批次向第二电子设备发送。每个批次的消息的数量为至少一条。当每个批次的消息的数量为至少两条时,第一电子设备将每个批次的所有消息连续向第二电子设备发送。当第一信息包括的所有消息分为至少两个批次发送时,第一电子设备将第一批次中的至少两条消息中的所有消息连续向第二电子设备发送,在接收到第二电子设备针对第一批次的消息发送的确认消息时,再将第一信息对应的至少一条消息向第二电子设备发送。该确认消息表征第二电子设备接收到第一信息对应的至少一条消息。When the first information is packaged into at least two messages, the first electronic device may also send all the messages in the at least two messages to the second electronic device in batches. The number of messages per batch is at least one. When the number of messages in each batch is at least two, the first electronic device continuously sends all the messages in each batch to the second electronic device. When all the messages included in the first information are sent in at least two batches, the first electronic device continuously sends all the messages in the at least two messages in the first batch to the second electronic device, and after receiving the second electronic device When the electronic device sends a confirmation message for the first batch of messages, it sends at least one message corresponding to the first information to the second electronic device. The confirmation message represents that the second electronic device has received at least one message corresponding to the first information.
需要说明的是,第一电子设备在与第二电子设备进行消息交互,将第一信息传输至第二电子设备的过程中,第一电子设备在接收到第二电子设备发送的任一消息表征未完全接收到第一电子设备发送的第一信息对应的所有数据时,基于第二电子设备发送的该消息表征的已接收到的数据的标识,从第一信息中确定出对应的丢包数据,并将确定出的丢包数据重新向第二电子设备发送。It should be noted that, in the process that the first electronic device interacts with the second electronic device and transmits the first information to the second electronic device, the first electronic device receives any message sent by the second electronic device. When not completely receiving all the data corresponding to the first information sent by the first electronic device, determine the corresponding packet loss data from the first information based on the identifier of the received data represented by the message sent by the second electronic device , and re-send the determined packet loss data to the second electronic device.
本实施例提供的方案中,通过第一标识表征请求的服务,第二标识表征该服务相关的执行动作,第一电子设备在与第二电子设备进行消息交互的过程中,通过交互消息携 带基于第一标识和第二标识确定出的第一信息,该数据处理方法可以适用于需要经过至少两次数据交互才能完成的不同事务。第一电子设备在发送一条消息之后不需要等到该条消息对应的应答消息,即可发送下一条消息,可以提高数据交互效率和数据处理效率。In the solution provided by this embodiment, the requested service is represented by the first identifier, and the execution action related to the service is represented by the second identifier. The first information determined by the first identifier and the second identifier, and the data processing method can be applied to different transactions that can be completed by at least two data interactions. After sending a message, the first electronic device can send the next message without waiting for a response message corresponding to the message, which can improve data interaction efficiency and data processing efficiency.
在一实施例中,所述第一电子设备与所述第二电子设备交互的消息按设定的消息格式进行封装;其中,In an embodiment, the messages that the first electronic device interacts with the second electronic device are packaged according to a set message format; wherein,
所述设定的消息格式包括:第一字段、第二字段、第三字段和第四字段;所述第一字段用于写入第一序号;写入的第一序号为使用序号,用于标识对应的消息中承载的数据,用于追踪消息是否已经送达;所述第二字段用于写入第二序号;第二序号为确认序号,用于标识电子设备已接收到序号小于或等于第二序号的所有有效消息,用来通知对方在Ack表征的序号之前的所有消息已经收到;所述第三字段为窗口字段,用于表征电子设备可缓存的有效消息的数量,用来提示对方,在未收到任何Ack消息之前,对方可以向我方发送多少条消息;所述有效消息表征承载了数据的消息;所述第四字段用于承载数据。The set message format includes: a first field, a second field, a third field and a fourth field; the first field is used to write a first sequence number; the written first sequence number is a use sequence number, used for Identifies the data carried in the corresponding message, which is used to track whether the message has been delivered; the second field is used to write the second sequence number; the second sequence number is the confirmation sequence number, which is used to identify that the electronic device has received the sequence number less than or equal to All valid messages of the second serial number are used to notify the other party that all messages before the serial number represented by Ack have been received; the third field is a window field, used to represent the number of valid messages that can be cached by the electronic device, used to prompt The other party, before receiving any Ack message, how many messages the other party can send to us; the valid message represents a message carrying data; the fourth field is used to carry data.
在实际应用中,第一字段对应为Seq,用于标识一条有效消息,有效消息表征第四字段承载有数据的消息;第二字段对应为Ack,第三字段对应为窗口Win。这里,不同的有效消息的第一字段中的第一序号是连续且递增的;第二字段写入的第二序号不能覆盖未接收到的有效消息的第一字段中的第一序号。例如,第一电子设备连续向第二电子设备发送了5条有效信息,5条有效信息的第一字段分别为1、2、3、4、5,第二电子设备在接收到第一电子设备发送的有效消息的第一字段的第一序号对应为1、2、3、5的情况下,由于第二电子设备未接收到第一字段的第一序号为4的有效消息,因此,第二电子设备针对第一电子设备发送的有效消息进行应答时,在对应的消息的第二字段中写入的第二序号为3,表征第二电子设备已接收到第一电子设备发送的第一序号小于或等于3的所有有效消息。In practical applications, the first field corresponds to Seq, which is used to identify a valid message, and the valid message represents a message carrying data in the fourth field; the second field corresponds to Ack, and the third field corresponds to the window Win. Here, the first sequence numbers in the first fields of different valid messages are consecutive and increasing; the second sequence numbers written in the second fields cannot cover the first sequence numbers in the first fields of the valid messages that are not received. For example, the first electronic device continuously sends 5 pieces of valid information to the second electronic device, and the first fields of the 5 pieces of valid information are 1, 2, 3, 4, and 5 respectively. When the first sequence number of the first field of the sent valid message corresponds to 1, 2, 3, and 5, since the second electronic device has not received the valid message with the first sequence number of the first field being 4, the second electronic device does not receive the valid message whose first sequence number is 4. When the electronic device responds to a valid message sent by the first electronic device, the second sequence number written in the second field of the corresponding message is 3, indicating that the second electronic device has received the first sequence number sent by the first electronic device. All valid messages less than or equal to 3.
在实际应用中,Seq可以按递增值为1从0开始递增,在Seq递增至(2 32-1)时,下一个有效消息的Seq对应为0。这里,Seq可以按递增值为1从1开始递增,在Seq递增至2 32时,下一个有效消息的Seq对应为1。 In practical applications, Seq can be incremented from 0 according to the increment value of 1. When Seq increments to (2 32 -1), the Seq of the next valid message corresponds to 0. Here, Seq can be incremented from 1 according to the increment value of 1. When Seq is incremented to 2 32 , the Seq of the next valid message corresponds to 1.
第二字段写入的第二序号随着电子设备接收到的有效消息中的第一字段对应的第一序号动态更新。这里,当电子设备接收到的任一消息中的第四字段为空时,表征该消息不是有效消息,电子设备不需要对该消息进行应答,即,不需要针对该消息发送用于标识已收到该消息的确认消息。也就是说,电子设备在接收到该消息之后,在不需要向发送该消息的电子设备发送有效消息的情况下,电子设备不再单独发送一条用于标识已收到该消息的确认消息;在需要向发送该消息的电子设备发送有效消息的情况下,电子设备在接收到该消息之后发送的第一条有效消息中的第二字段表征的序号,与在接收到该消息之前发送的最后一条消息中的第二字段表征的序号相同。The second sequence number written in the second field is dynamically updated with the first sequence number corresponding to the first field in the valid message received by the electronic device. Here, when the fourth field in any message received by the electronic device is empty, it indicates that the message is not a valid message, and the electronic device does not need to respond to the message, that is, it does not need to send a message for identifying the received message. A confirmation message to this message. That is to say, after the electronic device receives the message, without the need to send a valid message to the electronic device that sent the message, the electronic device no longer sends a separate confirmation message for identifying that the message has been received; When a valid message needs to be sent to the electronic device that sent the message, the sequence number represented by the second field in the first valid message sent by the electronic device after receiving the message, and the last valid message sent before the message is received The sequence numbers represented by the second field in the message are the same.
在实际应用中,第三字段表征电子设备可缓存的有效消息的数量大于或等于2,从而使得发送有效消息的电子设备可以向该电子设备连续发送至少两条有效消息,接收有效消息的电子设备可以在接收到至少两条有效消息时进行应答,不必针对每条有效消息进行应答,这样可以提高消息传输效率。In practical applications, the third field indicates that the number of valid messages that can be cached by the electronic device is greater than or equal to 2, so that the electronic device sending valid messages can continuously send at least two valid messages to the electronic device, and the electronic device receiving valid messages It is possible to reply when at least two valid messages are received, and it is not necessary to reply for each valid message, which can improve the efficiency of message transmission.
需要说明的是,第三字段表征电子设备可缓存的有效消息的数量可以基于对应的缓存空间和一条有效消息占用的最大比特数确定出。第三字段表征的当前可缓存的有效消息的数量随着有效消息的处理进度进行动态更新。例如,第一电子设备在处理完至少一条缓存的有效消息的情况下,实时更新第一电子设备当前可缓存的有效消息的数量。It should be noted that the third field indicates that the number of valid messages that can be cached by the electronic device may be determined based on the corresponding cache space and the maximum number of bits occupied by a valid message. The number of currently cacheable valid messages represented by the third field is dynamically updated along with the processing progress of valid messages. For example, when the first electronic device has processed at least one cached valid message, the first electronic device updates the number of valid messages currently cached by the first electronic device in real time.
第一电子设备和第二电子设备在初始化过程中,对以下参数进行初始化:During the initialization process of the first electronic device and the second electronic device, the following parameters are initialized:
LocalSeq,LocalAck,LocalWin;RemoteSeq,RemoteAck,RemoteWin。LocalSeq, LocalAck, LocalWin; RemoteSeq, RemoteAck, RemoteWin.
第一电子设备对上述参数进行初始化时,LocalSeq对应于第一电子设备的第一字段,LocalAck对应于第一电子设备的第二字段,LocalWin对应于第一电子设备的第三字段;RemoteSeq对应于第二电子设备的第一字段,RemoteAck对应于第二电子设备的第二字段,RemoteWin对应于第二电子设备的第三字段。其中,LocalWin表征第一电子设备当前可缓存的有效消息的数量,用于标识第二电子设备可连续向第一电子设备发送的有效消息的消息总量;RemoteWin表征第二电子设备当前可缓存的有效消息的数量,用于标识第一电子设备可连续向第二电子设备发送的有效消息的消息总量。例如,当RemoteWin=14时,表征第一电子设备当前可以连续向第二电子设备发送14条有效消息。When the first electronic device initializes the above parameters, LocalSeq corresponds to the first field of the first electronic device, LocalAck corresponds to the second field of the first electronic device, LocalWin corresponds to the third field of the first electronic device; RemoteSeq corresponds to The first field of the second electronic device, RemoteAck corresponds to the second field of the second electronic device, and RemoteWin corresponds to the third field of the second electronic device. Wherein, LocalWin represents the number of valid messages currently cacheable by the first electronic device, and is used to identify the total number of valid messages that the second electronic device can continuously send to the first electronic device; RemoteWin represents the current cacheable messages of the second electronic device The number of valid messages is used to identify the total number of valid messages that the first electronic device can continuously send to the second electronic device. For example, when RemoteWin=14, it means that the first electronic device can currently continuously send 14 valid messages to the second electronic device.
第二电子设备对上述参数进行初始化时,LocalSeq对应于第二电子设备的第一字段,LocalAck对应于第二电子设备的第二字段,LocalWin对应于第二电子设备的第三字段;RemoteSeq对应于第一电子设备的第一字段,RemoteAck对应于第一电子设备的第二字段,RemoteWin对应于第一电子设备的第三字段。其中,LocalWin表征第二电子设备当前可缓存的有效消息的数量,用于标识第一电子设备可连续向第二电子设备发送的有效消息的消息总量;RemoteWin表征第一电子设备当前可缓存的有效消息的数量,用于标识第二电子设备可连续向第一电子设备发送的有效消息的消息总量。When the second electronic device initializes the above parameters, LocalSeq corresponds to the first field of the second electronic device, LocalAck corresponds to the second field of the second electronic device, LocalWin corresponds to the third field of the second electronic device; RemoteSeq corresponds to the second field of the second electronic device; The first field of the first electronic device, RemoteAck corresponds to the second field of the first electronic device, and RemoteWin corresponds to the third field of the first electronic device. Wherein, LocalWin represents the number of valid messages currently cacheable by the second electronic device, and is used to identify the total number of valid messages that the first electronic device can continuously send to the second electronic device; RemoteWin represents the current cacheable messages of the first electronic device The number of valid messages is used to identify the total number of valid messages that the second electronic device can continuously send to the first electronic device.
需要说明的是,在初始化过程中,第三字段表征电子设备可缓存的有效消息的数量大于或等于2。It should be noted that, in the initialization process, the third field indicates that the number of valid messages that can be cached by the electronic device is greater than or equal to 2.
在本实施例提供的方案中,通过第一字段写入的使用序号追踪消息是否已经送达,这样可以保证消息有序送达,通过第二字段写入的确认序号,通知对方在Ack表征的序号之前的所有消息已经收到,这样可以确保消息的可靠性传输,可以确保电子设备最终能够接收到所有消息,通过第三字段提示对方,在未收到任何Ack消息之前,对方可以向我方发送多少条消息,电子设备不需要每接收到一条消息就进行应答,电子设备可以连续发送至少两条消息,由此可以提高消息的传输效率。In the solution provided by this embodiment, whether the message has been delivered is tracked through the usage sequence number written in the first field, so that the orderly delivery of the message can be ensured, and the confirmation sequence number written in the second field is used to notify the other party that the message represented by Ack has been delivered. All messages before the serial number have been received, which can ensure the reliable transmission of the message, and can ensure that the electronic device can finally receive all the messages. The third field is used to prompt the other party. Before receiving any Ack message, the other party can send us a message. No matter how many messages are sent, the electronic device does not need to respond every time a message is received, and the electronic device can continuously send at least two messages, thereby improving the transmission efficiency of messages.
在一实施例中,图2示出了本申请实施例提供的数据处理方法中第一电子设备传输第一信息的实现流程示意图。如图2所示,所述第一电子设备在与接收端进行消息交互的过程中,将所述第一信息传输至所述第二电子设备,包括:In an embodiment, FIG. 2 shows a schematic flowchart of the implementation of the first electronic device transmitting the first information in the data processing method provided by the embodiment of the present application. As shown in FIG. 2 , in the process of message interaction with the receiving end, the first electronic device transmits the first information to the second electronic device, including:
S201:基于所述第一信息生成至少一条第二消息;所述至少一条第二消息中的每条第二消息对应承载所述第一信息中的全部或部分数据。S201: Generate at least one second message based on the first information; each second message in the at least one second message corresponds to carrying all or part of the data in the first information.
第一电子设备按设定的消息格式,将第一信息封装成至少一条第二消息。这里,当第一信息占用的比特数大于设定的消息格式的第四字段可承载的数据对应的最大比特数时,将第一信息封装成至少两条第二消息。至少两条第二消息中的所有第二消息承载的数据组成第一信息的全部数据,每条第二消息的第四字段承载的数据占用的比特数均小于或等于设定的消息格式的第四字段可承载的数据对应的最大比特数。第二消息可以标记为ActionMessage。The first electronic device encapsulates the first information into at least one second message according to the set message format. Here, when the number of bits occupied by the first information is greater than the maximum number of bits corresponding to the data that can be carried in the fourth field of the set message format, the first information is encapsulated into at least two second messages. The data carried by all the second messages in the at least two second messages constitute all the data of the first message, and the number of bits occupied by the data carried in the fourth field of each second message is less than or equal to the number of bits occupied by the set message format. The maximum number of bits corresponding to the data that the four fields can carry. The second message may be marked as ActionMessage.
由于第二消息中的第四字段均承载有数据,因此,第二消息均为有效消息。Since the fourth fields in the second message all carry data, the second messages are all valid messages.
每条第二消息中的第二字段写入的第二序号,基于第一电子设备接收到的第二电子设备最后一次发送的有效消息中第一字段表征的序号确定出。每条第二消息中的第三字段用于标识第一电子设备当前可缓存的有效消息的数量,以便第二电子设备确定出可连续向第一电子设备发送的有效消息的总数。The second sequence number written in the second field in each second message is determined based on the sequence number represented by the first field in the last valid message sent by the second electronic device received by the first electronic device. The third field in each second message is used to identify the number of valid messages currently cacheable by the first electronic device, so that the second electronic device can determine the total number of valid messages that can be continuously sent to the first electronic device.
S202:将所述至少一条第二消息发送至所述第二电子设备。S202: Send the at least one second message to the second electronic device.
这里,将至少一条第二消息发送至所述第二电子设备的具体实现过程请参照S102中将所述第一信息传输至所述第二电子设备的相关描述,此处不赘述。Here, for the specific implementation process of sending at least one second message to the second electronic device, please refer to the relevant description of transmitting the first information to the second electronic device in S102, which is not repeated here.
在本实施例提供的方案中,按照设定的消息格式将第一信息封装成至少一条第二消息,当第一信息对应的第二消息为至少两条时,由于第二电子设备初始可缓存的有效消 息的数量大于或等于2,因此,第一电子设备可以向第二电子设备连续发送至少两条承载有第一信息的数据的第二消息,也就是说,在发送一条第二消息之后,不需要在接收到该第二消息对应的应答消息之后才发送下一条第二消息,由此可以提高交互效率和消息的传输效率。第一电子设备在接收到第二电子设备发送的有效消息之后,向第二电子设备发送的消息中可以承载第一信息的数据,还可以表征接收到的有效消息对应的序号,可以提高数据处理效率。In the solution provided in this embodiment, the first information is encapsulated into at least one second message according to the set message format. When there are at least two second messages corresponding to the first information, since the second electronic device can initially cache The number of valid messages is greater than or equal to 2, therefore, the first electronic device can continuously send at least two second messages carrying data of the first information to the second electronic device, that is, after sending one second message , it is not necessary to send the next second message after receiving the response message corresponding to the second message, thereby improving the interaction efficiency and the message transmission efficiency. After receiving the valid message sent by the second electronic device, the first electronic device can carry the data of the first information in the message sent to the second electronic device, and can also represent the sequence number corresponding to the received valid message, which can improve data processing. effectiveness.
在一实施例中,所述将所述至少一条第二消息发送至所述第二电子设备,包括:基于所述第一电子设备最近一次接收到的消息中的第三字段,将所述至少一条第二消息中的至少一条第二消息连续向所述第二电子设备发送。In one embodiment, the sending the at least one second message to the second electronic device includes: based on a third field in a message last received by the first electronic device, sending the at least one second message to the second electronic device. At least one of the second messages is continuously sent to the second electronic device.
这里,第一电子设备基于最近一次接收到的消息中的第三字段,确定出第二电子设备当前可缓存的有效消息的数量,基于第二电子设备当前可缓存的有效消息的数量,将至少一条第二消息中的至少一条第二消息连续向第二电子设备发送,从而将第一信息对应的所有第二消息传输至第二电子设备。Here, the first electronic device determines the number of valid messages currently cacheable by the second electronic device based on the third field in the last received message, and based on the number of valid messages currently cached by the second electronic device, at least At least one second message in the one second message is continuously sent to the second electronic device, so that all the second messages corresponding to the first information are transmitted to the second electronic device.
在本实施例提供的方案中,由于第一电子设备最近一次接收到的消息中的第三字段表征第二电子设备当前可缓存的有效消息的数量,第二电子设备初始可缓存的有效消息的数量大于或等于2,第一电子设备可以向第二电子设备连续发送至少两条承载有第一信息的数据的第二消息,可以提高第二消息的效率。In the solution provided in this embodiment, since the third field in the message last received by the first electronic device represents the number of valid messages currently cacheable by the second electronic device, the number of valid messages that can be cached initially by the second electronic device is When the number is greater than or equal to 2, the first electronic device can continuously send at least two second messages carrying data of the first information to the second electronic device, which can improve the efficiency of the second messages.
在一实施例中,在所述第一电子设备最近一次接收到的消息中的第三字段表征所述第二电子设备当前可缓存的有效消息的数量大于或等于所述至少一条第二消息的消息总量的情况下,所述将所述至少一条第二消息中的至少一条第二消息连续向所述第二电子设备发送,包括:将所述至少一条第二消息中的所有第二消息连续向所述第二电子设备发送。In one embodiment, the third field in the message last received by the first electronic device indicates that the number of valid messages currently cacheable by the second electronic device is greater than or equal to the number of the at least one second message. In the case of the total number of messages, the continuously sending at least one second message in the at least one second message to the second electronic device includes: sending all the second messages in the at least one second message continuously to the second electronic device.
这里,第一电子设备基于最近一次接收到的消息中的第三字段,确定出第二电子设备当前可缓存的有效消息的数量的情况下,当第二电子设备当前可缓存的有效消息的数量大于或等于基于第一信息生成的至少一条第二消息的消息总量时,将至少一条第二消息中的所有第二消息连续向第二电子设备发送。Here, if the first electronic device determines the number of valid messages currently cacheable by the second electronic device based on the third field in the last received message, when the number of valid messages currently cached by the second electronic device is When the total amount of the at least one second message generated based on the first information is greater than or equal to the total amount of messages, all the second messages in the at least one second message are continuously sent to the second electronic device.
在实际应用中,当第二电子设备当前可缓存的有效消息的数量为14条,基于第一信息生成的第二消息的消息总量为10条时,第一电子设备将这10条第二消息连续向第二电子设备发送。In practical applications, when the number of valid messages currently cacheable by the second electronic device is 14, and the total number of second messages generated based on the first information is 10, the first electronic device stores the 10 second messages as second messages. The message is continuously sent to the second electronic device.
需要说明的是,当第二电子设备当前可缓存的消息的数量小于基于第一信息生成的至少一条第二消息的消息总量时,第一电子设备将第一信息对应的至少一个第二消息中第一数量的第二消息连续向第二电子设备发送。第一数量小于或等于第二电子设备当前可缓存的消息的数量。第一数量可以大于或等于2。It should be noted that, when the number of messages currently cacheable by the second electronic device is less than the total number of messages of at least one second message generated based on the first information, the first electronic device stores the at least one second message corresponding to the first information. The first number of second messages in are continuously sent to the second electronic device. The first number is less than or equal to the number of messages currently cacheable by the second electronic device. The first number may be greater than or equal to two.
第二电子设备在接收到至少一条第二消息,且已处理完至少一条第二消息的情况下,更新第二电子设备当前可缓存的有效消息的数量。When the second electronic device receives at least one second message and has processed the at least one second message, the second electronic device updates the number of valid messages currently cacheable by the second electronic device.
第一电子设备接收到第二电子设备发送的第三消息时,第一电子设备基于第三消息中的第二字段表征的第二序号,确定出第二电子设备是否已接收到第一数量的第二消息中的所有第二消息。第三消息用于标识第二电子设备已接收到第一电子设备发送的至少一条第二消息。When the first electronic device receives the third message sent by the second electronic device, the first electronic device determines whether the second electronic device has received the first number of messages based on the second sequence number represented by the second field in the third message. All of the second messages in the second message. The third message is used to identify that the second electronic device has received at least one second message sent by the first electronic device.
这里,当第三消息中的第二字段表征的第二序号等于第一数量的第一消息中的第一字段对应的数值最大的第一序号时,表征第二电子设备已接收到第一数量的第二消息中的所有第二消息。第一电子设备基于第三消息中的第三字段表征第二电子设备当前可缓存的有效消息的数量,将第二数量的第二消息连续向第二电子设备发送。第二数量的第二消息均为第一信息对应的第二消息中未发送的第二消息。Here, when the second sequence number represented by the second field in the third message is equal to the first sequence number with the largest value corresponding to the first field in the first message of the first quantity, it means that the second electronic device has received the first quantity All second messages in the second message. The first electronic device continuously sends the second number of second messages to the second electronic device based on the third field in the third message representing the number of valid messages currently cacheable by the second electronic device. The second number of second messages are all unsent second messages in the second messages corresponding to the first information.
当第三消息中的第二字段表征的第二序号小于第一数量的第一消息的第一字段对应的数值最大的第一序号时,表征第二电子设备接收到第一数量的第二消息中的部分第二消息。第一电子设备基于第三消息中的第三字段表征第二电子设备当前可缓存的有效消息的数量,以及基于第三消息中的第二字段,将第三数量的第二消息连续向第二电子设备发送。第三数量的第二消息包括第一信息对应的第二消息中未发送的第二消息以及第一数量的第二消息中第二电子设备未接收到的第二消息。第二电子设备未接收到的第二消息表征第一字段的第一序号大于第三消息中第二字段对应的第二序号的第二消息。When the second sequence number represented by the second field in the third message is smaller than the first sequence number with the largest value corresponding to the first field of the first message of the first quantity, it means that the second electronic device has received the second message of the first quantity Part of the second message in . Based on the third field in the third message, the first electronic device represents the number of valid messages currently cacheable by the second electronic device, and based on the second field in the third message, continuously forwards the third number of second messages to the second electronic device. Electronic device sent. The third number of second messages includes unsent second messages among the second messages corresponding to the first information and second messages that are not received by the second electronic device among the first number of second messages. The second message that is not received by the second electronic device represents a second message in which the first sequence number of the first field is greater than the second sequence number corresponding to the second field in the third message.
在本实施例提供的方案中,在第一电子设备最近一次接收到的消息中的第三字段表征所述第二电子设备当前可缓存的有效消息的数量大于或等于所述至少一条第二消息的消息总量的情况下,表征第二电子设备可以缓存第一信息对应的所有第二消息,因此,第一电子设备将第一信息对应的所有第二消息连续向第二电子设备发送,可以提高第二消息的传输效率。In the solution provided by this embodiment, the third field in the message last received by the first electronic device indicates that the number of valid messages currently cacheable by the second electronic device is greater than or equal to the at least one second message In the case of the total number of messages, it means that the second electronic device can cache all the second messages corresponding to the first information. Therefore, the first electronic device continuously sends all the second messages corresponding to the first information to the second electronic device. The transmission efficiency of the second message is improved.
在一实施例中,图3示出了本申请另一实施例提供的数据处理方法中第一电子设备传输第一信息的实现流程示意图。如图3所示,在图2的基础上,在所述将所述至少一条第二消息发送至所述第二电子设备时,还包括:In an embodiment, FIG. 3 shows a schematic flowchart of an implementation of the first electronic device transmitting the first information in the data processing method provided by another embodiment of the present application. As shown in FIG. 3 , on the basis of FIG. 2 , when the at least one second message is sent to the second electronic device, the method further includes:
S203:在第三序号与第四序号不同的情况下,基于所述第一序号与所述第二序号,向所述第二电子设备重发所述至少一条第二消息中的至少一条第二消息;其中,所述第三序号表征最后一次接收到的所述第二电子设备发送的消息中的第二字段表征的序号;所述第四序号表征所述第一电子设备最后一次发送的第二消息中的第一字段表征的序号。S203: In the case that the third sequence number is different from the fourth sequence number, based on the first sequence number and the second sequence number, resend at least one second message in the at least one second message to the second electronic device message; wherein, the third sequence number represents the sequence number represented by the second field in the message sent by the second electronic device last received; the fourth sequence number represents the last sequence number sent by the first electronic device. The sequence number represented by the first field in the second message.
这里,在第三序号和第四序号不同的情况下,表征第二电子设备未成功接收第一电子设备已发送的所有第二消息。Here, when the third sequence number and the fourth sequence number are different, it means that the second electronic device has not successfully received all the second messages that have been sent by the first electronic device.
第一电子设备基于第三序号与第四序号,确定出大于第三序号的第四序号所对应的第二消息,得到第二电子设备未接收到的第二消息,并向第二电子设备重发确定出的第二消息。Based on the third sequence number and the fourth sequence number, the first electronic device determines the second message corresponding to the fourth sequence number greater than the third sequence number, obtains the second message that is not received by the second electronic device, and replays the second message to the second electronic device. Send the determined second message.
在本实施例提供的方案中,在第三序号与第四序号不同的情况下,表征第二电子设备未接收到第一电子设备发送的所有第二消息,第一电子设备基于第三序号与第四序号,可以从第一电子设备已发送的第二消息中,确定出第二电子设备未接收到的第二消息,从而向第二电子设备重发确定出的第二消息,以确保第二电子设备最终可以接收到第一信息对应的所有第二消息,保证消息传输的可靠性。In the solution provided in this embodiment, when the third sequence number is different from the fourth sequence number, it means that the second electronic device has not received all the second messages sent by the first electronic device, and the first electronic device is based on the third sequence number and the fourth sequence number. The fourth sequence number can be used to determine the second message that has not been received by the second electronic device from the second message sent by the first electronic device, so that the determined second message can be resent to the second electronic device to ensure that the second message is not received by the second electronic device. The second electronic device can finally receive all the second messages corresponding to the first information to ensure the reliability of message transmission.
在一实施例中,第一电子设备对应于服务请求方,图4示出了本申请另一实施例提供的数据处理方法的交互图。参照图4,本实施例中的数据处理方法包括:In an embodiment, the first electronic device corresponds to a service requester, and FIG. 4 shows an interaction diagram of a data processing method provided by another embodiment of the present application. 4, the data processing method in this embodiment includes:
S401:第一电子设备向所述第二电子设备发送所述第一标识和所述第二标识。S401: The first electronic device sends the first identification and the second identification to the second electronic device.
第一电子设备可以基于检测到的用户操作确定出用户请求的服务,从而确定出对应的第一标识和第二标识,并向第二电子设备发送第一标识和第二标识。当第一标识对应至少两个第二标识时,第一电子设备可以基于用户请求的服务对应的设定实现流程确定出服务相关的所有执行动作,基于服务相关的执行动作对应的设定执行顺序,确定出当前的执行动作,从而得到对应的第二标识。The first electronic device may determine the service requested by the user based on the detected user operation, thereby determining the corresponding first identification and the second identification, and send the first identification and the second identification to the second electronic device. When the first identifier corresponds to at least two second identifiers, the first electronic device may determine all execution actions related to the service based on the setting implementation process corresponding to the service requested by the user, and based on the set execution sequence corresponding to the execution actions related to the service , to determine the current execution action, so as to obtain the corresponding second identifier.
在实际应用中,在第一电子设备与第二电子设备建立通信连接的情况下,第一电子设备可以向第二电子设备发送一条启动消息,例如,ActionStart。启动消息包括第一字段、第二字段、第三字段和第四字段,其中,第一字段Seq=1,第二字段Ack=0,第三字段Win用于标识第一电子设备当前可缓存的有效消息的数量,第四字段用于承载第一标识和第二标识。In practical applications, when the first electronic device establishes a communication connection with the second electronic device, the first electronic device may send a start message, for example, ActionStart, to the second electronic device. The startup message includes a first field, a second field, a third field and a fourth field, wherein the first field Seq=1, the second field Ack=0, and the third field Win is used to identify the current cacheable data of the first electronic device. The number of valid messages, and the fourth field is used to carry the first identifier and the second identifier.
S402:第一电子设备基于第一标识和第二标识确定出第一信息;所述第一标识表征 请求的服务;所述第二标识表征所述服务相关的执行动作;所述第一信息表征完成所述执行动作所需要向第二电子设备发送的数据。S402: The first electronic device determines first information based on the first identifier and the second identifier; the first identifier represents a requested service; the second identifier represents an execution action related to the service; the first information represents Data sent to the second electronic device required to complete the execution action.
本实施例中的S402请参照上述实施例中第一电子设备基于第一标识和第二标识确定出第一信息的相关描述,此处不赘述。For S402 in this embodiment, please refer to the relevant description that the first electronic device determines the first information based on the first identifier and the second identifier in the foregoing embodiment, and details are not described here.
这里,第一电子设备可以先执行S401再执行S402,也可以先执行S402再执行S401,还可以同时执行S401和S402。Here, the first electronic device may execute S401 first and then execute S402, or may execute S402 first and then execute S401, or may execute S401 and S402 at the same time.
S403:第二电子设备向第一电子设备发送第一消息;所述第一消息表征所述第二电子设备接收到所述第一标识和所述第二标识。S403: The second electronic device sends a first message to the first electronic device; the first message indicates that the second electronic device receives the first identifier and the second identifier.
第二电子设备在接收到第一电子设备发送的第一标识和第二标识的情况下,向第一电子设备发送第一消息,以通知第一电子设备,第二电子设备已接收到第一标识和第二标识。In the case of receiving the first identification and the second identification sent by the first electronic device, the second electronic device sends a first message to the first electronic device to notify the first electronic device that the second electronic device has received the first identification and secondary identification.
在实际应用中,第二电子设备在接收到承载有第一标识和第二标识的ActionStart的情况下,保存ActionStart中第三字段的数据,向第一电子设备发送一条ActionMessage。该ActionMessage用于对ActionStart进行应答,表征已接收到ActionStart。在ActionStart中的第一字段写入的第一序号为1的情况下,该ActionMessage中的第二字段写入的第二序号为1。该ActionMessage中的第三字段写入的数据(数字和字母中的至少一项)表征第二电子设备当前可缓存的有效消息的数量。In an actual application, the second electronic device saves the data in the third field in the ActionStart and sends an ActionMessage to the first electronic device when it receives the ActionStart carrying the first and second identifiers. The ActionMessage is used to respond to ActionStart, indicating that ActionStart has been received. When the first sequence number written in the first field in ActionStart is 1, the second sequence number written in the second field in the ActionMessage is 1. The data (at least one of numbers and letters) written in the third field in the ActionMessage represents the number of valid messages currently cacheable by the second electronic device.
这里,该ActionMessage中的第四字段可以为空,此时,该ActionMessage作为一条确认消息,仅仅用于对第一电子设备发送的ActionStart进行应答,从而通知第一电子设备,当前第二电子设备已接收到第一标识和第二标识。此时,该ActionMessage中的第一字段写入的第一序号为0,表征ActionMessage中的第四字段为空。Here, the fourth field in the ActionMessage can be empty. In this case, the ActionMessage is used as a confirmation message only to respond to the ActionStart sent by the first electronic device, so as to notify the first electronic device that the current second electronic device has The first identification and the second identification are received. At this time, the first sequence number written in the first field in the ActionMessage is 0, indicating that the fourth field in the ActionMessage is empty.
该ActionMessage中的第四字段也可以承载第二信息中的部分或全部数据,第二信息由第二电子设备基于第一标识和第二标识确定出,第二信息表征完成第二标识对应的执行动作所需要向第一电子设备发送的数据。此时,该ActionMessage中的第一字段写入的第一序号为1,表征该ActionMessage中的第四字段承载有数据。The fourth field in the ActionMessage can also carry part or all of the data in the second information. The second information is determined by the second electronic device based on the first identification and the second identification. The second information indicates that the execution corresponding to the second identification is completed. Data required for the action to be sent to the first electronic device. At this time, the first sequence number written in the first field in the ActionMessage is 1, which indicates that the fourth field in the ActionMessage carries data.
S404:第一电子设备在接收到所述第二电子设备发送的第一消息的情况下,与第二电子设备进行消息交互,将所述第一信息传输至所述第二电子设备。S404: In the case of receiving the first message sent by the second electronic device, the first electronic device performs message interaction with the second electronic device, and transmits the first information to the second electronic device.
这里,第一电子设备在接收到第二电子设备发送的第一消息的情况下,将S402中确定出的第一信息传输至第二电子设备。具体实现过程请参照上述实施例中的相关描述,此处不赘述。Here, when receiving the first message sent by the second electronic device, the first electronic device transmits the first information determined in S402 to the second electronic device. For the specific implementation process, please refer to the relevant descriptions in the foregoing embodiments, which will not be repeated here.
在实际应用中,第一电子设备在接收到第二电子设备基于ActionStart发送的ActionMessage时,保存ActionMessage中第三字段的数据,以便该基于ActionMessage中第三字段的数据,将第一信息传输至第二电子设备。In practical applications, when the first electronic device receives the ActionMessage sent by the second electronic device based on ActionStart, it saves the data in the third field in the ActionMessage, so that the first electronic device transmits the first information to the third field based on the data in the third field in the ActionMessage. Two electronic equipment.
在实际应用中,第一信息对应的数据承载在至少一条ActionMessage中的第四字段中。In practical applications, the data corresponding to the first information is carried in the fourth field in at least one ActionMessage.
需要说明的是,第一电子设备在向第二电子设备发送第一标识和第二标识之后,且在设定时长内未接收到第二电子设备发送的第一消息时,表征第二电子设备未接收到第一标识和第二标识,此处,再次执行S401,以向第二电子设备重发第一标识和第二标识。It should be noted that, after the first electronic device sends the first identification and the second identification to the second electronic device, and does not receive the first message sent by the second electronic device within a set period of time, it represents the second electronic device. The first identification and the second identification are not received, and here, S401 is performed again to resend the first identification and the second identification to the second electronic device.
需要说明的是,第一电子设备在执行完第一标识对应的服务相关的执行动作的情况下,可以向第二电子设备发送结束请求,以释放相关的资源,该结束请求可以对应为TransactionEndReq。It should be noted that the first electronic device may send an end request to the second electronic device to release related resources when the execution action related to the service corresponding to the first identifier is completed, and the end request may correspond to TransactionEndReq.
第二电子设备在接收到第一电子设备发送的结束请求的情况下,基于接收到的所有ActionMessage的解析结果,向第一电子设备发送用于标识确认结束的消息,例如, GenericEndResp,将第二标识对应的执行动作标记为已完成。这里,当解析结果表征所有的ActionMessage均解析正常时,GenericEndResp表征执行正常,第二电子设备可以基于所有接收到的ActionMessage中的第一字段表征的序号,将所有ActionMessage中的第四字段中承载的数据,拼接得到第一信息;当解析结果表征任一ActionMessage解析异常时,GenericEndResp表征执行异常。In the case of receiving the end request sent by the first electronic device, the second electronic device sends a message for identifying the end of the confirmation to the first electronic device based on the received parsing results of all ActionMessages, for example, GenericEndResp, the second electronic device Mark the corresponding execution action as completed. Here, when the parsing result indicates that all ActionMessages are parsed normally, the GenericEndResp indicates that the execution is normal, and the second electronic device may, based on the sequence numbers represented by the first fields in all received ActionMessages, convert the values carried in the fourth fields of all ActionMessages. data, splicing to obtain the first information; when the parsing result indicates that any ActionMessage parsing is abnormal, GenericEndResp indicates that the execution is abnormal.
第一电子设备在接收到第二电子设备发送的GenericEndResp时,可以基于GenericEndResp向应用层上报处理结果。这里,当GenericEndResp表征执行异常时,向应用层上报用于标识处理失败的通知消息;当GenericEndResp表征执行正常时,向应用层上报用于标识处理成功的通知消息。该通知消息携带第一标识和第二标识。When receiving the GenericEndResp sent by the second electronic device, the first electronic device may report the processing result to the application layer based on the GenericEndResp. Here, when the GenericEndResp representation is abnormally executed, a notification message for identifying the processing failure is reported to the application layer; when the GenericEndResp representation is executed normally, a notification message for identifying the processing success is reported to the application layer. The notification message carries the first identifier and the second identifier.
本实施例提供的方案中,第一电子设备在向第二电子设备发送第一标识和第二标识之后,在接收到第二电子设备发送的用于表征已接收到第一标识和第二标识的第一消息时,与第二电子设备进行消息交互,将基于第一标识和第二标识确定出的第一信息传输至第二电子设备,由此确保第二设备能够接收到第一标识和第二标识,从而基于第一信息完成与第一电子设备请求的服务相关的执行动作,以使得第一电子设备能够获取到对应的服务。In the solution provided in this embodiment, after the first electronic device sends the first identification and the second identification to the second electronic device, after receiving a message sent by the second electronic device to indicate that the first identification and the second identification have been received When the first message is sent, the second electronic device interacts with the second electronic device, and transmits the first information determined based on the first identification and the second identification to the second electronic device, thereby ensuring that the second device can receive the first identification and the second electronic device. The second identification, so as to complete the execution action related to the service requested by the first electronic device based on the first information, so that the first electronic device can obtain the corresponding service.
在一实施例中,第一电子设备对应于服务提供方,图5示出了本申请另一实施例提供的数据处理方法的交互图。参照图5,本实施例中的数据处理方法包括:In an embodiment, the first electronic device corresponds to a service provider, and FIG. 5 shows an interaction diagram of a data processing method provided by another embodiment of the present application. 5, the data processing method in this embodiment includes:
S501:第二电子设备向第一电子设备发送所述第一标识和所述第二标识。S501: The second electronic device sends the first identification and the second identification to the first electronic device.
在实际应用中,在第二电子设备与第一电子设备建立通信连接的情况下,第二电子设备可以向第一电子设备发送一条启动消息。例如,ActionStart。启动消息包括第一字段、第二字段、第三字段和第四字段,其中,第一字段Seq=1,第二字段Ack=0,第三字段Window用于标识第二电子设备当前可缓存的有效消息的数量,第四字段中承载有第一标识和第二标识。In practical applications, when the second electronic device establishes a communication connection with the first electronic device, the second electronic device may send a startup message to the first electronic device. For example, ActionStart. The startup message includes a first field, a second field, a third field and a fourth field, wherein the first field Seq=1, the second field Ack=0, and the third field Window is used to identify the current cacheable data of the second electronic device The number of valid messages, the fourth field carries the first identifier and the second identifier.
S502:第一电子设备接收所述第二电子设备发送的所述第一标识和所述第二标识。S502: The first electronic device receives the first identifier and the second identifier sent by the second electronic device.
S503:第一电子设备在确认所述第一标识和所述第二标识均有效的情况下,与第二电子设备进行消息交互,将所述第一信息传输至所述第二电子设备。S503: In the case of confirming that the first identification and the second identification are both valid, the first electronic device performs message interaction with the second electronic device, and transmits the first information to the second electronic device.
第一电子设备在接收到第二电子设备发送的第一标识和第二标识的情况下,基于设定的第一标识和设定的第二标识,对第二电子设备发送的第一标识和第二标识进行校验,得到校验结果。这里,当第一电子设备从设定的第一标识中查找到与第二电子设备发送的第一标识相同或匹配时,表征第二电子设备发送的第一标识有效;当第一电子设备从设定的第一标识中查找到与第二电子设备发送的第一标识不同或不匹配时,表征第二电子设备发送的第一标识无效。当第一电子设备从设定的第二标识中查找到与第二电子设备发送的第二标识相同或匹配时,表征第二电子设备发送的第二标识有效;当第一电子设备从设定的第二标识中查找到与第二电子设备发送的第二标识不同或不匹配时,表征第二电子设备发送的第二标识无效。When the first electronic device receives the first identification and the second identification sent by the second electronic device, based on the set first identification and the set second identification, the first identification and the second identification sent by the second electronic device The second identification is verified to obtain a verification result. Here, when the first electronic device finds from the set first identification that it is the same as or matches with the first identification sent by the second electronic device, it indicates that the first identification sent by the second electronic device is valid; When the set first identifier is found to be different from or does not match the first identifier sent by the second electronic device, it indicates that the first identifier sent by the second electronic device is invalid. When the first electronic device finds the same or matches with the second identification sent by the second electronic device from the set second identification, it indicates that the second identification sent by the second electronic device is valid; When it is found that it is different from or does not match the second identifier sent by the second electronic device, it indicates that the second identifier sent by the second electronic device is invalid.
在校验结果表征第二电子设备发送的第一标识和第二标识均有效的情况下,通过与第二电子设备进行消息交互,将第一信息传输至第二电子设备。其中,第一电子设备可以基于第二电子设备发送的启动消息中的第三字段确定出第二电子设备当前可缓存的有效消息的数量,从而基于第二电子设备当前可缓存的有效消息的数量,将第一信息传输至第二电子设备。具体实现方式请参照上述实施例的相关描述,此处不赘述。When the verification result indicates that the first identification and the second identification sent by the second electronic device are both valid, the first information is transmitted to the second electronic device by performing message interaction with the second electronic device. Wherein, the first electronic device can determine the number of valid messages currently cacheable by the second electronic device based on the third field in the startup message sent by the second electronic device, so as to be based on the number of valid messages currently cacheable by the second electronic device , and transmit the first information to the second electronic device. For a specific implementation manner, please refer to the relevant descriptions of the foregoing embodiments, which will not be repeated here.
在校验结果表征第二电子设备发送的第一标识和第二标识中任一个无效的情况下,结束数据处理流程。In the case that the verification result indicates that any one of the first identifier and the second identifier sent by the second electronic device is invalid, the data processing flow ends.
在本实施例提供的方案中,第一电子设备在确认接收到的第一标识和第二标识均有效的情况下,才基于第一标识和第二标识确定出第一信息,从而在与第二电子设备进行 数据交互的过程中,将第一信息传输至第二电子设备,在接收到的第一标识或第二标识无效的情况下,结束数据处理流程,由此确保向第二电子设备返回的第一信息是第一电子设备请求的服务对应的数据,保证数据的正确性,从而为第一电子设备提供对应的服务。In the solution provided in this embodiment, the first electronic device determines the first information based on the first identifier and the second identifier only when it confirms that the received first identifier and the second identifier are valid. In the process of data exchange between the two electronic devices, the first information is transmitted to the second electronic device, and when the received first identification or the second identification is invalid, the data processing flow is ended, thereby ensuring that the second electronic device is sent to the second electronic device. The returned first information is the data corresponding to the service requested by the first electronic device, so as to ensure the correctness of the data, so as to provide the corresponding service for the first electronic device.
作为本申请的一个应用实施例,图6示出了本申请应用实施例提供的一种数据处理方法的交互图。图如6所示,在对终端进行OTA升级的应用场景下,数据处理方法包括:As an application embodiment of the present application, FIG. 6 shows an interaction diagram of a data processing method provided by the application embodiment of the present application. As shown in Figure 6, in the application scenario of OTA upgrade of the terminal, the data processing method includes:
S601:终端向服务器发送第一标识和第二标识。所述第一标识表征请求的服务;所述第二标识表征所述服务相关的执行动作。S601: The terminal sends the first identifier and the second identifier to the server. The first identifier represents a requested service; the second identifier represents an execution action related to the service.
第一标识可以对应为OTA服务实例标识,第一标识表征请求的服务对应为OTA升级服务。第二标识表征OTA服务相关的执行动作,例如,OTA升级。The first identifier may correspond to an OTA service instance identifier, and the first identifier represents that the requested service corresponds to an OTA upgrade service. The second identifier represents an execution action related to the OTA service, for example, an OTA upgrade.
在实际应用中,终端向服务器发送ActionStart。ActionStart中的第一字段Seq=1,ActionStart中的第二字段Ack=0,ActionStart中的第三字段Window=16,用于标识终端当前可缓存的有效消息的数量,ActionStart中的第四字段中承载有第一标识和第二标识。In practical applications, the terminal sends ActionStart to the server. The first field Seq=1 in ActionStart, the second field Ack=0 in ActionStart, and the third field Window=16 in ActionStart are used to identify the number of valid messages that the terminal can currently cache. Bearing the first identification and the second identification.
S602:服务器在确认所述第一标识和所述第二标识均有效的情况下,向终端发送第一消息;所述第一消息表征所述服务器接收到所述第一标识和所述第二标识。S602: The server sends a first message to the terminal under the condition of confirming that both the first identifier and the second identifier are valid; the first message indicates that the server has received the first identifier and the second identifier logo.
第一消息的第一字段Seq=0,第一消息的第二字段Ack=1,第一消息的第三字段表征服务器当前可缓存的有效消息的数量,第一消息的第四字段为空。The first field of the first message Seq=0, the second field of the first message Ack=1, the third field of the first message represents the number of valid messages currently cacheable by the server, and the fourth field of the first message is empty.
S603:终端基于第一标识和第二标识确定出第一信息;所述第一信息表征完成所述执行动作所需要向所述服务器发送的数据。S603: The terminal determines first information based on the first identifier and the second identifier; the first information represents data that needs to be sent to the server to complete the execution action.
这里,第一信息可以包括待升级对象的标识和版本号等信息;待升级对象包括终端中的应用程序、终端中的固件等。Here, the first information may include information such as the identifier and version number of the object to be upgraded; the object to be upgraded includes the application program in the terminal, the firmware in the terminal, and the like.
需要说明的是,S601和S603可以同时执行。It should be noted that S601 and S603 may be executed simultaneously.
S604:终端在接收到所述服务器发送的第一消息的情况下,与服务器进行消息交互,将所述第一信息传输至所述服务器。S604: In the case of receiving the first message sent by the server, the terminal performs message interaction with the server, and transmits the first information to the server.
终端将第一信息封装成至少一条ActionMessage;至少一条ActionMessage中的所有ActionMessage承载的数据组成第一信息的全部数据。ActionMessage中的第四字段用于承载第一信息的数据。The terminal encapsulates the first information into at least one ActionMessage; the data carried by all ActionMessages in the at least one ActionMessage constitutes all data of the first information. The fourth field in ActionMessage is used to carry the data of the first information.
在实际应用中,由于待升级对象的标识和版本号所占的总比特数较小,因此,第一信息可以封装成一条ActionMessage。In practical applications, since the total number of bits occupied by the identifier and version number of the object to be upgraded is small, the first information can be encapsulated into an ActionMessage.
S605:服务器基于所述第一标识、所述第二标识和所述第一信息,确定出第二信息;所述第二信息表征完成所述执行动作所需要向所述终端发送的数据。S605: The server determines second information based on the first identifier, the second identifier, and the first information; the second information represents data that needs to be sent to the terminal to complete the execution action.
这里,第二信息包括对应的升级包。Here, the second information includes the corresponding upgrade package.
S606:服务器与所述终端进行消息交互,将所述第二信息传输至所述终端。S606: The server performs message interaction with the terminal, and transmits the second information to the terminal.
这里,由于升级包所占的比特数较大,因此,服务器基于第二信息生成至少两条ActionMessage,至少两条ActionMessage中的所有ActionMessage中的第四字段承载的数据组成第二信息的全部数据。Here, since the upgrade package occupies a large number of bits, the server generates at least two ActionMessages based on the second information, and the data carried in the fourth field in all ActionMessages in the at least two ActionMessages constitute all data of the second information.
当至少两条ActionMessage的消息总量小于或等于ActionStart中的第三字段表征的终端当前可缓存的有效消息的数量时,将至少两条ActionMessage中的所有ActionMessage连续向终端发送。例如,当ActionStart中的第三字段对应为16时,在至少两条ActionMessage的消息总量小于或等于16的情况下,将至少两条ActionMessage中的所有ActionMessage连续向终端发送。When the total amount of the at least two ActionMessages is less than or equal to the number of valid messages currently cacheable by the terminal represented by the third field in the ActionStart, all ActionMessages in the at least two ActionMessages are continuously sent to the terminal. For example, when the third field in ActionStart corresponds to 16, if the total amount of messages in at least two ActionMessages is less than or equal to 16, all ActionMessages in the at least two ActionMessages are continuously sent to the terminal.
当至少两条ActionMessage的消息总量大于ActionStart中的第三字段表征的终端当前可缓存的有效消息的数量时,将至少两条ActionMessage中第一数量的ActionMessage 连续向终端发送。第一数量小于或等于终端当前可缓存的有效消息的数量。When the total amount of messages of the at least two ActionMessages is greater than the number of valid messages currently cacheable by the terminal represented by the third field in the ActionStart, the first number of ActionMessages in the at least two ActionMessages are continuously sent to the terminal. The first number is less than or equal to the number of valid messages currently buffered by the terminal.
S607:终端在接收到所述第二信息的至少部分数据的情况下,向所述服务器发送第三消息。S607: The terminal sends a third message to the server when at least part of the data of the second information is received.
终端在接收到服务器发送的第二信息对应的ActionMessage的情况下,向服务器发送第三消息。第三消息中的第二字段写入的序号表征终端已接收到服务器发送的ActionMessage中第一字段表征的序号小于或等于第三消息中的第二字段表征的序号的所有ActionMessage。In the case of receiving the ActionMessage corresponding to the second information sent by the server, the terminal sends a third message to the server. The sequence number written in the second field in the third message indicates that the terminal has received all ActionMessages whose sequence number represented by the first field in the ActionMessage sent by the server is less than or equal to the sequence number represented by the second field in the third message.
需要说明的是,终端在接收到服务器发送的第二信息对应的至少两条ActionMessage时,可以基于接收到服务器发送的至少两条ActionMessage中的每条ActionMessage的第一字段表征的序号,确定出接收到ActionMessage的第一字段表征的序号是否连续,当确定结果表征接收到ActionMessage的第一字段表征的序号不连续时,向服务器发送第三消息。终端也可以在确定结果表征接收到ActionMessage的第一字段表征的序号连续,且ActionMessage的第一字段表征的最大序号等于终端当前可缓存的有效消息的数量相同时,向服务器发送第三消息。It should be noted that, when the terminal receives at least two ActionMessages corresponding to the second information sent by the server, the terminal may determine whether to receive the sequence number represented by the first field of each ActionMessage in the at least two ActionMessages sent by the server. Whether the sequence numbers represented by the first field of the ActionMessage are continuous, and when the determination result indicates that the sequence numbers represented by the first field of the ActionMessage received are discontinuous, a third message is sent to the server. The terminal may also send the third message to the server when the determination result indicates that the sequence numbers represented by the first field of the ActionMessage are consecutive, and the maximum sequence number represented by the first field of the ActionMessage is equal to the number of valid messages that the terminal can currently cache.
例如,服务器发送的至少两条ActionMessage的第一字段表征的序号对应为:1、2、3、4、5、6、7、8、9、10、11、12、13、14,终端接收到的ActionMessage的第一字段表征的序号对应为1、2、3、4、5、6、7、8、9、10、12、13,终端发送的第三消息中的第二字段Ack=10,表征终端已接收到第一字段表征的序号为1至10的ActionMessage。For example, the sequence numbers represented by the first field of at least two ActionMessages sent by the server correspond to: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, and the terminal receives The sequence number represented by the first field of the ActionMessage corresponds to 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, and the second field Ack=10 in the third message sent by the terminal, Indicates that the terminal has received ActionMessages with serial numbers 1 to 10 represented by the first field.
当第三消息中的第四字段表征终端当前可缓存的有效消息的数量为10时,由于第三消息中的第二字段表征的序号为10,服务器发送的最后一次发送的ActionMessage中的第一字段表征的序号为14,两个序号不同,因此,服务器基于第三消息中的第二字段表征的序号,将Seq=11、12、13、14的ActionMessage连续向终端发送。这里,服务器在S607中发送了14条ActionMessage之后,还存在第二信息对应的未发送的ActionMessage,可以基于第三消息中的第四字段表征终端当前可缓存的有效消息的数量,将Seq=11、12、13、14的ActionMessage,以及第二信息对应的至少一条未发送的ActionMessage,连续向终端发送。When the fourth field in the third message indicates that the number of valid messages that the terminal can currently cache is 10, since the sequence number represented by the second field in the third message is 10, the first field in the ActionMessage sent by the server for the last time is 10. The sequence number represented by the field is 14, and the two sequence numbers are different. Therefore, the server continuously sends ActionMessages with Seq=11, 12, 13, and 14 to the terminal based on the sequence number represented by the second field in the third message. Here, after the server sends 14 ActionMessages in S607, there is still an unsent ActionMessage corresponding to the second message. Based on the fourth field in the third message, the number of valid messages that can be cached by the terminal can be represented, and Seq=11 , ActionMessages of 12, 13, 14, and at least one unsent ActionMessage corresponding to the second message are continuously sent to the terminal.
这里,当第三消息中的第四字段为空时,第三消息的第一字段表征的序号与终端向服务器发送的最后一条有效消息(例如,ActionStart)中的第一字段表征的序号相同。当第三消息中的第四字段为空,且第三消息中的第二字段表征的序号与基于第二信息生成的ActionMessage中的第一字段对应的最大序号相同时,表征终端已接收到用于承载升级包的数据的所有消息,此时,服务器不需要对第三消息进行应答,也就是说,服务器不需要针对第三消息单独发送一条用于标识已接收到第三消息的消息。Here, when the fourth field in the third message is empty, the sequence number represented by the first field of the third message is the same as the sequence number represented by the first field in the last valid message (eg, ActionStart) sent by the terminal to the server. When the fourth field in the third message is empty, and the sequence number represented by the second field in the third message is the same as the maximum sequence number corresponding to the first field in the ActionMessage generated based on the second information, it indicates that the terminal has received the For all messages carrying the data of the upgrade package, at this time, the server does not need to respond to the third message, that is, the server does not need to send a separate message for the third message to identify that the third message has been received.
S608:终端向所述服务器发送结束请求消息。S608: The terminal sends an end request message to the server.
终端在接收到用于承载升级包的数据的所有ActionMessage的情况下,向服务器发送结束请求消息,例如,TransactionEndReq。该结束请求消息中的第一字段表征的序号与终端最后一次向服务器发送的有效消息中的第一字段表征的序号相同。该结束消息中的第二字段表征的序号与服务器最后一次发送的用于承载第二信息的数据的ActionMessage中的第一字段表征的序号相同。The terminal sends an end request message, for example, TransactionEndReq, to the server in the case of receiving all the ActionMessages used to carry the data of the upgrade package. The sequence number represented by the first field in the end request message is the same as the sequence number represented by the first field in the last valid message sent by the terminal to the server. The sequence number represented by the second field in the end message is the same as the sequence number represented by the first field in the ActionMessage for carrying the data of the second information sent by the server last time.
S609:服务器在接收到所述结束请求消息的情况下,向所述终端发送确认结束消息。S609: In the case of receiving the end request message, the server sends a confirmation end message to the terminal.
服务器在接收到终端发送的结束请求消息,且接收到的终端发送的第三消息表征终端已接收到用于承载升级包的数据的所有消息的情况下,向服务器发送确认结束消息,将第二标识表征的执行动作标记为已完成。When the server receives the end request message sent by the terminal, and the received third message sent by the terminal indicates that the terminal has received all the messages used to carry the data of the upgrade package, the server sends a confirmation end message to the server, and sends the second message to the server. The execution action of the identity token is marked as completed.
S610:终端在接收到所述确认结束消息的情况下,向应用层上报对应的执行结果。S610: In the case of receiving the confirmation end message, the terminal reports the corresponding execution result to the application layer.
这里,终端在已接收到第二信息对应的全部ActionMessage的情况下,对第二信息 对应的全部ActionMessage进行解析,得到解析结果。解析结果包括每个ActionMessage对应的第一字段表征的序号和对应的第四字段承载的数据。当终端能够成功解析出所有ActionMessage承载的数据时,向应用层上报用于标识执行正常的消息;终端基于解析结果中每个ActionMessage对应的第一字段的序号,将对应的第四字段承载的数据进行排序,得到排序后的数据,并将排序后的数据上报给应用层。排序后的数据组成对应的第二信息(即,升级包),用于供第一标识对应的OTA升级服务利用升级包对对应的应用程序或固件进行OTA升级。Here, when the terminal has received all the ActionMessages corresponding to the second information, the terminal parses all the ActionMessages corresponding to the second information to obtain the analysis results. The parsing result includes the sequence number represented by the first field corresponding to each ActionMessage and the data carried by the corresponding fourth field. When the terminal can successfully parse out the data carried by all ActionMessages, it reports a message to the application layer to identify the normal execution; based on the sequence number of the first field corresponding to each ActionMessage in the parsing result, the terminal parses the data carried by the corresponding fourth field Perform sorting to obtain sorted data, and report the sorted data to the application layer. The sorted data forms corresponding second information (ie, an upgrade package), which is used for the OTA upgrade service corresponding to the first identifier to use the upgrade package to perform OTA upgrade on the corresponding application or firmware.
终端解析第二信息对应的任一ActionMessage出错时,结束OTA升级,向应用层上报用于标识升级失败的处理结果,结束数据处理流程。When an error occurs in the terminal parsing any ActionMessage corresponding to the second information, the OTA upgrade is terminated, the processing result used to identify the upgrade failure is reported to the application layer, and the data processing flow is ended.
本实施例提供的方案中,服务器可以向终端连续发送至少两条ActionMessage,终端不需要针对每条ActionMessage进行应答,由此可以提高OTA升级包的传输效率,提升OTA升级速度。In the solution provided by this embodiment, the server can continuously send at least two ActionMessages to the terminal, and the terminal does not need to respond to each ActionMessage, thereby improving the transmission efficiency of the OTA upgrade package and the speed of the OTA upgrade.
为了实现本申请实施例的方法,本申请实施例还提供了一种数据处理装置,设置在电子设备上。如图7所示,数据处理装置包括:In order to implement the method of the embodiment of the present application, the embodiment of the present application further provides a data processing apparatus, which is arranged on an electronic device. As shown in Figure 7, the data processing device includes:
确定单元71,配置为基于第一标识和第二标识确定出第一信息;所述第一标识表征请求的服务;所述第二标识表征所述服务相关的执行动作;所述第一信息表征完成所述执行动作所需要向第二电子设备发送的数据;The determining unit 71 is configured to determine first information based on the first identifier and the second identifier; the first identifier represents a requested service; the second identifier represents an execution action related to the service; the first information represents data that needs to be sent to the second electronic device to complete the execution action;
消息交互单元72,配置为在与第二电子设备进行消息交互的过程中,将所述第一信息传输至所述第二电子设备。The message interaction unit 72 is configured to transmit the first information to the second electronic device during the process of message interaction with the second electronic device.
在一实施例中,所述第一标识为服务实例标识SIID。In an embodiment, the first identifier is a service instance identifier SIID.
在一实施例中,所述第二标识为实例标识IID。In one embodiment, the second identifier is an instance identifier IID.
在一实施例中,所述服务包括空中下载技术OTA升级、安全认证、协商秘钥中的至少一项。In one embodiment, the service includes at least one of over-the-air technology OTA upgrade, security authentication, and negotiated key.
在一实施例中,如图8所示,数据处理装置还包括:In one embodiment, as shown in FIG. 8 , the data processing apparatus further includes:
发送单元73,配置为向所述第二电子设备发送所述第一标识和所述第二标识;A sending unit 73, configured to send the first identification and the second identification to the second electronic device;
消息交互单元72具体配置为:在接收到所述第二电子设备发送的第一消息的情况下,与第二电子设备进行消息交互,将所述第一信息传输至所述第二电子设备;所述第一消息表征所述第二电子设备接收到所述第一标识和所述第二标识。The message interaction unit 72 is specifically configured to: in the case of receiving the first message sent by the second electronic device, perform message interaction with the second electronic device, and transmit the first information to the second electronic device; The first message represents that the second electronic device has received the first identification and the second identification.
在一实施例中,如图9所示,数据处理装置还包括:In one embodiment, as shown in FIG. 9 , the data processing apparatus further includes:
接收单元74,配置为接收所述第二电子设备发送的所述第一标识和所述第二标识;a receiving unit 74, configured to receive the first identification and the second identification sent by the second electronic device;
消息交互单元72具体配置为:在确认所述第一标识和所述第二标识均有效的情况下,与第二电子设备进行消息交互,将所述第一信息传输至所述第二电子设备。The message interaction unit 72 is specifically configured to: in the case of confirming that both the first identification and the second identification are valid, perform message interaction with the second electronic device, and transmit the first information to the second electronic device .
在一实施例中,所述第一电子设备与所述第二电子设备交互的消息按设定的消息格式进行封装;其中,所述设定的消息格式包括:第一字段、第二字段、第三字段和第四字段;所述第一字段用于写入第一序号;第一序号用于标识对应的消息中承载的数据;所述第二字段用于写入第二序号;第二序号用于标识电子设备已接收到序号小于或等于第二序号的所有有效消息;所述第三字段表征电子设备可缓存的有效消息的数量;所述有效消息表征承载了数据的消息;所述第四字段用于承载数据。In an embodiment, the message that the first electronic device interacts with the second electronic device is encapsulated in a set message format; wherein the set message format includes: a first field, a second field, The third field and the fourth field; the first field is used to write the first sequence number; the first sequence number is used to identify the data carried in the corresponding message; the second field is used to write the second sequence number; the second The sequence number is used to identify that the electronic device has received all valid messages whose sequence numbers are less than or equal to the second sequence number; the third field represents the number of valid messages that can be cached by the electronic device; the valid messages represent messages that carry data; the The fourth field is used to carry data.
在一实施例中,消息交互单元72具体配置为:In one embodiment, the message interaction unit 72 is specifically configured as:
基于所述第一信息生成至少一条第二消息;所述至少一条第二消息中的每条第二消息对应承载所述第一信息中的全部或部分数据;generating at least one second message based on the first information; each second message in the at least one second message corresponds to carrying all or part of the data in the first information;
将所述至少一条第二消息发送至所述第二电子设备。The at least one second message is sent to the second electronic device.
在一实施例中,消息交互单元72具体配置为:基于所述第一电子设备最近一次接收到的消息中的第三字段,将所述至少一条第二消息中的至少一条第二消息连续向所述 第二电子设备发送。In an embodiment, the message interaction unit 72 is specifically configured to: based on the third field in the message last received by the first electronic device, continuously send at least one second message in the at least one second message to the The second electronic device sends.
在一实施例中,在所述第一电子设备最近一次接收到的消息中的第三字段表征所述第二电子设备当前可缓存的有效消息的数量大于或等于所述至少一条第二消息的消息总量的情况下,消息交互单元72具体配置为:将所述至少一条第二消息中的所有第二消息连续向所述第二电子设备发送。In one embodiment, the third field in the message last received by the first electronic device indicates that the number of valid messages currently cacheable by the second electronic device is greater than or equal to the number of the at least one second message. In the case of the total number of messages, the message interaction unit 72 is specifically configured to: continuously send all the second messages in the at least one second message to the second electronic device.
在一实施例中,在所述第一电子设备最近一次接收到的消息中的第三字段表征所述第二电子设备当前可缓存的有效消息的数量小于所述至少一条第二消息的消息总量的情况下,消息交互单元72具体配置为:In one embodiment, the third field in the message last received by the first electronic device indicates that the number of valid messages currently cacheable by the second electronic device is less than the total number of messages of the at least one second message. In the case of a large amount, the message interaction unit 72 is specifically configured as:
将所述至少一个第二消息中第一数量的第二消息连续向所述第二电子设备发送;其中,所述第一数量小于或等于所述第二电子设备当前可缓存的消息的数量。A first number of second messages in the at least one second message are continuously sent to the second electronic device; wherein the first number is less than or equal to the number of messages currently cacheable by the second electronic device.
在一实施例中,消息交互单元72还配置为:In one embodiment, the message interaction unit 72 is further configured to:
在第三序号与第四序号不同的情况下,基于所述第一序号与所述第二序号,向所述第二电子设备重发所述至少一条第二消息中的至少一条第二消息;其中,In the case that the third sequence number is different from the fourth sequence number, based on the first sequence number and the second sequence number, retransmit at least one second message in the at least one second message to the second electronic device; in,
所述第三序号表征最后一次接收到的所述第二电子设备发送的消息中的第二字段表征的序号;所述第四序号表征所述第一电子设备最后一次发送的第二消息中的第一字段表征的序号。The third sequence number represents the sequence number represented by the second field in the last received message sent by the second electronic device; the fourth sequence number represents the sequence number represented by the second field in the last message sent by the first electronic device. The sequence number represented by the first field.
在一实施例中,在所述第一电子设备最近一次发送的第三消息的第四字段为空的情况下,所述第三消息中的第一字段表征的序号与所述第一电子设备最近一次发送的有效消息中的第一字段表征的序号相同。In an embodiment, if the fourth field of the third message sent by the first electronic device last time is empty, the sequence number represented by the first field in the third message is the same as that of the first electronic device. The sequence numbers represented by the first field in the last valid message sent are the same.
实际应用时,数据处理装置包括的各单元可由数据处理装置中的处理器来实现。处理器需要运行存储器中存储的程序来实现上述各程序模块的功能。In practical application, each unit included in the data processing apparatus can be implemented by a processor in the data processing apparatus. The processor needs to run the programs stored in the memory to realize the functions of the above program modules.
需要说明的是:上述实施例提供的数据处理装置在进行数据处理时,仅以上述各程序模块的划分进行举例说明,实际应用中,可以根据需要而将上述处理分配由不同的程序模块完成,即将数据处理装置的内部结构划分成不同的程序模块,以完成以上描述的全部或者部分处理。另外,上述实施例提供的数据处理装置与数据处理方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that: when the data processing apparatus provided in the above-mentioned embodiment performs data processing, only the division of the above-mentioned program modules is used as an example for illustration. In practical applications, the above-mentioned processing can be allocated to different program modules according to needs. That is, the internal structure of the data processing apparatus is divided into different program modules to complete all or part of the above-described processing. In addition, the data processing apparatus and the data processing method embodiments provided by the above embodiments belong to the same concept, and the specific implementation process thereof is detailed in the method embodiments, which will not be repeated here.
基于上述程序模块的硬件实现,且为了实现本申请实施例的方法,本申请实施例还提供了一种电子设备,电子设备为上述任一实施例中的第一电子设备或第二电子设备。图10为本申请实施例电子设备的硬件组成结构示意图,如图10所示,电子设备包括:Based on the hardware implementation of the above program modules, and in order to implement the methods of the embodiments of the present application, the embodiments of the present application further provide an electronic device, which is the first electronic device or the second electronic device in any of the above embodiments. FIG. 10 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application. As shown in FIG. 10 , the electronic device includes:
通信接口1,能够与其它设备比如网络设备等进行信息交互; Communication interface 1, which can exchange information with other devices such as network devices;
处理器2,与通信接口1连接,以实现与其它设备进行信息交互,用于运行计算机程序时,执行上述一个或多个技术方案提供的数据处理方法。而所述计算机程序存储在存储器3上。The processor 2 is connected to the communication interface 1 to realize information interaction with other devices, and is used to execute the data processing method provided by one or more of the above technical solutions when running the computer program. The computer program is instead stored on the memory 3 .
当然,实际应用时,电子设备中的各个组件通过总线系统4耦合在一起。可理解,总线系统4用于实现这些组件之间的连接通信。总线系统4除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图10中将各种总线都标为总线系统4。Of course, in practical application, various components in the electronic device are coupled together through the bus system 4 . It can be understood that the bus system 4 is used to realize the connection communication between these components. In addition to the data bus, the bus system 4 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the various buses are designated as bus system 4 in FIG. 10 .
本申请实施例中的存储器3用于存储各种类型的数据以支持电子设备的操作。这些数据的示例包括:用于在电子设备上操作的任何计算机程序。The memory 3 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program used to operate on an electronic device.
可以理解,存储器3可以是易失性存储器或非易失性存储器,也可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(ROM,Read Only Memory)、可编程只读存储器(PROM,Programmable Read-Only Memory)、可擦除可编程只读存储器(EPROM,Erasable Programmable Read-Only Memory)、电可擦除可编程只读存储器(EEPROM,Electrically Erasable Programmable Read-Only Memory)、磁 性随机存取存储器(FRAM,ferromagnetic random access memory)、快闪存储器(Flash Memory)、磁表面存储器、光盘、或只读光盘(CD-ROM,Compact Disc Read-Only Memory);磁表面存储器可以是磁盘存储器或磁带存储器。易失性存储器可以是随机存取存储器(RAM,Random Access Memory),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(SRAM,Static Random Access Memory)、同步静态随机存取存储器(SSRAM,Synchronous Static Random Access Memory)、动态随机存取存储器(DRAM,Dynamic Random Access Memory)、同步动态随机存取存储器(SDRAM,Synchronous Dynamic Random Access Memory)、双倍数据速率同步动态随机存取存储器(DDRSDRAM,Double Data Rate Synchronous Dynamic Random Access Memory)、增强型同步动态随机存取存储器(ESDRAM,Enhanced Synchronous Dynamic Random Access Memory)、同步连接动态随机存取存储器(SLDRAM,Sync Link Dynamic Random Access Memory)、直接内存总线随机存取存储器(DRRAM,Direct Rambus Random Access Memory)。本申请实施例描述的存储器3旨在包括但不限于这些和任意其它适合类型的存储器。It is understood that the memory 3 may be a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memory. Among them, the non-volatile memory can be a read-only memory (ROM, Read Only Memory), a programmable read-only memory (PROM, Programmable Read-Only Memory), an erasable programmable read-only memory (EPROM, Erasable Programmable Read-only memory) Only Memory), Electrically Erasable Programmable Read-Only Memory (EEPROM, Electrically Erasable Programmable Read-Only Memory), Magnetic Random Access Memory (FRAM, ferromagnetic random access memory), Flash Memory (Flash Memory), Magnetic Surface Memory , CD-ROM, or CD-ROM (Compact Disc Read-Only Memory); magnetic surface memory can be disk memory or tape memory. Volatile memory may be Random Access Memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory Memory (DRAM, Dynamic Random Access Memory), Synchronous Dynamic Random Access Memory (SDRAM, Synchronous Dynamic Random Access Memory), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM, Double Data Rate Synchronous Dynamic Random Access Memory), Enhanced Type Synchronous Dynamic Random Access Memory (ESDRAM, Enhanced Synchronous Dynamic Random Access Memory), Synchronous Link Dynamic Random Access Memory (SLDRAM, Sync Link Dynamic Random Access Memory), Direct Memory Bus Random Access Memory (DRRAM, Direct Rambus Random Access) Memory). The memory 3 described in the embodiments of the present application is intended to include but not limited to these and any other suitable types of memory.
上述本申请实施例揭示的方法可以应用于处理器2中,或者由处理器2实现。处理器2可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器2中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器2可以是通用处理器、DSP,或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。处理器2可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本申请实施例所公开的方法的步骤,可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于存储介质中,该存储介质位于存储器3,处理器2读取存储器3中的程序,结合其硬件完成前述方法的步骤。The methods disclosed in the above embodiments of the present application may be applied to the processor 2 or implemented by the processor 2 . The processor 2 may be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above-mentioned method can be completed by a hardware integrated logic circuit in the processor 2 or an instruction in the form of software. The above-mentioned processor 2 may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. The processor 2 may implement or execute the methods, steps, and logical block diagrams disclosed in the embodiments of this application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, the storage medium is located in the memory 3, and the processor 2 reads the program in the memory 3, and completes the steps of the foregoing method in combination with its hardware.
处理器2执行所述程序时实现本申请实施例的各个方法中的相应流程,为了简洁,在此不再赘述。When the processor 2 executes the program, the corresponding process in each method of the embodiments of the present application is implemented, which is not repeated here for brevity.
在示例性实施例中,本申请实施例还提供了一种存储介质,即计算机存储介质,具体为计算机可读存储介质,例如包括存储计算机程序的存储器3,上述计算机程序可由处理器2执行,以完成前述方法所述步骤。计算机可读存储介质可以是FRAM、ROM、PROM、EPROM、EEPROM、Flash Memory、磁表面存储器、光盘、或CD-ROM等存储器。In an exemplary embodiment, the embodiment of the present application further provides a storage medium, that is, a computer storage medium, specifically a computer-readable storage medium, for example, including a memory 3 storing a computer program, and the above-mentioned computer program can be executed by the processor 2, to complete the steps described in the preceding method. The computer-readable storage medium may be memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disk, or CD-ROM.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置、终端和方法,可以通过其它的方式实现。以上所描述的设备实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的各组成部分相互之间的耦合、或直接耦合、或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性的、机械的或其它形式的。In the several embodiments provided in this application, it should be understood that the disclosed apparatus, terminal and method may be implemented in other manners. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined, or Can be integrated into another system, or some features can be ignored, or not implemented. In addition, the coupling, or direct coupling, or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be electrical, mechanical or other forms. of.
上述作为分离部件说明的单元可以是、或也可以不是物理上分开的,作为单元显示的部件可以是、或也可以不是物理单元,即可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。The unit described above as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it may be located in one place or distributed to multiple network units; Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各实施例中的各功能单元可以全部集成在一个处理单元中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一个单元中;上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may all be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above integration The unit can be implemented either in the form of hardware or in the form of hardware plus software functional units.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序 在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by program instructions related to hardware, the aforementioned program can be stored in a computer-readable storage medium, and when the program is executed, execute It includes the steps of the above method embodiments; and the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic disk or an optical disk and other media that can store program codes.
或者,本申请上述集成的单元如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机、服务器、或者网络设备等)执行本申请各个实施例所述方法的全部或部分。而前述的存储介质包括:移动存储设备、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Alternatively, if the above-mentioned integrated units of the present application are implemented in the form of software function modules and sold or used as independent products, they may also be stored in a computer-readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products in essence or in the parts that make contributions to the prior art. The computer software products are stored in a storage medium and include several instructions for A computer device (which may be a personal computer, a server, or a network device, etc.) is caused to execute all or part of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic disk or an optical disk and other mediums that can store program codes.
需要说明的是:“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence.
另外,本申请实施例所记载的技术方案和技术特征之间,在不冲突的情况下,可以任意组合。In addition, the technical solutions and technical features described in the embodiments of the present application may be combined arbitrarily if there is no conflict.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this. should be covered within the scope of protection of this application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims (20)

  1. 一种数据处理方法,应用于第一电子设备,所述方法包括:A data processing method, applied to a first electronic device, the method comprising:
    基于第一标识和第二标识确定出第一信息;所述第一标识表征请求的服务;所述第二标识表征所述服务相关的执行动作;所述第一信息表征完成所述执行动作所需要向第二电子设备发送的数据;The first information is determined based on the first identifier and the second identifier; the first identifier represents the requested service; the second identifier represents the execution action related to the service; the first information represents the execution of the execution action. data to be sent to the second electronic device;
    在与第二电子设备进行消息交互的过程中,将所述第一信息传输至所述第二电子设备。In the process of message interaction with the second electronic device, the first information is transmitted to the second electronic device.
  2. 根据权利要求1所述的数据处理方法,其中,还包括:The data processing method according to claim 1, further comprising:
    向所述第二电子设备发送所述第一标识和所述第二标识;sending the first identification and the second identification to the second electronic device;
    所述在与第二电子设备进行消息交互的过程中,将所述第一信息传输至所述第二电子设备,包括:The transmitting the first information to the second electronic device during the message interaction with the second electronic device includes:
    在接收到所述第二电子设备发送的第一消息的情况下,与第二电子设备进行消息交互,将所述第一信息传输至所述第二电子设备;所述第一消息表征所述第二电子设备接收到所述第一标识和所述第二标识。In the case of receiving the first message sent by the second electronic device, perform message interaction with the second electronic device, and transmit the first information to the second electronic device; the first message represents the The second electronic device receives the first identification and the second identification.
  3. 根据权利要求1所述的数据处理方法,其中,还包括:The data processing method according to claim 1, further comprising:
    接收所述第二电子设备发送的所述第一标识和所述第二标识;receiving the first identification and the second identification sent by the second electronic device;
    所述在与第二电子设备进行消息交互的过程中,将所述第一信息传输至所述第二电子设备,包括:The transmitting the first information to the second electronic device during the message interaction with the second electronic device includes:
    在确认所述第一标识和所述第二标识均有效的情况下,与第二电子设备进行消息交互,将所述第一信息传输至所述第二电子设备。In the case of confirming that both the first identification and the second identification are valid, a message interaction is performed with the second electronic device, and the first information is transmitted to the second electronic device.
  4. 根据权利要求1至3任一项所述的数据处理方法,其中,所述第一电子设备与所述第二电子设备交互的消息按设定的消息格式进行封装;其中,The data processing method according to any one of claims 1 to 3, wherein the message interacting between the first electronic device and the second electronic device is encapsulated according to a set message format; wherein,
    所述设定的消息格式包括:第一字段、第二字段、第三字段和第四字段;所述第一字段用于写入第一序号;第一序号用于标识对应的消息中承载的数据;所述第二字段用于写入第二序号;第二序号用于标识电子设备已接收到序号小于或等于第二序号的所有有效消息;所述第三字段表征电子设备可缓存的有效消息的数量;所述有效消息表征承载了数据的消息;所述第四字段用于承载数据。The set message format includes: a first field, a second field, a third field and a fourth field; the first field is used to write a first sequence number; the first sequence number is used to identify the data; the second field is used to write the second serial number; the second serial number is used to identify that the electronic device has received all valid messages whose serial numbers are less than or equal to the second serial number; the third field represents the valid messages that can be cached by the electronic device The number of messages; the valid message represents a message carrying data; the fourth field is used to carry data.
  5. 根据权利要求4所述的数据处理方法,其中,所述在与接收端进行消息交互的过程中,将所述第一信息传输至所述第二电子设备,包括:The data processing method according to claim 4, wherein, in the process of performing message interaction with the receiving end, transmitting the first information to the second electronic device, comprising:
    基于所述第一信息生成至少一条第二消息;所述至少一条第二消息中的每条第二消息对应承载所述第一信息中的全部或部分数据;generating at least one second message based on the first information; each second message in the at least one second message correspondingly carries all or part of the data in the first information;
    将所述至少一条第二消息发送至所述第二电子设备。The at least one second message is sent to the second electronic device.
  6. 根据权利要求5所述的数据处理方法,其中,所述将所述至少一条第二消息发送至所述第二电子设备,包括:The data processing method according to claim 5, wherein the sending the at least one second message to the second electronic device comprises:
    基于所述第一电子设备最近一次接收到的消息中的第三字段,将所述至少一条第二消息中的至少一条第二消息连续向所述第二电子设备发送。At least one second message in the at least one second message is continuously sent to the second electronic device based on the third field in the last message received by the first electronic device.
  7. 根据权利要求6所述的数据处理方法,其中,在所述第一电子设备最近一次接收到的消息中的第三字段表征所述第二电子设备当前可缓存的有效消息的数量大于或等于所述至少一条第二消息的消息总量的情况下,所述将所述至少一条第二消息中的至少一条第二消息连续向所述第二电子设备发送,包括:The data processing method according to claim 6, wherein the third field in the latest message received by the first electronic device indicates that the number of valid messages currently cacheable by the second electronic device is greater than or equal to the number of valid messages currently cached by the second electronic device. In the case of the total number of messages of the at least one second message, the continuously sending at least one second message in the at least one second message to the second electronic device includes:
    将所述至少一条第二消息中的所有第二消息连续向所述第二电子设备发送。All second messages in the at least one second message are continuously sent to the second electronic device.
  8. 根据权利要求6所述的数据处理方法,其中,在所述第一电子设备最近一次 接收到的消息中的第三字段表征所述第二电子设备当前可缓存的有效消息的数量小于所述至少一条第二消息的消息总量的情况下,所述将所述至少一条第二消息中的至少一条第二消息连续向所述第二电子设备发送,包括:The data processing method according to claim 6, wherein the third field in the message last received by the first electronic device indicates that the number of valid messages currently cacheable by the second electronic device is smaller than the at least In the case of the total number of messages of one second message, the sending at least one second message in the at least one second message to the second electronic device continuously includes:
    将所述至少一个第二消息中第一数量的第二消息连续向所述第二电子设备发送;其中,所述第一数量小于或等于所述第二电子设备当前可缓存的消息的数量。A first number of second messages in the at least one second message are continuously sent to the second electronic device; wherein the first number is less than or equal to the number of messages currently cacheable by the second electronic device.
  9. 根据权利要求7或8所述的数据处理方法,其中,还包括:The data processing method according to claim 7 or 8, further comprising:
    在第三序号与第四序号不同的情况下,基于所述第一序号与所述第二序号,向所述第二电子设备重发所述至少一条第二消息中的至少一条第二消息;其中,In the case that the third sequence number is different from the fourth sequence number, based on the first sequence number and the second sequence number, retransmit at least one second message in the at least one second message to the second electronic device; in,
    所述第三序号表征最后一次接收到的所述第二电子设备发送的消息中的第二字段表征的序号;所述第四序号表征所述第一电子设备最后一次发送的第二消息中的第一字段表征的序号。The third sequence number represents the sequence number represented by the second field in the last received message sent by the second electronic device; the fourth sequence number represents the sequence number represented by the second field in the last message sent by the first electronic device. The sequence number represented by the first field.
  10. 根据权利要求4所述的数据处理方法,其中,在所述第一电子设备最近一次发送的第三消息的第四字段为空的情况下,所述第三消息中的第一字段表征的序号与所述第一电子设备最近一次发送的有效消息中的第一字段表征的序号相同。The data processing method according to claim 4, wherein, when the fourth field of the third message sent by the first electronic device last time is empty, the sequence number represented by the first field in the third message It is the same as the sequence number represented by the first field in the last valid message sent by the first electronic device.
  11. 根据权利要求1所述的数据处理方法,其中,所述第一标识为服务实例标识SIID。The data processing method according to claim 1, wherein the first identifier is a service instance identifier SIID.
  12. 根据权利要求1所述的数据处理方法,其中,所述第二标识为实例标识IID。The data processing method according to claim 1, wherein the second identifier is an instance identifier IID.
  13. 根据权利要求1所述的数据处理方法,其中,所述服务包括空中下载技术OTA升级、安全认证、协商秘钥中的至少一项。The data processing method according to claim 1, wherein the service includes at least one of OTA upgrade, security authentication, and negotiated key.
  14. 一种数据处理装置,包括:A data processing device, comprising:
    确定单元,配置为基于第一标识和第二标识确定出第一信息;所述第一标识表征请求的服务;所述第二标识表征所述服务相关的执行动作;所述第一信息表征完成所述执行动作所需要向第二电子设备发送的数据;a determining unit, configured to determine first information based on the first identifier and the second identifier; the first identifier represents a requested service; the second identifier represents an execution action related to the service; the first information represents completion the data that needs to be sent to the second electronic device to perform the action;
    消息交互单元,配置为在与第二电子设备进行消息交互的过程中,将所述第一信息传输至所述第二电子设备。The message interaction unit is configured to transmit the first information to the second electronic device during the process of message interaction with the second electronic device.
  15. 一种电子设备,包括:处理器和配置为存储能够在处理器上运行的计算机程序的存储器,An electronic device comprising: a processor and a memory configured to store a computer program executable on the processor,
    其中,所述处理器配置为运行所述计算机程序时,执行:Wherein, when the processor is configured to run the computer program, execute:
    基于第一标识和第二标识确定出第一信息;所述第一标识表征请求的服务;所述第二标识表征所述服务相关的执行动作;所述第一信息表征完成所述执行动作所需要向第二电子设备发送的数据;The first information is determined based on the first identifier and the second identifier; the first identifier represents the requested service; the second identifier represents the execution action related to the service; the first information represents the execution of the execution action. data to be sent to the second electronic device;
    在与第二电子设备进行消息交互的过程中,将所述第一信息传输至所述第二电子设备。In the process of message interaction with the second electronic device, the first information is transmitted to the second electronic device.
  16. 根据权利要求15所述的电子设备,其中,所述处理器还执行:The electronic device of claim 15, wherein the processor further executes:
    向所述第二电子设备发送所述第一标识和所述第二标识;sending the first identification and the second identification to the second electronic device;
    所述在与第二电子设备进行消息交互的过程中,将所述第一信息传输至所述第二电子设备,包括:The transmitting the first information to the second electronic device during the message interaction with the second electronic device includes:
    在接收到所述第二电子设备发送的第一消息的情况下,与第二电子设备进行消息交互,将所述第一信息传输至所述第二电子设备;所述第一消息表征所述第二电子设备接收到所述第一标识和所述第二标识。In the case of receiving the first message sent by the second electronic device, perform message interaction with the second electronic device, and transmit the first information to the second electronic device; the first message represents the The second electronic device receives the first identification and the second identification.
  17. 根据权利要求15所述的电子设备,其中,所述处理器还执行:The electronic device of claim 15, wherein the processor further executes:
    接收所述第二电子设备发送的所述第一标识和所述第二标识;receiving the first identification and the second identification sent by the second electronic device;
    所述在与第二电子设备进行消息交互的过程中,将所述第一信息传输至所述第二电子设备,包括:The transmitting the first information to the second electronic device during the message interaction with the second electronic device includes:
    在确认所述第一标识和所述第二标识均有效的情况下,与第二电子设备进行消息交互,将所述第一信息传输至所述第二电子设备。In the case of confirming that both the first identification and the second identification are valid, a message interaction is performed with the second electronic device, and the first information is transmitted to the second electronic device.
  18. 根据权利要求15至17任一项所述的电子设备,其中,所述第一电子设备与所述第二电子设备交互的消息按设定的消息格式进行封装;其中,The electronic device according to any one of claims 15 to 17, wherein the message that the first electronic device interacts with the second electronic device is packaged in a set message format; wherein,
    所述设定的消息格式包括:第一字段、第二字段、第三字段和第四字段;所述第一字段用于写入第一序号;第一序号用于标识对应的消息中承载的数据;所述第二字段用于写入第二序号;第二序号用于标识电子设备已接收到序号小于或等于第二序号的所有有效消息;所述第三字段表征电子设备可缓存的有效消息的数量;所述有效消息表征承载了数据的消息;所述第四字段用于承载数据。The set message format includes: a first field, a second field, a third field and a fourth field; the first field is used to write a first sequence number; the first sequence number is used to identify the data; the second field is used to write the second serial number; the second serial number is used to identify that the electronic device has received all valid messages whose serial numbers are less than or equal to the second serial number; the third field represents valid messages that can be cached by the electronic device The number of messages; the valid message represents a message carrying data; the fourth field is used to carry data.
  19. 根据权利要求18所述的电子设备,其中,所述处理器具体执行:The electronic device according to claim 18, wherein the processor specifically executes:
    基于所述第一信息生成至少一条第二消息;所述至少一条第二消息中的每条第二消息对应承载所述第一信息中的全部或部分数据;generating at least one second message based on the first information; each second message in the at least one second message correspondingly carries all or part of the data in the first information;
    将所述至少一条第二消息发送至所述第二电子设备。The at least one second message is sent to the second electronic device.
  20. 一种存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1至13任一项所述的数据处理方法的步骤。A storage medium on which a computer program is stored, the computer program implementing the steps of the data processing method according to any one of claims 1 to 13 when the computer program is executed by a processor.
PCT/CN2021/107458 2020-08-31 2021-07-20 Data processing method and apparatus, electronic device, and storage medium WO2022042140A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010899538.6 2020-08-31
CN202010899538.6A CN111970102B (en) 2020-08-31 2020-08-31 Data processing method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2022042140A1 true WO2022042140A1 (en) 2022-03-03

Family

ID=73400318

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/107458 WO2022042140A1 (en) 2020-08-31 2021-07-20 Data processing method and apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN111970102B (en)
WO (1) WO2022042140A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111970102B (en) * 2020-08-31 2023-06-23 Oppo广东移动通信有限公司 Data processing method, device, electronic equipment and storage medium
CN111988217B (en) 2020-08-31 2022-09-23 Oppo广东移动通信有限公司 Data interaction method and device, electronic equipment and storage medium
CN116648871A (en) * 2020-12-01 2023-08-25 Oppo广东移动通信有限公司 Data processing method, device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106303919A (en) * 2015-06-26 2017-01-04 三星电子株式会社 Use service providing method and the electronic equipment thereof of beacon
US20170078869A1 (en) * 2014-03-05 2017-03-16 Nec Corporation Communication system
CN107632896A (en) * 2017-10-20 2018-01-26 广东欧珀移动通信有限公司 A kind of data processing method, data processing equipment and communication apparatus
US20180198872A1 (en) * 2017-01-09 2018-07-12 Alibaba Group Holding Limited Method, system and device for providing service
CN108833265A (en) * 2018-06-28 2018-11-16 腾讯科技(深圳)有限公司 Message treatment method, device, server and storage medium
CN111970102A (en) * 2020-08-31 2020-11-20 Oppo广东移动通信有限公司 Data processing method and device, electronic equipment and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103313229B (en) * 2013-05-27 2017-04-19 华为终端有限公司 Method and device for upgrading aerial downloading technology
FR3022094B1 (en) * 2014-06-06 2017-12-08 Bull Sas METHOD AND SYSTEM FOR CONTROLLING FLOW
CN106302343A (en) * 2015-05-26 2017-01-04 中兴通讯股份有限公司 The exchange method of session and server, user terminal in a kind of equipment management system
CN106912037A (en) * 2017-03-30 2017-06-30 珠海全志科技股份有限公司 A kind of OTA upgrade methods and device
CN110071896B (en) * 2018-01-22 2021-11-05 中兴通讯股份有限公司 Identity authentication method based on network communication and computer equipment
CN110858791A (en) * 2018-08-22 2020-03-03 华为技术有限公司 Distributed parallel transmission method, device, equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170078869A1 (en) * 2014-03-05 2017-03-16 Nec Corporation Communication system
CN106303919A (en) * 2015-06-26 2017-01-04 三星电子株式会社 Use service providing method and the electronic equipment thereof of beacon
US20180198872A1 (en) * 2017-01-09 2018-07-12 Alibaba Group Holding Limited Method, system and device for providing service
CN107632896A (en) * 2017-10-20 2018-01-26 广东欧珀移动通信有限公司 A kind of data processing method, data processing equipment and communication apparatus
CN108833265A (en) * 2018-06-28 2018-11-16 腾讯科技(深圳)有限公司 Message treatment method, device, server and storage medium
CN111970102A (en) * 2020-08-31 2020-11-20 Oppo广东移动通信有限公司 Data processing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111970102A (en) 2020-11-20
CN111970102B (en) 2023-06-23

Similar Documents

Publication Publication Date Title
WO2022042140A1 (en) Data processing method and apparatus, electronic device, and storage medium
CN108701039B (en) Method and device for wirelessly updating software of vehicle
JP5747981B2 (en) System and method for remote maintenance of multiple clients in an electronic network using virtual machines
KR101507788B1 (en) Method for processing content and terminal thereof
CN112243002B (en) Data forwarding method, device, electronic equipment and computer readable medium
CN112788128B (en) Business information pushing method and device, storage medium and electronic device
US20030089675A1 (en) Authenticating resource requests in a computer system
WO2022142153A1 (en) Electricity meter upgrading method and system, smart meter, and storage medium
WO2003088556A1 (en) System and method for key distribution and network connectivity
US20140273973A1 (en) Method and system for replacing key deployed in se of mobile terminal
US20200351247A1 (en) Method and Apparatus for Trusted Service Management
CN101896917A (en) Method for moving rights object and method for managing rights of issuing rights object and system thereof
EP4087206A1 (en) Internet-of-things device registration method and apparatus, device and storage medium
CN111327680B (en) Authentication data synchronization method, device, system, computer equipment and storage medium
CN114915555B (en) Gateway drive communication method, device, equipment and storage medium
CN115022074A (en) User authentication and authorization method, device, medium and equipment
WO2022116015A1 (en) Data processing method and apparatus, electronic device, and storage medium
CN111459819B (en) Software testing method and device, electronic equipment and computer readable medium
CN114816785A (en) Service data processing method and device, electronic equipment and storage medium
CN109688204B (en) File downloading method, node and terminal based on NDN (named data networking)
CN111552907A (en) Message processing method, device, equipment and storage medium
CN113468579A (en) Data access method, device, equipment and storage medium
CN111240867A (en) Information communication system and method
CN111083665B (en) Method and equipment for double-master control interactive communication
CN114827918B (en) Short message sending method, device, electronic equipment and computer readable storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21859980

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21859980

Country of ref document: EP

Kind code of ref document: A1