CN110740045B - Instruction multicast method and system - Google Patents

Instruction multicast method and system Download PDF

Info

Publication number
CN110740045B
CN110740045B CN201911031976.4A CN201911031976A CN110740045B CN 110740045 B CN110740045 B CN 110740045B CN 201911031976 A CN201911031976 A CN 201911031976A CN 110740045 B CN110740045 B CN 110740045B
Authority
CN
China
Prior art keywords
instruction
sequence number
instruction sequence
executed
multicast
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911031976.4A
Other languages
Chinese (zh)
Other versions
CN110740045A (en
Inventor
杨宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Ant Chuangjiang Information Technology Co ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN201911031976.4A priority Critical patent/CN110740045B/en
Publication of CN110740045A publication Critical patent/CN110740045A/en
Application granted granted Critical
Publication of CN110740045B publication Critical patent/CN110740045B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/16Arrangements for providing special services to substations
    • H04L12/18Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the specification discloses a multicast method of an instruction and a system thereof. Wherein, this system includes: the system comprises a multicast source, a database, a multicast server and a subscription terminal. The multicast source stores a first instruction to be multicast into the database, the database generates a first instruction sequence number corresponding to the first instruction to be multicast, the first instruction sequence number is sent to the multicast server, and the multicast server sends the first instruction sequence number to at least one subscription terminal. After receiving the first instruction serial number sent by the multicast server, the subscription terminal compares the first instruction serial number received this time with the stored second instruction serial number, and acquires the instruction to be executed from the database according to the comparison result. Therefore, the instructions to be executed are stored in the database, and the subscription terminal actively acquires the instructions to be executed from the database according to the first instruction sequence number received this time and the stored second instruction sequence number, so that the reliability of the multicast system is improved.

Description

Instruction multicast method and system
[ technical field ] A method for producing a semiconductor device
The present disclosure relates to the field of data transmission technologies, and in particular, to a multicast method and system for an instruction.
[ background of the invention ]
Fig. 1 is a schematic structural diagram of a conventional multicast system for commands. As shown in fig. 1, multicast is a point-to-multipoint data transmission method, i.e. one data sender transmits the same data to multiple receivers. In general, a data sender is called a multicast source and a data receiver is called a subscriber terminal. When the multicast system is used for sending the instruction, the multicast source generates the instruction and then sends the instruction to be multicast to the multicast server, and the multicast server respectively sends the instruction to be multicast to the plurality of subscription terminals, so that one instruction sender can send the same instruction to a plurality of instruction receivers, and the plurality of instruction receivers can synchronously execute the instruction.
In the related art, when the multicast source sends a plurality of instructions in sequence, the sent instructions may be out of order and lost during the transmission process. The subscribing terminal can not verify whether the received multiple instructions are sequential and complete, and the multicast system is unreliable.
[ summary of the invention ]
The embodiments of the present specification aim to solve at least one of the technical problems in the related art to some extent.
Therefore, a first object of the embodiments of the present specification is to provide an instruction multicast method, which is executed at a subscriber terminal, so that the subscriber terminal actively obtains an instruction to be executed from a database according to a first instruction sequence number received this time and a stored second instruction sequence number, thereby improving reliability of a multicast system.
A second objective of the embodiments of the present specification is to provide a subscriber terminal.
A third object of the embodiments of the present specification is to provide an instruction multicast system.
A fourth object of embodiments of the present specification is to propose a non-transitory computer-readable storage medium.
To achieve the above object, a first aspect of the embodiments of this specification provides an instruction multicast method, including: receiving a first instruction sequence number sent by a multicast server; the first instruction sequence number corresponds to a first instruction stored in a database; comparing the received first instruction sequence number with a stored second instruction sequence number; wherein, the second instruction sequence number is the maximum sequence number in the executed instruction; if the first instruction sequence number is larger than the second instruction sequence number, determining an instruction sequence number corresponding to the instruction to be executed; the instruction sequence number corresponding to the instruction to be executed is greater than the second instruction sequence number and is less than or equal to the first instruction sequence number; and acquiring the instruction to be executed from the database according to the instruction sequence number corresponding to the instruction to be executed.
Compared with the prior art, the instruction to be executed is stored in the database, and the subscription terminal actively acquires the instruction to be executed from the database according to the first instruction sequence number received this time and the stored second instruction sequence number, so that the reliability of the multicast system is improved.
In addition, the multicast method of data according to the embodiment of the present specification further has the following additional technical features:
optionally, after the obtaining, according to the instruction sequence number corresponding to the instruction to be executed, the instruction to be executed from the database, the method further includes: and updating the second instruction sequence number to the first instruction sequence number.
Optionally, after the obtaining, according to the instruction sequence number corresponding to the instruction to be executed, the instruction to be executed from the database, the method further includes: and sequentially executing the instructions to be executed according to the instruction sequence numbers corresponding to the instructions to be executed.
Optionally, after comparing the first instruction sequence number received this time with the stored second instruction sequence number, the method further includes: and if the first instruction sequence number is less than or equal to the second instruction sequence number, discarding the first instruction sequence number.
In a second aspect of the embodiments of this specification, a subscription terminal is provided, including: the receiving module is used for receiving a first instruction serial number sent by the multicast server; the first instruction sequence number corresponds to a first instruction stored in a database; the comparison module is used for comparing the received first instruction serial number with a stored second instruction serial number; wherein, the second instruction sequence number is the maximum sequence number in the executed instruction; the determining module is used for determining the instruction sequence number corresponding to the instruction to be executed when the first instruction sequence number is greater than the second instruction sequence number; the instruction sequence number corresponding to the instruction to be executed is greater than the second instruction sequence number and is less than or equal to the first instruction sequence number; and the acquisition module is used for acquiring the instruction to be executed from the database according to the instruction sequence number corresponding to the instruction to be executed.
In addition, the subscription terminal in the embodiment of the present specification further has the following additional technical features:
optionally, the method further comprises: and the updating module is used for updating the second instruction sequence number into the first instruction sequence number.
Optionally, the method further comprises: and the execution module is used for sequentially executing the instructions to be executed according to the instruction sequence numbers corresponding to the instructions to be executed.
Optionally, the method further comprises: and the abandoning module is used for abandoning the first instruction sequence number when the first instruction sequence number is less than or equal to the second instruction sequence number.
In a third aspect of the embodiments of the present specification, an instruction multicast system is provided, including: the system comprises a multicast source, a database, a multicast server and a subscription terminal, wherein the multicast source is used for storing a first instruction to be multicast into the database; the database is used for generating a first instruction sequence number corresponding to the first instruction to be multicast and sending the first instruction sequence number to the multicast server; the multicast server is used for sending the first instruction sequence number to at least one subscription terminal; the subscription terminal is used for receiving the first instruction serial number sent by the multicast server; comparing the received first instruction sequence number with a stored second instruction sequence number; the second instruction sequence number is the maximum sequence number in the instructions executed by the subscription terminal; if the first instruction sequence number is larger than the second instruction sequence number, determining an instruction sequence number corresponding to the instruction to be executed; the instruction sequence number corresponding to the instruction to be executed is greater than the second instruction sequence number and is less than or equal to the first instruction sequence number; and acquiring the instruction to be executed from the database according to the instruction sequence number corresponding to the instruction to be executed.
A fourth aspect of the embodiments of the present specification proposes a non-transitory computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements a multicast method of instructions as described in the foregoing method embodiments.
Additional aspects and advantages of embodiments of the present description will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of embodiments of the present description.
[ description of the drawings ]
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
Fig. 1 is a schematic structural diagram of a conventional multicast system for data;
fig. 2 is a schematic structural diagram of an instruction multicast system according to an embodiment of the present disclosure;
fig. 3 is a flowchart illustrating a multicast method for an instruction according to an embodiment of the present disclosure;
fig. 4 is a flowchart illustrating another instruction multicast method according to an embodiment of the present disclosure;
fig. 5 is a flowchart of a multicast method according to another instruction provided in an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a subscribing terminal provided in an embodiment of the present specification;
fig. 7 is a schematic structural diagram of another subscription terminal provided in an embodiment of the present specification; and
fig. 8 is a schematic structural diagram of another subscription terminal proposed in the embodiment of the present specification.
[ detailed description ] embodiments
Reference will now be made in detail to embodiments of the present specification, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary and intended to be illustrative of the present specification embodiments and should not be construed as limiting the present specification embodiments.
The multicast method of data and the system thereof according to the embodiments of the present specification are described below with reference to the accompanying drawings.
Based on the above description of the prior art, it can be known that, in the related art, when a multicast source sends multiple instructions in sequence, the multiple instructions sent may be out of order and lost during transmission. The subscribing terminal can not verify whether the received multiple instructions are sequential and complete, and the multicast system is unreliable.
To solve this problem, an embodiment of this specification provides an instruction multicast system, where an instruction to be executed is stored in a database, and a subscriber terminal actively obtains the instruction to be executed from the database according to a first instruction sequence number received this time and a stored second instruction sequence number, so as to improve reliability of the multicast system.
Fig. 2 is a schematic structural diagram of an instruction multicast system according to an embodiment of the present disclosure. As shown in fig. 2, the system includes: the system comprises a multicast source, a database, a multicast server and a subscription terminal.
The multicast source is used for storing a first instruction to be multicast into the database.
The database is used for generating a first instruction sequence number corresponding to a first instruction to be multicast and sending the first instruction sequence number to the multicast server.
The multicast server is used for sending the first instruction sequence number to at least one subscription terminal.
The subscription terminal is used for receiving the first instruction serial number sent by the multicast server and comparing the received first instruction serial number with the stored second instruction serial number. And the second instruction sequence number is the maximum sequence number in the instructions executed by the subscriber terminal. And if the first instruction serial number is greater than the second instruction serial number, determining an instruction serial number corresponding to the instruction to be executed. And acquiring the instruction to be executed from the database according to the instruction sequence number corresponding to the instruction to be executed.
It should be noted that, in the operation process of the multicast system, the multicast source may perform multiple multicasts, and each time a multicast is performed, the multicast source stores the instruction to be multicast in the database.
It can be understood that, since the multicast source is continuously multicasting, the instruction to be multicast is continuously stored in the database. The database carries out self-increasing numbering on the stored instruction to be multicast each time, generates a corresponding instruction serial number, then sends the instruction serial number to the multicast server, and the multicast server sends the instruction serial number to at least one subscription terminal. For example, for a first stored instruction to be multicast, a corresponding instruction sequence number is generated to be 1; for the instruction to be multicast stored for the second time, generating a corresponding instruction serial number of 2; and generating a corresponding instruction serial number of 3 for the instruction to be multicast stored for the third time. And analogizing that the larger the numerical value of the instruction sequence number is, the later the time for storing the corresponding instruction into the database by the multicast source is.
It should be understood that, for the multicast system, the multicast source sequentially stores the plurality of instructions in the database, and the subscribing terminal should also sequentially obtain the instructions in the same order and execute the instructions sequentially, so as to prevent the instructions executed by the subscribing terminal from being out of order or missing. It can be understood that the size of the instruction sequence number reflects the order in which the multicast source generates the instructions, and the subscribing terminal can determine the order in which the instructions are acquired and executed through the instruction sequence number.
And executing the command every time the subscriber terminal acquires a new command from the database, wherein the command serial number corresponding to the executed command is increased along with the continuous execution of the command. It will be appreciated that the larger the instruction sequence number, the further back the instruction execution sequence.
If each instruction sequence number sent by the multicast server can be sequentially transmitted to the subscriber terminal from small to large, the subscriber terminal only needs to sequentially obtain the instruction to be executed corresponding to each instruction sequence number from the database according to the time sequence of receiving the instruction sequence numbers.
However, once the instruction sequence number sent by the multicast server has a problem during the transmission process, so that the instruction sequence number received by the subscriber terminal is out of order or lost, the subscriber terminal cannot directly obtain the instruction to be executed corresponding to each instruction sequence number from the database in sequence according to the time sequence of receiving the instruction sequence number, and needs to judge the received instruction sequence number and adopt different processing modes according to different situations.
For convenience of description, in the embodiments of the present specification, the instruction number received by the subscriber terminal this time is referred to as a first instruction number, and the maximum number in the executed instructions is referred to as a second instruction number. It should be noted that, since the subscribing terminal performs the same determination after receiving the instruction sequence number each time, it can be ensured that all executed instructions are executed in the order from small to large, that is, all instruction sequences smaller than the maximum sequence number in the executed instructions are executed on the subscribing terminal.
After receiving the first instruction sequence number sent by the multicast server, the subscriber terminal compares the first instruction sequence number received this time with the stored second instruction sequence number, and the comparison result has the following possible situations.
The first possible situation is that the first instruction sequence number is greater than the second instruction sequence number, and the difference between the first instruction sequence number and the second instruction sequence number is one, which indicates that the instruction sequence number received by the subscriber terminal this time is adjacent to the maximum sequence number in the executed instruction, and the multicast system is not out of order or missing.
For the possible situation, the instruction to be executed is the first instruction, the corresponding instruction sequence number is the first instruction sequence number, and the subscriber terminal only needs to obtain the first instruction from the database.
The second possible situation is that the first instruction sequence number is greater than the second instruction sequence number, and the difference between the first instruction sequence number and the second instruction sequence number is greater than one, which indicates that the instruction sequence number received by the subscriber terminal this time and the maximum sequence number in the executed instruction have an interval between numerical values, and the multicast system has disorder or omission.
Based on the foregoing description, it can be known that, each time the subscriber terminal receives the instruction sequence number sent by the multicast server, the subscriber terminal obtains the instruction to be executed from the database through the instruction sequence number, and stores the maximum sequence number in the executed instruction. That is to say, in order to avoid missing the received instruction, after receiving the first instruction sequence number, the subscriber terminal compares the stored second instruction sequence number with the first instruction sequence number, so as to determine whether the data received by the subscriber terminal has missing.
It can be understood that, because the database is implemented in a self-numbering mode when the instruction sequence numbers corresponding to the instructions are generated, the difference value of the instruction sequence numbers corresponding to two adjacent instructions is one. After receiving the first instruction sequence number, the subscription terminal compares the first instruction sequence number with the second instruction sequence number to determine the missing receiving times and the instruction sequence number corresponding to the missing instruction. The instruction sequence numbers corresponding to the instructions to be executed are a plurality of instruction sequence numbers which are larger than the second instruction sequence number and smaller than or equal to the first instruction sequence number, that is, the instruction sequence numbers corresponding to the missed instructions and the first instruction sequence number received this time. And then acquiring a plurality of instructions to be executed including the first instruction from the database according to the instruction sequence numbers corresponding to the instructions to be executed, and executing the instructions to be executed according to the instruction sequence numbers corresponding to the instructions to be executed in the descending order.
For example, the second command number stored in the subscriber terminal is 20, and the first command number received from the multicast server this time is 25. Therefore, the subscriber terminal can determine that the instruction number corresponding to the instruction in the current multicast is 25, and the instruction corresponding to the instruction numbers 21, 22, 23, and 24 is missing, that is, the subscriber terminal does not receive the instruction numbers 21, 22, 23, and 24 in the previous multicast. Therefore, the subscriber terminal needs to receive the data corresponding to the instruction serial number 25 from the database, and also needs to query and receive the instructions corresponding to the instruction serial numbers 21, 22, 23, and 24, where the instructions to be executed include the instructions corresponding to the instruction serial numbers 21, 22, 23, 24, and 25. That is, although the instruction to be multicast this time is the instruction corresponding to the instruction number 25, the subscriber terminal needs to query and receive the instructions corresponding to the instruction numbers 21, 22, 23, 24, and 25 from the server after receiving the instruction number 25. Therefore, the instructions corresponding to the missing instruction sequence numbers 21, 22, 23 and 24 can be acquired by the subscriber terminal.
It should be noted that, an interval occurs between the instruction sequence numbers received by the subscribing terminal, which may be caused by the multicast system omitting a certain instruction sequence number in the previous multicast process, or may be caused by the multicast system occurring out of order. For example, the multicast instruction sequence numbers 1, 2, and 3 of the multicast system are out of order, which results in that the instruction sequence numbers received by the subscribing terminal are 1, 3, and 2, and then when the subscribing terminal receives the instruction sequence number 3, it is considered that the instruction sequence number 2 is omitted, and the instructions corresponding to the instruction sequence numbers 2 and 3 are directly obtained from the server.
In the two possible situations, after the subscriber terminal acquires the instruction to be executed and finishes executing the instruction to be executed, the instruction executed by the subscriber terminal has increased, and the maximum sequence number in the executed instruction also needs to be updated, so that the second instruction sequence number stored in the subscriber terminal needs to be updated to the first instruction sequence number.
The third possible situation is that the first instruction sequence number is less than or equal to the second instruction sequence number, which indicates that the instruction corresponding to the instruction sequence number received by the subscriber terminal this time is an executed instruction, and the multicast system is out of order.
For such a situation, the subscriber terminal may directly discard the first command sequence number received this time.
Or, taking the example that the multicast command numbers 1, 2, and 3 of the multicast system are out of order, when the subscriber terminal obtains the commands corresponding to the command numbers 2 and 3 from the server and executes them, the second command number is updated to 3. The subscribing terminal receives the instruction sequence number 2 again, and then directly discards the instruction sequence number.
To sum up, the multicast system for data provided in the embodiment of the present specification includes: the system comprises a multicast source, a database, a multicast server and a subscription terminal. The multicast source stores a first instruction to be multicast into the database, the database generates a first instruction sequence number corresponding to the first instruction to be multicast, the first instruction sequence number is sent to the multicast server, and the multicast server sends the first instruction sequence number to at least one subscription terminal. After receiving the first instruction serial number sent by the multicast server, the subscription terminal compares the first instruction serial number received this time with the stored second instruction serial number. And if the first instruction serial number is greater than the second instruction serial number, determining an instruction serial number corresponding to the instruction to be executed. And the instruction sequence number corresponding to the instruction to be executed is greater than the second instruction sequence number and less than or equal to the first instruction sequence number. And acquiring the instruction to be executed from the database according to the instruction sequence number corresponding to the instruction to be executed. Therefore, the instructions to be executed are stored in the database, and the subscription terminal actively acquires the instructions to be executed from the database according to the first instruction sequence number received this time and the stored second instruction sequence number, so that the reliability of the multicast system is improved.
In order to implement the foregoing embodiment, an embodiment of the present specification further provides an instruction multicast method, where the method is executed at a subscriber terminal, and fig. 3 is a flowchart of the instruction multicast method provided in the embodiment of the present specification. As shown in fig. 3, the method includes:
step S101, receiving a first command number sent by a multicast server.
The first instruction sequence number corresponds to a first instruction stored in the database.
Based on the foregoing description of the multicast system with instructions, it can be known that, in the multicast method provided in this embodiment of the present description, the instruction to be multicast is first stored in the database by the multicast source, the database generates the first instruction sequence number corresponding to the first instruction to be multicast, and then the first instruction sequence number is sent to the multicast server.
And the multicast server sends the first instruction sequence number to at least one subscription terminal in the multicast system, so that the subscription terminal can acquire the instruction to be executed from the database according to the first instruction sequence number. The instruction to be executed at least comprises a first instruction to be multicast this time, and may also comprise a missed multicast instruction before.
Step S102, comparing the first instruction serial number received this time with the stored second instruction serial number.
The second instruction sequence number is the maximum sequence number in the executed instructions.
Based on the foregoing description of the multicast system of commands, it can be seen that the subscriber terminal records the maximum sequence number in the executed commands as the second command sequence number, stores the second command sequence number, and records the command sequence number received this time as the first command sequence number. According to the first instruction sequence number, the instruction to be multicast at this time can be obtained from the database, and the first instruction sequence number is compared with the second instruction sequence number, so that whether the missed multicast instruction exists before can be known, and the missed multicast instruction before can be obtained from the database.
Step S103, if the first instruction sequence number is greater than the second instruction sequence number, determining an instruction sequence number corresponding to the instruction to be executed.
The instruction sequence number corresponding to the instruction to be executed is greater than the second instruction sequence number and is less than or equal to the first instruction sequence number.
It should be noted that, in order to avoid disorder or omission of the multicast system, the subscribing terminal needs to compare the sizes of the first instruction sequence number and the second instruction sequence number.
Based on the foregoing description, it is known that the instruction sequence number corresponding to the instruction of the previous multicast is smaller than the instruction sequence number corresponding to the instruction of the subsequent multicast, and if the first instruction sequence number is smaller than or equal to the second instruction sequence number, it is described that the first instruction corresponding to the first instruction sequence number sent by the current multicast server is an instruction already executed by the subscriber terminal. That is, the subscriber terminal has already obtained the first instruction and all the instructions multicast before the first instruction, and does not need to obtain the corresponding instructions again from the database, and the first instruction sequence number is discarded.
When the first instruction serial number is greater than the second instruction serial number, it is described that the first instruction serial number sent by the multicast server this time is a new instruction serial number, and the subscriber terminal does not acquire a corresponding instruction and needs to acquire an instruction to be executed from the database.
At this time, the instruction sequence number corresponding to the instruction to be executed includes the first instruction sequence number, and may also include the instruction sequence numbers corresponding to the previously omitted multicast instructions.
And step S104, acquiring the instruction to be executed from the database according to the instruction sequence number corresponding to the instruction to be executed.
It can be understood that, when the instruction sequence number is a self-increment sequence number, if the numerical values of the first instruction sequence number and the second instruction sequence number are adjacent, it is indicated that there are no missing multicast instructions, and the instruction to be executed is the first instruction of this multicast. If the first instruction sequence number and the second instruction sequence number have an interval in the value, it is described that the multicast server has disorder or omission in the previous multicast process, and the instruction to be executed is the previous omitted multicast instruction and the first instruction of the current multicast.
Based on the foregoing description, it can be seen that in this embodiment of the present description, the subscriber terminal records the instruction sequence number received this time as the first instruction sequence number, and records the stored instruction sequence number received last time as the second instruction sequence number. Therefore, after the subscriber terminal obtains the instruction to be executed from the database, the whole multicast flow is completed, and the first instruction sequence number received this time can be used as a new second instruction sequence number. In the next multicast process, after receiving the new first instruction sequence number sent by the multicast server, comparing the new first instruction sequence number with the new first instruction sequence number.
In addition, when the number of the instructions to be executed is multiple, since an increasing manner is adopted when the database generates the instruction sequence numbers in the embodiment of the present specification, and the sequence of the instruction sequence numbers reflects the order of instruction generation and execution, after the multiple instructions to be executed are obtained from the database, the method further includes executing the instructions to be executed in sequence according to the instruction sequence numbers corresponding to the instructions to be executed.
Based on the foregoing description of the multicast system with instructions, it can be known that, although the subscriber terminal can only obtain the first instruction sequence number in the current multicast, the subscriber terminal can determine the instruction sequence number corresponding to the missed multicast instruction before according to the comparison result between the first instruction sequence number and the second instruction sequence number, and further obtain the missed multicast instruction before and the first instruction to be multicast this time from the database.
It should be noted that the foregoing explanation on the embodiment of the instruction multicast system is also applicable to the instruction multicast method in this embodiment, and details are not described here.
In summary, in the multicast method of the instruction provided in the embodiment of the present disclosure, the method is executed at the subscriber terminal, and receives the first instruction sequence number sent by the multicast server. The first instruction sequence number corresponds to a first instruction stored in the database. And comparing the received first instruction sequence number with the stored second instruction sequence number. The second instruction sequence number is the maximum sequence number in the executed instructions. And if the first instruction serial number is greater than the second instruction serial number, determining an instruction serial number corresponding to the instruction to be executed. The instruction sequence number corresponding to the instruction to be executed is greater than the second instruction sequence number and is less than or equal to the first instruction sequence number. And acquiring the instruction to be executed from the database according to the instruction sequence number corresponding to the instruction to be executed. Therefore, the instructions to be executed are stored in the database, and the subscription terminal actively acquires the instructions to be executed from the database according to the first instruction sequence number received this time and the stored second instruction sequence number, so that the reliability of the multicast system is improved.
Further, the multicast method of the instruction provided in the embodiment of the present specification may be used for upgrading an application program, that is, the multicast source is an application developer, the database is a storage system of the application upgrade instruction, after the application developer completes the application upgrade instruction, the application upgrade instruction is stored in the instruction storage system, and an application upgrade message is sent to each terminal that has installed the application program through the multicast server, where the terminal is a subscriber terminal in the multicast system. And the message of the application upgrade is the latest version number of the application.
And after receiving the latest version number of the application, the terminal compares the latest version number with the application version number on the current terminal. It should be noted that, in this embodiment of the present specification, the application version number corresponds to the application upgrade instruction, that is, one application upgrade instruction is used between two adjacent application version numbers to implement application upgrade, and each intermediate application upgrade instruction needs to be sequentially executed between two application version numbers with an interval to implement application upgrade.
In order to use the instructed multicast method for application program upgrade, an embodiment of the present specification provides another multicast method for data, which is executed by a subscriber terminal, and fig. 4 is a flowchart of the another multicast method for data provided by the embodiment of the present specification. As shown in fig. 4, the method is executed in a subscriber terminal, and the method includes:
step S201, receiving a first application version number sent by the multicast server.
The first application version number corresponds to a first application upgrading instruction stored in the storage system.
It can be understood that, when the multicast method of instructions provided in this embodiment is used for upgrading an application program, the first instruction sequence number is a first application version number, the second instruction sequence number is a second application version number, and the instruction to be executed is an application upgrade instruction to be executed.
It will be appreciated that the application upgrade instructions function to upgrade an application of a previous application version number to an application of a next application version number, and thus each application version number may correspond to an application upgrade instruction. In order to unify the correspondence relationship, the application upgrade instruction may correspond to an application version number of the application program obtained after the application upgrade instruction is executed.
Step S202, comparing the received first application version number with the stored second application version number.
And the second application version number is the maximum application version number in the executed application upgrading instruction.
Step S203, if the first application version number is greater than the second application version number, determining an application version number corresponding to the application upgrade instruction to be executed.
And the application version number corresponding to the application upgrading instruction to be executed is greater than the second application version number and is less than or equal to the first application version number.
And step S204, acquiring the application upgrading instruction to be executed from the storage system according to the application version number corresponding to the application upgrading instruction to be executed.
Step S205, sequentially execute the application upgrade instructions to be executed according to the application version numbers corresponding to the application upgrade instructions to be executed.
It can be understood that in the embodiment of the present specification, the application upgrade needs to be implemented between two corresponding adjacent application version numbers by the application upgrade instruction. Therefore, when the application program is upgraded, application upgrade instructions corresponding to adjacent version numbers need to be sequentially executed.
For example, the application version number sent by the multicast source is V1.2.5.3, that is, the latest application version number is V1.2.5.3, and the application version number stored on the subscribing terminal is V1.2.4.9. V1.2.4.9 and V1.2.5.3 are separated by three version numbers of V1.2.5.0, V1.2.5.1 and V1.2.5.2, that is, V1.2.4.9 → V1.2.5.0, V1.2.5.0 → V1.2.5.1 and V1.2.5.2 → V1.2.5.3, which need to be implemented sequentially. Therefore, after receiving the application version number V1.2.5.3, the subscriber terminal generates application version numbers V1.2.5.0, V1.2.5.1, and V1.2.5.3 corresponding to the application upgrade instruction to be executed according to the application version number V1.2.4.9, and acquires the application upgrade instruction to be executed from the storage system. And executing the application upgrading instructions corresponding to the application version numbers V1.2.5.0, V1.2.5.1 and V1.2.5.3 in the descending order, so that the application program on the subscriber terminal can be upgraded from the version V1.2.4.9 to the version V1.2.5.3.
Therefore, the multicast method of the instruction is used for application program upgrading.
In addition, based on the similar inventive concept, in order to enable the subscriber terminal to actively obtain the instruction to be executed from the server in time, instead of passively receiving the first instruction sequence number sent by the multicast server. An embodiment of the present specification further provides a multicast method according to another instruction, where the method is executed at a subscriber terminal, and fig. 5 is a flowchart of the multicast method according to another instruction provided in the embodiment of the present specification. As shown in fig. 5, the method includes:
step S301, periodically querying the database to obtain a third command serial number.
And the third instruction sequence number is the instruction sequence number with the largest value in the instructions stored into the database by the multicast source.
That is, the subscriber terminal queries the database at intervals, and checks the instruction sequence number corresponding to the instruction stored in the database most recently.
Step S302, comparing the third instruction sequence number with the second instruction sequence number.
Step S303, according to the comparison result, obtaining the instruction to be executed from the database.
And the subscription terminal can determine whether the subscription terminal has received the latest instruction to be executed according to the third instruction sequence number obtained by inquiry and the stored second instruction sequence number.
And if the third instruction serial number is greater than the second instruction serial number, generating an instruction serial number corresponding to the instruction to be executed, and acquiring the instruction to be executed from the database.
If the third instruction sequence number is equal to the second instruction sequence number, the third instruction sequence number is discarded.
It should be particularly noted that steps S301 to S303 provided in the present embodiment do not conflict with the method steps in the foregoing embodiments, and may be used in combination.
That is to say, while passively receiving the first instruction sequence number sent by the multicast server, the subscriber terminal may also actively query the database at regular time, and obtain the instruction to be executed in time.
Therefore, the timely updating of the instruction to be executed is realized, and even if the multicast server fails, the multicast system can still normally operate.
In order to implement the foregoing embodiment, the present specification further provides a subscription terminal. Fig. 6 is a schematic structural diagram of a subscribing terminal provided in an embodiment of this specification, and as shown in fig. 6, the subscribing terminal includes: the receiving module 410, the comparing module 420, the determining module 430 and the obtaining module 440.
A receiving module 410, configured to receive a first instruction sequence number sent by the multicast server.
The first instruction sequence number corresponds to a first instruction stored in the database.
The comparing module 420 is configured to compare the received first instruction sequence number with the stored second instruction sequence number.
The second instruction sequence number is the maximum sequence number in the executed instructions.
The determining module 430 is configured to determine an instruction sequence number corresponding to the instruction to be executed when the first instruction sequence number is greater than the second instruction sequence number.
The instruction sequence number corresponding to the instruction to be executed is greater than the second instruction sequence number and is less than or equal to the first instruction sequence number.
The obtaining module 440 is configured to obtain the instruction to be executed from the database according to the instruction sequence number corresponding to the instruction to be executed.
Further, in order to update the second instruction sequence number stored in the subscriber terminal, a possible implementation manner is that the subscriber terminal further includes: the updating module 450 is configured to update the second instruction sequence number to the first instruction sequence number.
Further, in order to enable the subscriber terminal to sequentially execute a plurality of instructions to be executed, a possible implementation manner is that the subscriber terminal further includes: the execution module 460 is configured to sequentially execute the instructions to be executed according to the instruction sequence numbers corresponding to the instructions to be executed.
Further, in order to avoid the subscriber terminal repeatedly executing the executed instruction, a possible implementation manner is that the subscriber terminal further includes: the discarding module 470 is configured to discard the first instruction sequence number when the first instruction sequence number is less than or equal to the second instruction sequence number.
It should be noted that the foregoing explanation on the embodiment of the multicast method according to the instruction is also applicable to the subscriber terminal according to the embodiment, and details are not described here again.
To sum up, the subscriber terminal provided in this description receives the first instruction sequence number sent by the multicast server when executing the multicast method of the instruction. The first instruction sequence number corresponds to a first instruction stored in the database. And comparing the received first instruction sequence number with the stored second instruction sequence number. The second instruction sequence number is the maximum sequence number in the executed instructions. And if the first instruction serial number is greater than the second instruction serial number, determining an instruction serial number corresponding to the instruction to be executed. The instruction sequence number corresponding to the instruction to be executed is greater than the second instruction sequence number and is less than or equal to the first instruction sequence number. And acquiring the instruction to be executed from the database according to the instruction sequence number corresponding to the instruction to be executed. Therefore, the instructions to be executed are stored in the database, and the subscription terminal actively acquires the instructions to be executed from the database according to the first instruction sequence number received this time and the stored second instruction sequence number, so that the reliability of the multicast system is improved.
In order to implement the foregoing embodiment, an embodiment of the present specification further provides another subscription terminal, and fig. 7 is a schematic structural diagram of another subscription terminal provided in the embodiment of the present specification. As shown in fig. 7, the subscribing terminal includes: the receiving module 510, the comparing module 520, the determining module 530, the obtaining module 540, and the executing module 550.
A receiving module 510, configured to receive the first application version number sent by the multicast server.
The first application version number corresponds to a first application upgrading instruction stored in the storage system.
The comparing module 520 is configured to compare the received first application version number with the stored second application version number.
And the second application version number is the maximum application version number in the executed application upgrading instruction.
The determining module 530 is configured to determine, when the first application version number is greater than the second application version number, an application version number corresponding to the application upgrade instruction to be executed.
And the application version number corresponding to the application upgrading instruction to be executed is greater than the second application version number and is less than or equal to the first application version number.
The obtaining module 540 is configured to obtain the application upgrade instruction to be executed from the storage system according to the application version number corresponding to the application upgrade instruction to be executed.
The execution module 550 is configured to sequentially execute the application upgrade instructions to be executed according to the application version numbers corresponding to the application upgrade instructions to be executed.
It should be noted that the foregoing explanation on the embodiment of the multicast method according to the instruction is also applicable to the subscriber terminal according to the embodiment, and details are not described here again.
Therefore, the multicast method of the instruction is used for application program upgrading.
In order to implement the foregoing embodiment, an embodiment of the present specification further provides another subscription terminal, and fig. 8 is a schematic structural diagram of the another subscription terminal provided in the embodiment of the present specification. As shown in fig. 8, the subscribing terminal includes: a query module 610, a comparison module 620, and an acquisition module 630.
And the query module 610 is configured to query the database regularly to obtain the third instruction sequence number.
And the third instruction sequence number is the instruction sequence number with the largest value in the instructions stored into the database by the multicast source.
And a comparing module 620, configured to compare the third instruction sequence number with the second instruction sequence number.
An obtaining module 630, configured to obtain, according to the comparison result, the instruction to be executed from the database.
It should be noted that the foregoing explanation on the embodiment of the multicast method according to the instruction is also applicable to the subscriber terminal according to the embodiment, and details are not described here again.
Therefore, the timely updating of the instructions to be executed is realized, and even if the multicast server fails, the multicast system can still normally operate.
In order to implement the foregoing embodiments, the present specification further provides a computer device, including a memory and a processor; the memory having stored thereon a computer program executable by the processor; a multicast method of instructions as described in the preceding method embodiments is performed when the processor runs the computer program.
To implement the above embodiments, embodiments also propose a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a multicast method of instructions as described in the aforementioned method embodiments.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the embodiments herein, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
In the embodiments of the present specification, unless otherwise specifically stated or limited, the terms "mounted," "connected," and "fixed" are to be construed broadly, e.g., as meaning fixedly connected, detachably connected, or integrally formed; can be mechanically or electrically connected; they may be directly connected or indirectly connected through intervening media, or they may be connected internally or in any other suitable relationship, unless expressly stated otherwise. Specific meanings of the above terms in the embodiments of the present specification can be understood by those of ordinary skill in the art according to specific situations.
In embodiments of the present specification, unless explicitly stated or limited otherwise, a first feature may be "on" or "under" a second feature in direct contact with the first and second features, or in indirect contact with the first and second features through intervening media. Also, a first feature "on," "over," and "above" a second feature may be directly or diagonally above the second feature, or may simply indicate that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature may be directly under or obliquely under the first feature, or may simply mean that the first feature is at a lesser elevation than the second feature.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of an embodiment of the specification. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (10)

1. An instruction multicast method, the method being performed at a subscribing terminal, the method comprising:
receiving a first instruction sequence number sent by a multicast server; the first instruction sequence number corresponds to a first instruction stored in a database;
comparing the received first instruction sequence number with a stored second instruction sequence number; wherein, the second instruction sequence number is the maximum sequence number in the executed instruction;
if the first instruction serial number is larger than the second instruction serial number, determining an instruction serial number corresponding to an instruction to be executed; the instruction sequence number corresponding to the instruction to be executed is greater than the second instruction sequence number and is less than or equal to the first instruction sequence number; and
and acquiring the instruction to be executed from the database according to the instruction sequence number corresponding to the instruction to be executed.
2. The method according to claim 1, wherein after the obtaining the instruction to be executed from the database according to the instruction sequence number corresponding to the instruction to be executed, the method further comprises:
and updating the second instruction sequence number to the first instruction sequence number.
3. The method as claimed in claim 1, wherein after the obtaining the instruction to be executed from the database according to the instruction sequence number corresponding to the instruction to be executed, the method further comprises:
and sequentially executing the instructions to be executed according to the instruction sequence numbers corresponding to the instructions to be executed.
4. The method according to any one of claims 1-3, wherein after comparing the first instruction sequence number received this time with the saved second instruction sequence number, further comprising:
and if the first instruction sequence number is less than or equal to the second instruction sequence number, discarding the first instruction sequence number.
5. A subscribing terminal, comprising:
the receiving module is used for receiving a first instruction serial number sent by the multicast server; the first instruction sequence number corresponds to a first instruction stored in a database;
the comparison module is used for comparing the received first instruction serial number with a stored second instruction serial number; wherein, the second instruction sequence number is the maximum sequence number in the executed instruction;
the determining module is used for determining an instruction sequence number corresponding to the instruction to be executed when the first instruction sequence number is greater than the second instruction sequence number; the instruction sequence number corresponding to the instruction to be executed is greater than the second instruction sequence number and is less than or equal to the first instruction sequence number; and
and the acquisition module is used for acquiring the instruction to be executed from the database according to the instruction sequence number corresponding to the instruction to be executed.
6. The subscribing terminal of claim 5, further comprising:
and the updating module is used for updating the second instruction sequence number into the first instruction sequence number.
7. The subscribing terminal of claim 5, further comprising:
and the execution module is used for sequentially executing the instructions to be executed according to the instruction sequence numbers corresponding to the instructions to be executed.
8. The subscribing terminal of any one of claims 5-7, further comprising:
and the abandoning module is used for abandoning the first instruction sequence number when the first instruction sequence number is less than or equal to the second instruction sequence number.
9. An ordered multicast system, comprising: a multicast source, a database, a multicast server, a subscriber terminal, wherein,
the multicast source is used for storing a first instruction to be multicast into the database;
the database is used for generating a first instruction sequence number corresponding to the first instruction to be multicast and sending the first instruction sequence number to the multicast server;
the multicast server is used for sending the first instruction sequence number to at least one subscription terminal; and
the subscription terminal is used for receiving the first instruction sequence number sent by the multicast server; comparing the received first instruction sequence number with a stored second instruction sequence number; the second instruction sequence number is the maximum sequence number in the instructions executed by the subscription terminal; if the first instruction serial number is larger than the second instruction serial number, determining an instruction serial number corresponding to an instruction to be executed; the instruction sequence number corresponding to the instruction to be executed is greater than the second instruction sequence number and is less than or equal to the first instruction sequence number; and acquiring the instruction to be executed from the database according to the instruction sequence number corresponding to the instruction to be executed.
10. A non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a multicast method of instructions according to any of claims 1-4.
CN201911031976.4A 2019-10-28 2019-10-28 Instruction multicast method and system Active CN110740045B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911031976.4A CN110740045B (en) 2019-10-28 2019-10-28 Instruction multicast method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911031976.4A CN110740045B (en) 2019-10-28 2019-10-28 Instruction multicast method and system

Publications (2)

Publication Number Publication Date
CN110740045A CN110740045A (en) 2020-01-31
CN110740045B true CN110740045B (en) 2021-04-16

Family

ID=69271757

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911031976.4A Active CN110740045B (en) 2019-10-28 2019-10-28 Instruction multicast method and system

Country Status (1)

Country Link
CN (1) CN110740045B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107733665A (en) * 2017-08-31 2018-02-23 成都市斯达鑫辉视讯科技有限公司 A kind of method of intelligent broadcast

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101483497B (en) * 2008-12-15 2011-08-03 华亚微电子(上海)有限公司 Data transmission system, receiving terminal and data packet recovery method thereof
CN102123036B (en) * 2011-01-06 2013-10-09 河南科技大学 Method for synchronously processing data in distributed application processing system
US20140297774A1 (en) * 2013-03-29 2014-10-02 Bala Sridhar Munupalle System for managing configuration updates in cluster of computational devices
CN105993147B (en) * 2014-07-23 2019-03-05 华为技术有限公司 A kind of terminal staging method and relevant device
CN108206989A (en) * 2016-12-16 2018-06-26 北京易方通达科技有限公司 A kind of multicast control instruction confirms feedback method
CN109586932B (en) * 2018-10-18 2021-03-19 招商证券股份有限公司 Multicast method and terminal equipment
CN109558092A (en) * 2018-12-17 2019-04-02 杭州普创电子有限公司 A kind of chip interior flash storage method and device
CN109714326A (en) * 2018-12-21 2019-05-03 北京明朝万达科技股份有限公司 A kind of application layer data sequence group packet method, apparatus, equipment and storage medium
CN110022534B (en) * 2019-03-28 2021-06-08 山东省计算中心(国家超级计算济南中心) Data transmission method and device based on multicast
CN110351122B (en) * 2019-06-17 2022-02-25 腾讯科技(深圳)有限公司 Disaster recovery method, device, system and electronic equipment

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107733665A (en) * 2017-08-31 2018-02-23 成都市斯达鑫辉视讯科技有限公司 A kind of method of intelligent broadcast

Also Published As

Publication number Publication date
CN110740045A (en) 2020-01-31

Similar Documents

Publication Publication Date Title
US20210176310A1 (en) Data synchronization method and system
CN111327402A (en) Method, device and system for retransmitting data
CN106571974B (en) Network distribution method and system of household appliance, household appliance and mobile terminal
CN109788027B (en) Data synchronization method, device, server and computer storage medium
CN110401843B (en) List data updating method, apparatus, device and medium in live broadcast platform
CN111343045A (en) Method and device for adjusting heartbeat frequency
EP3876500B1 (en) Subscription message processing method and apparatus, and computer device and storage medium
CN111159233A (en) Distributed caching method, system, computer device and storage medium
CN109753044A (en) Controller of battery management system upgrade method and device
WO2019185981A1 (en) Generating or obtaining an updated neural network
CN111459676B (en) Node resource management method, device and storage medium
CN110740045B (en) Instruction multicast method and system
CN111526185A (en) Data downloading method, device, system and storage medium
CN110798349B (en) Configuration distribution and receiving method, equipment and computer readable storage medium
CN111224756B (en) Method and device for determining data transmission abnormity, storage medium and electronic equipment
CN112328701A (en) Data synchronization method, terminal device and computer readable storage medium
CN111240698A (en) Model deployment method and device, storage medium and electronic equipment
CN115729961A (en) Data query method, device, equipment and computer readable storage medium
CN115220993A (en) Process monitoring method, device, vehicle and storage medium
KR20230029823A (en) Resource Guide Methods, Devices and Storage Media
CN113515056A (en) Function execution method and intelligent household appliance
US20070268057A1 (en) Methods and apparatus for applying changes to a group of objects
CN113419437A (en) Intelligent home data synchronization method and device based on MVVM (multifunction vehicle management model) framework and MQTT (message queuing time) protocol
WO2013000287A1 (en) Method and device for configuring cell parameters
CN113157709A (en) Distributed system node dynamic change method, device, equipment and storage medium

Legal Events

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

Effective date of registration: 20240226

Address after: Room 1408, No. 447 Nanquan North Road, Pudong New Area Free Trade Pilot Zone, Shanghai, 200120

Patentee after: Shanghai Ant Chuangjiang Information Technology Co.,Ltd.

Country or region after: China

Address before: 801-11, Section B, 8th floor, 556 Xixi Road, Xihu District, Hangzhou City, Zhejiang Province 310007

Patentee before: Alipay (Hangzhou) Information Technology Co.,Ltd.

Country or region before: China

TR01 Transfer of patent right