Program updating method and system based on UDP (User Datagram Protocol) broadcast and medium
By adopting UDP broadcasting based on the program update system, the file program update problem when the host computer and control card devices cannot be connected to the LAN is solved, and faster program update speed is achieved.
Patent Information
- Application Number
- CN202510006645.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-04-25
AI Technical Summary
In the prior art, when the host computer and the control card device cannot be connected to the local area network, it is impossible to send and update the file program, and the program update speed is slow.
The program update method based on UDP broadcast is adopted, and UDP broadcast information is sent to the lower computer through the upper computer, including the channel identification and program time point, and the lower computer executes the program update strategy based on this information.
It solves the problem of file program update when the upper computer and control card devices cannot be connected to the LAN, and provides update services through the lower computer to the server, which improves the program update speed.
Smart Images

Figure CN119893183A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a program updating method, system and medium based on UDP broadcast. Background Art
[0002] The current program update method is to establish a network connection between the host computer and the control card device, and then send the file program and the files that the program depends on to the control card device to update the program. This solution requires a point-to-point connection between the host computer and the control card device to send files. When the host computer and the control card device cannot be connected to the local area network, file program sending and updating cannot be achieved.
[0003] In addition, the program update scheme used in the prior art has the limitation of sending files at the network port limit. For example, for a 100M network, if sending to one device, theoretically 100M can be achieved, but if sending to two devices, then the speed allocated to each device is 50M. The more devices there are, the slower the speed allocated to each device. Summary of the invention
[0004] The main purpose of the present invention is to propose a program updating method, system and medium based on UDP broadcast, aiming to solve the problems in the prior art that file program sending and updating cannot be realized when the host computer and the control card device cannot be connected to the local area network, and the program updating speed is slow.
[0005] To achieve the above object, the present invention provides a program updating method based on UDP broadcast, the method comprising the following steps:
[0006] Step S100, sending UDP broadcast information to the slave computer through the upper computer, wherein the UDP broadcast information at least includes a channel identifier and a program time point;
[0007] Step S200: When the lower computer receives the UDP broadcast information, the lower computer executes the corresponding program update strategy according to the channel identifier and the program time point.
[0008] A further technical solution of the present invention is that the UDP broadcast information also includes a device type, a program file and a program md5, and the step of executing a corresponding program update strategy according to the channel identifier and the program time point in step S200 includes:
[0009] Step S210, determining by the lower computer whether the channel ID is a channel ID subscribed by the current device, and if so, executing step S220;
[0010] Step S220, determining whether the device type of the lower computer is the same as that of the upper computer, if not, discarding the UDP broadcast information, if yes, executing step S230;
[0011] Step S230, judging whether the program file is the latest program file according to the time of the current program in the lower machine service list and the program time point, and if so, executing step S240;
[0012] Step S240, determine whether the current program is the same as the program md5, if they are the same, modify the time mark, if they are different, update the program.
[0013] A further technical solution of the present invention is that the step of updating the program in step S240 includes:
[0014] Step S241, determining whether the program time is the latest or the same in the currently recorded service list, if not, discarding the UDP broadcast information, if yes, adding the currently broadcast device information to the service list;
[0015] Step S242, after adding to the service list, determine whether it is currently being updated. If not, connect to the IP address in the service list to update.
[0016] A further technical solution of the present invention is that the step of updating the IP connected to the service list in step S242 includes:
[0017] Step S2421, obtaining the latest program list file through the lower computer, parsing which files are currently needed according to the latest program list file, downloading files that do not exist in the current lower computer from the service device, and if the current service device does not have the corresponding file, skipping to download the next file;
[0018] Step S2422, after the file download is completed, the number of existing files is updated.
[0019] A further technical solution of the present invention is that after step S2422, the following steps are further included:
[0020] Step S300, after the lower computer has updated the number of files, it updates its own broadcast information and provides it to the next level of lower computer for updating.
[0021] A further technical solution of the present invention is that the UDP broadcast information also includes the maximum number of connections to the lower computer, and after step S300, the following is further included:
[0022] Step S400, after receiving the connection request from the next-level lower computer, the lower computer determines whether the current number of connections exceeds the maximum number of connections, and rejects the connection if it exceeds the maximum number of connections.
[0023] A further technical solution of the present invention is that after step S2422, the following steps are further included:
[0024] After the file is downloaded through the service list, the file path of the program list dependent file is reconstructed, and the md5 is judged to determine whether it is the same file, and the path is modified to the path of the current device where the file is stored.
[0025] To achieve the above object, the present invention further proposes a program update system based on UDP broadcast, the system comprising a memory, a processor, and a program update program based on UDP broadcast stored on the processor, the program update program based on UDP broadcast executing the following steps when the processor is running:
[0026] Sending UDP broadcast information to the lower computer through the upper computer, wherein the UDP broadcast information at least includes a channel identifier and a program time point;
[0027] When the lower computer receives the UDP broadcast information, the lower computer executes the corresponding program update strategy according to the channel identifier and the program time point.
[0028] A further technical solution of the present invention is that when the program update program based on UDP broadcast is executed by the processor, the following steps are further performed:
[0029] Determine, by the lower computer, whether the channel identifier is a channel identifier subscribed by the current device;
[0030] If yes, determine whether the device type of the lower computer is the same as that of the upper computer; if not, discard the UDP broadcast information;
[0031] If yes, judging whether the program file is the latest program file according to the time of the current program in the lower machine service list and the program time point;
[0032] If yes, determine whether the current program is the same as the program md5, if they are the same, modify the time mark, if they are different, update the program.
[0033] To achieve the above object, the present invention further proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a program update program based on UDP broadcast, and the program update program based on UDP broadcast executes the steps of the above method when executed by a processor.
[0034] The beneficial effects of the program updating method, system and medium based on UDP broadcast of the present invention are:
[0035] The present invention uses the above technical solution to send UDP broadcast information from the upper computer to the lower computer, and the UDP broadcast information at least includes a channel identifier and a program time point. When the lower computer receives the UDP broadcast information, the lower computer executes a corresponding program update strategy according to the channel identifier and the program time point, which effectively solves the problem in the prior art that when the upper computer and the control card device cannot be connected to the local area network, the file program cannot be sent and updated. In addition, after the lower computer itself is updated, the lower computer itself will be converted into a server (i.e., the upper computer) to provide program update services to other devices in the local area network, thereby solving the limitation of sending files at the network port limit and improving the program update speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.
[0037] Figure 1 It is a flowchart of a first embodiment of a program updating method based on UDP broadcasting of the present invention;
[0038] Figure 2 is a detailed flow chart of step S200;
[0039] Figure 3 is a detailed flow chart of step S240;
[0040] Figure 4 is a detailed flow chart of step S242;
[0041] Figure 5 It is a flow chart of a second embodiment of a program updating method based on UDP broadcasting of the present invention;
[0042] Figure 6 It is a schematic diagram of the overall flow of the program updating method based on UDP broadcasting of the present invention;
[0043] Figure 7 It is a system architecture diagram of a program updating system based on UDP broadcasting of the present invention.
[0044] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] The present invention proposes a program updating method based on UDP broadcasting. The present invention can be executed by a program updating system based on UDP broadcasting. The system can be implemented in the form of a combination of hardware and / or software. The system can be configured in an electronic device with data processing capabilities.
[0047] Please refer to Figure 1 The first embodiment of the program updating method based on UDP broadcast of the present invention comprises the following steps:
[0048] Step S100: Send UDP broadcast information to the subordinate computer through the upper computer, and the UDP broadcast information at least includes a channel identifier and a program time point.
[0049] In this embodiment, UDP broadcast information can be sent periodically by the upper computer. The UDP broadcast information at least includes channel identification information and program time point, wherein the channel identification information is set by the upper computer to the lower computer, and is used by the lower computer to determine whether the channel in the UDP broadcast information is a channel subscribed by the lower computer. If so, it is checked in combination with the program time point whether the latest program contained in the UDP broadcast information is newer than the lower computer itself.
[0050] Step S200: When the lower computer receives the UDP broadcast information, the lower computer executes the corresponding program update strategy according to the channel identifier and the program time point.
[0051] The lower computer stores the program list file and file list of the currently playing program. The program list file records information about the program, such as screen size, area location size, and what programs are in this area. It is necessary to add a current time point attribute to the program root attribute, such as the number of seconds from 2000.1.1 to now, to identify the latest program to be used.
[0052] The file list unit is the dependent file required by the program list. The file size, md5, file name, file path, etc. are recorded in the program list attributes.
[0053] In this embodiment, when the lower computer receives UDP broadcast information, it determines whether the channel in the UDP broadcast information is a channel subscribed by the lower computer. If so, it checks whether the latest program included in the UDP broadcast information is newer than the lower computer itself in combination with the program time point.
[0054] The beneficial effect of the program update method based on UDP broadcast in this embodiment is: based on the above technical solution, this embodiment sends UDP broadcast information to the lower computer through the upper computer, and the UDP broadcast information at least includes a channel identifier and a program time point. When the lower computer receives the UDP broadcast information, the lower computer executes the corresponding program update strategy according to the channel identifier and the program time point, which effectively solves the problem in the prior art that file program sending and updating cannot be achieved when the upper computer and the control card device cannot be connected to the local area network.
[0055] For further information, please refer to Figure 2 In this embodiment, the UDP broadcast information also includes the device type, program file and program md5. The step of executing the corresponding program update strategy according to the channel identifier and the program time point in step S200 includes:
[0056] Step S210, determining by the lower computer whether the channel ID is the channel ID subscribed by the current device, and if so, executing step S220.
[0057] Step S220, determine whether the device types of the lower computer and the upper computer are the same. If not, discard the UDP broadcast information. If so, execute step S230.
[0058] The purpose of this embodiment of judging whether the device types of the lower computer and the upper computer are the same is to avoid incompatibility between different device types.
[0059] Step S230, judging whether the program file is the latest program file according to the time of the current program and the program time point in the lower computer service list, if yes, executing step S240.
[0060] Step S240, determine whether the current program is the same as the program md5, if they are the same, modify the time mark, if they are different, update the program.
[0061] Please refer to Figure 3 , step S240 specifically includes:
[0062] Step S241, determine whether the program time is the latest or the same in the currently recorded service list. If not, discard the UDP broadcast information. If so, add the currently broadcast device information to the service list.
[0063] Step S242, after adding to the service list, determine whether it is currently being updated. If not, connect to the IP address in the service list to update.
[0064] Please refer to Figure 4 The step of updating the IP address connected to the service list in step S242 specifically includes:
[0065] Step S2421, obtain the latest program list file through the lower computer, parse which files are currently needed based on the latest program list file, download files that do not exist in the current lower computer from the service column device, and if the current service device does not have the corresponding file, skip to download the next file.
[0066] Step S2422, after the file download is completed, the number of existing files is updated.
[0067] based on Figures 1 to 4 The first embodiment shown in the figure proposes a second embodiment of the program updating method based on UDP broadcast of the present invention, as shown in the figure. Figure 5 and Figure 6 As shown, this embodiment and Figures 1 to 4 The difference from the first embodiment shown is that, in this embodiment, after step S2422, the following is further included:
[0068] Step S300, after the lower computer has updated the number of files, it updates its own broadcast information and provides it to the next level of lower computer for updating.
[0069] In this embodiment, the UDP broadcast information also includes the maximum number of connections to the lower computer, the current number of connections, the existing files in the current file list, and the total number of files. After step S300, the following is also included:
[0070] Step S400, after receiving the connection request from the next-level lower computer, the lower computer determines whether the current number of connections exceeds the maximum number of connections. If it exceeds the maximum number of connections, the connection is rejected, and the next-level lower computer is allowed to connect to other service devices.
[0071] It should be noted that in this embodiment, after the lower computer completes its own update, it will convert itself into a server (i.e., a host computer) to provide program update services to other devices in the local area network, thereby solving the limitation of sending files at the network port limit and improving the program update speed.
[0072] In this embodiment, after step S2422, the following steps are further included:
[0073] After downloading the file through the service list, reconstruct the file path of the program list dependent file, determine whether it is the same file by judging md5, and modify the path to the path of the current device storing the file. For example: get the program list of other devices, the path in FileName will be the path of the previous device. After the device downloads the file to itself, it can correct the path of the program to the path of its own storage file.
[0074] The program updating method based on UDP broadcast of the present invention is further described below.
[0075] In the program updating method based on UDP broadcast of the present invention, the program list is a text file in the format of md5.boo file, which records the files that the program depends on, and sends the md5 value to obtain the corresponding file from the service device through the required file list of the program list.
[0076] The details are as follows:
[0077] 1. Set the channel ID for the slave computer through the host computer to avoid isolating other devices that do not want to be updated.
[0078] 2. If the channel ID is set, the host Udp will broadcast the program ID information at intervals. The information is as follows:
[0079]
[0080] Program: md5 of the program
[0081] Channel: Channel ID
[0082] connectNum: Current number of connections
[0083] connectMax: The maximum number of connections allowed
[0084] programTime: program time, which is the number of seconds from 0:0:0:0 on January 1, 2000 to now
[0085] fileNum: The total number of files required for this program
[0086] fileExist: The number of files that exist on the current device
[0087] deviceType: device type, used to avoid synchronizing programs with incompatible devices.
[0088] 3. After downloading other files through the service list, you need to reconstruct the file path of the program list dependent file, determine whether it is the same file by judging md5, and modify the path to the path of the current device storing this file. For example: get the program list of other devices, the path in FileName will be the path of the previous device. After the device downloads the file to itself, it can correct the path of the program to the path of its own storage file.
[0089] In summary, the program updating method based on UDP broadcast of the present invention uses the above technical solution to send UDP broadcast information to the lower computer through the upper computer, and the UDP broadcast information at least includes a channel identifier and a program time point. When the lower computer receives the UDP broadcast information, the lower computer executes the corresponding program update strategy according to the channel identifier and the program time point, which effectively solves the problem in the prior art that the file program cannot be sent and updated when the upper computer and the control card device cannot be connected to the local area network. In addition, after the lower computer itself is updated, the lower computer itself will be converted into a server (i.e., the upper computer) to provide program update services to other devices in the local area network, thereby solving the limitation of sending files at the network port limit and improving the program update speed.
[0090] To achieve the above object, the present invention also proposes a program updating system based on UDP broadcasting, such as Figure 7 As shown, the system includes a processor 1001, a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002, and a program update program based on UDP broadcast stored on the processor, wherein the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001. When the processor 1001 is called, the steps of the program update method based on UDP broadcast described in the above embodiment are executed, which will not be repeated here.
[0091] Those skilled in the art will understand that Figure 7 The system structure shown in the figure does not constitute a limitation of the system, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0092] like Figure 7 As shown, the memory 1005 as a computer storage medium may include an operating device, a network communication module, a user interface module, and a program update program based on UDP broadcasting.
[0093] exist Figure 7In the system shown, the network interface 1004 is mainly used to connect to the network server and communicate data with the network server; the user interface 1003 is mainly used to interact with the user terminal and receive instructions input by the user; and the processor 1001 can be used to call the UDP broadcast-based program update program stored in the memory 1005.
[0094] To achieve the above objectives, the present invention also proposes a computer-readable storage medium, which stores a program update program based on UDP broadcast. When the program update program based on UDP broadcast is executed by a processor, the steps of the method described above are executed, which will not be repeated here.
[0095] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. All equivalent structural changes made by using the contents of the present invention specification and drawings under the concept of the present invention, or directly / indirectly applied in other related technical fields are included in the patent protection scope of the present invention.
Claims
1. A program updating method based on UDP broadcast, characterized in that: The method comprises the following steps: Step S100, sending UDP broadcast information to the slave computer through the upper computer, wherein the UDP broadcast information at least includes a channel identifier and a program time point; Step S200: When the lower computer receives the UDP broadcast information, the lower computer executes the corresponding program update strategy according to the channel identifier and the program time point.
2. The program updating method based on UDP broadcast according to claim 1, characterized in that: The UDP broadcast information also includes a device type, a program file, and a program md5. The step of executing a corresponding program update strategy according to the channel identifier and the program time point in step S200 includes: Step S210, determining by the lower computer whether the channel ID is a channel ID subscribed by the current device, and if so, executing step S220; Step S220, determining whether the device type of the lower computer is the same as that of the upper computer, if not, discarding the UDP broadcast information, if yes, executing step S230; Step S230, judging whether the program file is the latest program file according to the time of the current program in the lower machine service list and the program time point, and if so, executing step S240; Step S240, determine whether the current program is the same as the program md5, if they are the same, modify the time mark, if they are different, update the program.
3. The program updating method based on UDP broadcast according to claim 2, characterized in that: The step of updating the program in step S240 includes: Step S241, determining whether the program time is the latest or the same in the currently recorded service list, if not, discarding the UDP broadcast information, if yes, adding the currently broadcast device information to the service list; Step S242, after adding to the service list, determine whether it is currently being updated. If not, connect to the IP address in the service list to update.
4. The program updating method based on UDP broadcast according to claim 3, characterized in that: The step of connecting to the IP of the service list to update in step S242 includes: Step S2421, obtaining the latest program list file through the lower computer, parsing which files are currently needed according to the latest program list file, downloading files that do not exist in the current lower computer from the service device, and if the current service device does not have the corresponding file, skipping to download the next file; Step S2422, after the file download is completed, the number of existing files is updated.
5. The program updating method based on UDP broadcast according to claim 4, characterized in that: After step S2422, the following steps are also included: Step S300, after the lower computer has updated the number of files, it updates its own broadcast information and provides it to the next level of lower computer for updating.
6. The program updating method based on UDP broadcast according to claim 5, characterized in that: The UDP broadcast information also includes the maximum number of connections to the lower computer, and after step S300, the following steps are further included: Step S400, after receiving the connection request from the next-level lower computer, the lower computer determines whether the current number of connections exceeds the maximum number of connections, and rejects the connection if it exceeds the maximum number of connections.
7. The program updating method based on UDP broadcast according to claim 6, characterized in that: After step S2422, the following steps are also included: After the file is downloaded through the service list, the file path of the program list dependent file is reconstructed, and the md5 is judged to determine whether it is the same file, and the path is modified to the path of the current device where the file is stored.
8. A program update system based on UDP broadcast, characterized in that: The system includes a memory, a processor, and a UDP broadcast-based program update program stored on the processor. When the UDP broadcast-based program update program is run by the processor, the following steps are performed: Sending UDP broadcast information to the lower computer through the upper computer, wherein the UDP broadcast information at least includes a channel identifier and a program time point; When the lower computer receives the UDP broadcast information, the lower computer executes the corresponding program update strategy according to the channel identifier and the program time point.
9. The program updating system based on UDP broadcasting according to claim 8, characterized in that: When the program update program based on UDP broadcast is executed by the processor, the following steps are further performed: Determine, by the lower computer, whether the channel identifier is a channel identifier subscribed by the current device; If yes, determine whether the device type of the lower computer is the same as that of the upper computer; if not, discard the UDP broadcast information; If yes, judging whether the program file is the latest program file according to the time of the current program in the lower machine service list and the program time point; If yes, determine whether the current program is the same as the program md5, if they are the same, modify the time mark, if they are different, update the program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program update program based on UDP broadcast, and the program update program based on UDP broadcast executes the steps of the method according to any one of claims 1 to 7 when executed by a processor.