Resource deployment method and device of embedded device, equipment and medium

Through the method of automatic ARP scanning and resource package version comparison, the full process automation resource deployment of embedded devices is realized, solving the problems of low resource deployment efficiency and insufficient stability in the existing technology, and improving deployment efficiency and stability.

CN120010864APending Publication Date: 2025-05-16GUANGZHOU HAIGE COMMUNICATION GROUP INCORPORATED COMPANY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311535795.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-16
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

In the resource deployment of embedded devices, the existing technology has problems such as low applicability of the automatic networking upgrade method, high cost of system mirroring upgrade method and inapplicable system stability due to small module iterative verification, patch upgrade method, and high technical thresholds, complex processes and low efficiency in manual deployment.

Method used

Through automatic ARP scanning, determine the embedded devices to be deployed in the LAN, read the resource configuration file of the device, compare the resource package version with the production server version, and if it is inconsistent, obtain the updated resource package from the production server and send it to the resource deployment server for deployment.

Benefits of technology

It realizes the full process automated resource deployment of embedded devices, improves the efficiency of resource deployment, simplifies the process, and lowers the technical threshold.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120010864A_ABST
    Figure CN120010864A_ABST
Patent Text Reader

Abstract

The invention provides a resource deployment method and device of embedded equipment, equipment and a medium, and belongs to the technical field of embedding, and the method comprises the steps: determining to-be-deployed embedded equipment in a preset network segment corresponding to a local area network; reading a resource configuration file of the embedded device to be deployed; the resource configuration file is used for representing a resource package version of the to-be-deployed embedded device; when the resource package version of the to-be-deployed embedded device is different from the resource package version stored in a production server, obtaining an updated resource package from the production server; and issuing the updated resource packet to a resource deployment server, so that the resource deployment server performs resource deployment on the to-be-deployed embedded device based on the updated resource packet. According to the resource deployment method of the embedded device, full-process automatic resource deployment of the embedded device is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of embedded technology, and in particular to a resource deployment method, device, equipment and medium for embedded devices. Background Art

[0002] After installing the Linux system image, the embedded device needs to complete function deployment or authorization according to the scenario requirements. All subsequent installation, deployment, and authorization operations are collectively referred to as resource deployment.

[0003] Existing technologies include automatic network upgrade method, system image upgrade method, patch upgrade method, etc. However, the automatic network upgrade method requires Internet connection, has low applicability and is not suitable for small batch customized systems; the system image upgrade method has a long production cycle, high cost and is not suitable for iterative verification of small modules; the patch upgrade method has the problem of too many accumulated patches leading to insufficient system stability. Manual resource deployment has the problems of high technical threshold, complex process and low efficiency.

[0004] How to improve the efficient and stable resource deployment of embedded devices is an important issue that needs to be urgently addressed in the industry. Summary of the invention

[0005] In view of the problems existing in the prior art, the present invention provides a resource deployment method, device, equipment and medium for an embedded device.

[0006] The present invention provides a resource deployment method for an embedded device, comprising:

[0007] Determine the embedded devices to be deployed within the preset network segment corresponding to the local area network;

[0008] Reading a resource configuration file of the embedded device to be deployed; the resource configuration file is used to represent a resource package version of the embedded device to be deployed;

[0009] When the resource package version of the embedded device to be deployed is different from the resource package version stored in the production server, obtaining an updated resource package from the production server;

[0010] The update resource package is sent to a resource deployment server, so that the resource deployment server performs resource deployment on the embedded device to be deployed based on the update resource package.

[0011] According to a resource deployment method for an embedded device provided by the present invention, the step of determining an embedded device to be deployed within a preset network segment corresponding to a local area network includes:

[0012] Performing an ARP scanning operation in the preset network segment to obtain response information of at least one embedded device; the response information is used to represent the MAC address of each embedded device; the local area network includes at least one embedded device;

[0013] Based on the comparison result of the response information of each embedded device and the storage information in the preset database, the embedded devices to be deployed in the preset network segment corresponding to the local area network are determined.

[0014] According to a method for resource deployment of an embedded device provided by the present invention, after determining the embedded device to be deployed in a preset network segment, the method further includes:

[0015] Based on the SSH service, establish a link with the embedded device to be deployed;

[0016] Based on the link, obtaining device information of the embedded device to be deployed;

[0017] Based on the device information, the preset database is updated.

[0018] According to a resource deployment method for an embedded device provided by the present invention, the method further includes:

[0019] In an interval time period, comparing the resource package version of the production server with the resource package version of the publishing server;

[0020] In the case that the resource bundle version of the production server is different from the resource bundle version of the publishing server, the resource bundle version of the production server is updated based on the resource bundle version of the publishing server.

[0021] According to a resource deployment method for an embedded device provided by the present invention, the updating resource package is sent to a resource deployment server so that the resource deployment server performs resource deployment on the embedded device to be deployed based on the updating resource package, including:

[0022] Based on the resource package, obtaining an authorization response issued by the production server; the authorization response is used to instruct the resource deployment server to download the installation configuration script corresponding to the update resource package;

[0023] Based on the installation configuration script, obtaining the installation program package corresponding to the update resource package;

[0024] Based on the installation program package, resources are deployed to the embedded device to be deployed.

[0025] According to a resource deployment method for an embedded device provided by the present invention, the method comprises:

[0026] Receive the installation progress and resource deployment execution result returned by the embedded device to be deployed.

[0027] The present invention also provides a resource deployment device for an embedded device, comprising:

[0028] A determination module, used to determine the embedded device to be deployed within a preset network segment corresponding to the local area network;

[0029] A reading module, used for reading a resource configuration file of the embedded device to be deployed; the resource configuration file is used for representing a resource package version of the embedded device to be deployed;

[0030] An acquisition module, configured to acquire an updated resource package from the production server when the resource package version of the embedded device to be deployed is different from the resource package version stored in the production server;

[0031] The deployment module is used to send the update resource package to the resource deployment server, so that the resource deployment server performs resource deployment on the embedded device to be deployed based on the update resource package.

[0032] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a resource deployment method for an embedded device as described in any one of the above is implemented.

[0033] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the resource deployment method for an embedded device as described in any one of the above is implemented.

[0034] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the resource deployment method for an embedded device as described in any one of the above is implemented.

[0035] The resource deployment method, device, equipment and medium for embedded devices provided by the present invention determine the embedded devices to be deployed within the preset network segment corresponding to the local area network, then read the resource configuration file of the embedded devices to be deployed for characterizing the resource package version of the embedded devices to be deployed, compare the resource package version of the embedded devices to be deployed with the resource package version stored in the production server, and when the resource package versions of the two are different, obtain an updated resource package from the production server, and send the updated resource package to the resource deployment server, so that the resource deployment server can perform resource deployment on the embedded devices to be deployed based on the updated resource package. The resource deployment method for embedded devices of the present invention realizes the full-process automated resource deployment of embedded devices, and improves the efficiency of resource deployment of embedded devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0037] Figure 1 This is one of the flow diagrams of the resource deployment method for an embedded device provided by the present invention;

[0038] Figure 2 This is the second flow chart of the resource deployment method for an embedded device provided by the present invention;

[0039] Figure 3 This is the third flow chart of the resource deployment method for an embedded device provided by the present invention;

[0040] Figure 4 This is a fourth flow chart of the resource deployment method for an embedded device provided by the present invention;

[0041] Figure 5 It is a structural schematic diagram of a resource deployment device for an embedded device provided by the present invention;

[0042] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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.

[0044] Combine the following Figure 1-Figure 4 The invention describes the resource deployment method, device, equipment and medium of the embedded device.

[0045] Before the following method is carried out, it should be clarified that the resource deployment method for embedded devices provided by the present invention refers to the interaction between the master server, which can be regarded as the management-side PC, and multiple embedded devices. In the embodiment of the present invention, the management-side PC is called the master server, and the embedded device is called a slave server.

[0046] Figure 1 This is one of the flow charts of the resource deployment method for embedded devices provided by the present invention, such as Figure 1 As shown, the resource deployment method of the embedded device provided by the embodiment of the present invention includes the following steps:

[0047] Step 101, determining the embedded device to be deployed in the preset network segment corresponding to the local area network;

[0048] Specifically, the premise of this step is that all embedded devices need to be connected to the local area network where the main control server is located before data transmission and subsequent use.

[0049] Here is an example, the IP of the management PC, that is, the main control server is 192.168.0.88, the router is configured, and the Dynamic Host Configuration Protocol (DHCP) allocation pool is: 192.168.0.100-192.168.0.200. Then all embedded devices need to be connected to the above-configured router through a network cable, and the automatic resource deployment service is started on the management PC. Then determine which embedded devices in the network segment corresponding to the local area network are new devices, that is, embedded devices to be deployed. The specific implementation is to first scan through the timed Address Resolution Protocol (ARP), that is, perform ARP scanning at a fixed time interval. The time interval can be 5s or 10s, which is not specifically limited here.

[0050] ARP is a TCP / IP protocol that obtains a physical address based on an IP address. The host is the master control server in the embodiment of the present invention. When sending information, it broadcasts an ARP request containing the target IP address to all hosts on the local area network. In the embodiment of the present invention, the host on the local area network is all embedded devices connected to the local area network, and then receives the return message of each embedded device to determine the physical address of the target. The address resolution protocol is based on the mutual trust of each host in the network. The host on the local area network can send an ARP reply message autonomously. When other hosts receive the reply message, they will not detect the authenticity of the message and will record it in the local ARP cache. According to the IP address of each embedded device, the local area network (Media Access Control Address, MAC) address returned by each embedded device is obtained, and then the MAC address stored in the database before the obtained MAC address is compared. Then, the new device and the known device in the local area network can be distinguished based on the MAC address. The new device is the embedded device to be deployed in the embodiment of the present invention. Further, these embedded devices to be deployed are automatically connected through the secure shell protocol (Secure Shell, SSH). If the embedded devices to be deployed can be successfully connected, the subsequent steps are carried out. It should also be noted that when using SSH connection, you need to obtain the IP address of the embedded device in advance. Embedded devices can be divided into devices with interface and devices without interface according to the human-computer interaction mode. For devices with interface interaction, the IP address of the device can be obtained through manual operation.

[0051] Step 102: read the resource configuration file of the embedded device to be deployed; the resource configuration file is used to represent the resource package version of the embedded device to be deployed;

[0052] Specifically, in this step, after connecting to the embedded device to be deployed via SSH, the device to be deployed itself will store a resource configuration file, which is used to characterize the resource package version of the current embedded device to be deployed. By reading the resource configuration file of the embedded device to be deployed, you can obtain the version information and resource version information of the current embedded device to be configured, that is, the resource package version. It should also be noted that in the initial state, the embedded device has no resource configuration file, and the resource deployment server needs to install basic resources before subsequent resource deployment can be performed. That is, when the embedded device cannot read the resource configuration file, it can be determined that the embedded device is a new device and requires full resource deployment.

[0053] Step 103: when the resource package version of the embedded device to be deployed is different from the resource package version stored in the production server, obtaining an updated resource package from the production server;

[0054] Specifically, in this step, the concept of a production server is introduced. The latest resource package is stored in the production server. It is necessary to compare the resource configuration file read from the embedded device to be deployed, that is, the resource package version of the embedded device to be deployed and the latest resource package version in the production server. When the two resource package versions are different, it means that there are parts of the embedded device to be deployed that need to be updated. The updated part can be regarded as a patch. By comparing the resource package version stored in the production server with the resource package version of the embedded device to be deployed, the resources that need to be upgraded, that is, the difference between the two resource packages, can be determined, and then the updated resource package can be obtained from the production server.

[0055] Specifically, the specific implementation method of obtaining the update resource package from the production server can be obtained through Hypertext Transfer Protocol (HTTP), which can achieve concurrent downloading of multiple resources and ensure the speed of resource downloading when the resource file is large.

[0056] Furthermore, through the HTTP protocol, service request interaction can also be performed between the resource deployment server and the production server for qualification authorization or time synchronization, which is not specifically limited here.

[0057] Step 104: Send the updated resource package to a resource deployment server, so that the resource deployment server performs resource deployment on the embedded device to be deployed based on the updated resource package.

[0058] Specifically, in this step, the update resource package obtained through the above steps is sent to the resource deployment server, so that the resource deployment server can perform resource deployment on the embedded device to be deployed based on the update resource package. The specific resource deployment method is described below. It should be noted that resource deployment can be subdivided into the following types: system vulnerability driver deployment, that is, system risk vulnerabilities, hardware drivers, etc.; system configuration installation, system key configuration, such as sound strategy, battery strategy, screen strategy, disk; system authorization, including system genuine authorization, time synchronization, hardware authorization, etc., application deployment and installation, that is, application programs, auxiliary programs, monitoring programs, and application authorization, including core program authorization. In view of security requirements, embedded devices are usually required to obtain authorization certificates after accessing the production server.

[0059] The resource deployment method for embedded devices provided by the embodiment of the present invention discovers all embedded devices in the local area network through automatic ARP scanning, obtains the MAC addresses of all embedded devices, sequentially determines the embedded devices to be deployed in the preset network segment corresponding to the local area network, and then establishes links with these embedded devices to be deployed through SSH, and then reads the resource configuration file of the embedded device to be deployed for characterizing the resource package version of the embedded device to be deployed, compares the resource package version of the embedded device to be deployed with the resource package version stored in the production server, and when the resource package versions of the two are different, obtains an updated resource package from the production server, and sends the updated resource package to the resource deployment server, so that the resource deployment server can perform resource deployment on the embedded device to be deployed based on the updated resource package. The resource deployment method for embedded devices of the present invention realizes the full-process automated resource deployment of embedded devices and improves the efficiency of resource deployment of embedded devices.

[0060] Optionally, according to a resource deployment method for an embedded device provided by an embodiment of the present invention, the above step 101 specifically includes the following steps: Figure 2 This is a second flow chart of the method for resource deployment of embedded devices provided by the present invention. The specific steps of determining the embedded devices to be deployed in the preset network segment corresponding to the local area network in the embodiment of the present invention are as follows:

[0061] Step 1011, performing an ARP scanning operation in the preset network segment to obtain response information of at least one embedded device; the response information is used to represent the MAC address of each embedded device; the local area network includes at least one embedded device;

[0062] Specifically, in this step, the local area network includes multiple embedded devices, including existing embedded devices known to the management end PC, and also newly connected embedded devices. The embodiment of the present invention mainly performs resource configuration for these newly connected embedded devices. Through this step, it can be determined which embedded devices in the local area network are newly connected embedded devices, that is, embedded devices to be deployed in the embodiment of the present invention. In the preset network segment corresponding to the local area network, at a fixed interval, for example, every 5s or 10s, the ARP scanning operation is automatically performed. During each scan, all embedded devices in the local area network will return response information to the management end PC, and the response information returned by each embedded device includes the MAC address of each embedded device in the local area network.

[0063] Step 1012: Determine the embedded devices to be deployed in the preset network segment corresponding to the local area network based on the comparison result of the response information of each embedded device and the storage information in the preset database;

[0064] In this step, a preset database is set in the management PC, and the storage information of the preset database is the MAC address of the embedded device already in the LAN. After each ARP automatic scan, the management PC will receive response information returned by all connected embedded devices in the LAN, and the response information includes the MAC address of each embedded device. Then, the received multiple MAC addresses are compared with the MAC addresses of the existing embedded devices stored in the preset database to obtain a comparison result. If the received MAC address has been stored in the preset database, it means that the embedded device corresponding to the MAC address is an embedded device already in the LAN; if the received MAC address has no comparison result in the preset database, it means that the MAC address is a new MAC address, and the corresponding embedded device is also a new embedded device connected to the LAN.

[0065] The resource deployment method for embedded devices of the embodiment of the present invention discovers all embedded devices in the local area network through automatic ARP scanning, obtains the MAC addresses of all embedded devices, sequentially determines the embedded devices to be deployed in the preset network segment corresponding to the local area network, and then establishes links with these embedded devices to be deployed through SSH for subsequent information transmission. The user only needs to connect the embedded device to the specified network, and can quickly query the current resource deployment status and results through the management end PC, that is, the main control server. The resource deployment method for embedded devices of the present invention realizes the full process automated resource deployment of embedded devices, and improves the efficiency of embedded device resource deployment.

[0066] According to a resource deployment method for an embedded device provided by an embodiment of the present invention, after the above step 101, Figure 3 This is the third flow chart of the resource deployment method of the embedded device provided by the present invention, that is, after determining the embedded device to be deployed in the preset network segment corresponding to the local area network, it also includes the following steps:

[0067] 1013. Establish a link with the embedded device to be deployed based on the SSH service;

[0068] Specifically, based on the above steps 1011 and 1012, it can be determined which embedded devices in the local area network are newly connected embedded devices in the local area network, that is, embedded devices to be deployed in the embodiment of the present invention; then, it is necessary to establish connections with these embedded devices to be deployed. In the specific implementation of the embodiment of the invention, there may be a situation where the new embedded device cannot be connected, so it is necessary to first establish a link with the embedded device to be deployed based on the SSH service.

[0069] It should be noted that there are generally two ways to link with embedded devices. One is serial port link. Serial port tool is a software used to debug and test serial port devices. However, the communication efficiency of serial port link is too slow and is only suitable for auxiliary monitoring work. In the embodiment of the present invention, SSH service is used to establish a link with the embedded device to be deployed. After the SSH remote link, the remote machine can be operated like a local machine, and the communication efficiency is high, which is suitable for the application scenario of the embodiment of the present invention.

[0070] 1014. Based on the link, obtain device information of the embedded device to be deployed;

[0071] Specifically, in this step, after the management PC establishes a link with the embedded device to be deployed based on the SSH service, the device information of the embedded device to be deployed can be read through the home directory. The device information may include relevant basic information of the embedded device to be deployed, such as the model of the embedded device, the name of the embedded device, and the MAC address of the embedded device to be deployed mentioned above.

[0072] 1015. Update the preset database based on the device information.

[0073] Specifically, in this step, after obtaining the device information of the embedded device to be deployed based on the above steps, the device information is stored in the preset database, that is, the preset database is updated. Before the next ARP automatic scan, the preset database has been updated and the device information of the embedded device to be deployed has been stored. Then, after the next ARP scan, a new round of comparison can be performed to discover new embedded devices to be deployed.

[0074] The resource deployment method for embedded devices provided by the embodiment of the present invention discovers all embedded devices in the local area network through automatic ARP scanning, obtains the MAC addresses of all embedded devices, sequentially determines the embedded devices to be deployed in the preset network segment corresponding to the local area network, and then establishes links with these embedded devices to be deployed through SSH, and then reads the resource configuration file of the embedded device to be deployed for characterizing the resource package version of the embedded device to be deployed, compares the resource package version of the embedded device to be deployed with the resource package version stored in the production server, and when the resource package versions of the two are different, obtains an updated resource package from the production server, and sends the updated resource package to the resource deployment server, so that the resource deployment server can perform resource deployment on the embedded device to be deployed based on the updated resource package. The resource deployment method for embedded devices of the present invention realizes the full-process automated resource deployment of embedded devices and improves the efficiency of resource deployment of embedded devices.

[0075] Optionally, a resource deployment method for an embedded device provided according to an embodiment of the present invention further includes:

[0076] In an interval time period, comparing the resource package version of the production server with the resource package version of the publishing server;

[0077] In the case that the resource bundle version of the production server is different from the resource bundle version of the publishing server, the resource bundle version of the production server is updated based on the resource bundle version of the publishing server.

[0078] Specifically, it should be noted that in addition to ARP automatic scanning and SSH automatic connection, the interaction between the production server and the publishing server is also carried out synchronously. There is a physical isolation between the publishing server and the production server. The developers will update the updated resource packages, which can be understood as patches, or new resource package versions on the publishing server. Generally, they are released regularly. At a fixed update time or when there is a vulnerability in the resource package version that needs to be updated, the developers will update the new resource package on the publishing server. At a fixed interval, such as one hour or twelve hours, the production server will synchronize with the publishing server, that is, compare the resource package version of the production server with the resource package version of the publishing server, so as to obtain the latest resource package version in time.

[0079] When the resource package version of the production server is the same as that of the publishing server, it means that the resource package version has not been updated in the current time interval, which means that there is no need to upgrade; when the resource package version of the production server is different from that of the publishing server, it means that in the current time interval, the developer has updated the updated resource package on the publishing server. In this case, the production server needs to update the latest resource package of the publishing server on the production server. Because the resource deployment server and the publishing server cannot interact, the production server is equivalent to a secondary agent, which updates the resource package version within a fixed time period. The resource deployment server can interact with the production server. After the link to the embedded device to be deployed is established as mentioned above, the resource deployment server needs to obtain the latest resource package from the production server.

[0080] The resource deployment method for embedded devices provided by the embodiment of the present invention sets up a resource deployment server, a production server and a publishing server in a hierarchical manner. The production server and the publishing server interact with each other. The production server synchronizes with the publishing server at fixed intervals, and can obtain the latest resource package uploaded by the developer in a timely manner, and download the latest resource package to the production server. After the master server determines the embedded device to be deployed, the resource package version is compared with the resource package version of the production server through the resource deployment server to determine the resource package that needs to be updated, and the resource deployment is performed on the embedded device to be deployed through the resource deployment server. The resource deployment method for embedded devices of the present invention realizes the full-process automated resource deployment of embedded devices, and improves the efficiency of resource deployment of embedded devices.

[0081] According to a resource deployment method for an embedded device provided by an embodiment of the present invention, the above step 104 specifically includes the following steps: Figure 4 The fourth flow chart of the resource deployment method for an embedded device provided by the present invention is to send the update resource package to a resource deployment server so that the resource deployment server performs resource deployment on the embedded device to be deployed based on the update resource package, including:

[0082] Step 1041: Based on the resource package, obtain an authorization response issued by the production server; the authorization response is used to instruct the resource deployment server to download the installation configuration script corresponding to the update resource package;

[0083] Specifically, in the embodiment of the present invention, in order to avoid resource waste, resource deployment is performed serially, and is mainly divided into three parts, namely, installing the authorization service, installing the configuration script, and installing the installation package. In this step, the resource configuration server requests the batch authorization script from the production server through the Hypertext Transfer Protocol. The Hypertext Transfer Protocol (HTTP) is a set of rules for computers to communicate over the network, enabling HTTP clients to request information and services from HTTP servers.

[0084] It should be noted that HTTP is connectionless: connectionless means that each connection is limited to processing only one request. After the server processes the client's request and receives the client's response, it disconnects. This method can save transmission time. HTTP is media independent: this means that as long as the client and server know how to handle the data content, any type of data can be sent through HTTP. The client and server specify the use of the appropriate MIME-type content type. Most web browsers have a series of configurable auxiliary applications that tell the browser how to handle the various content types sent by the web server.

[0085] In this step, HTTP requests batch authorization scripts, and then after obtaining the authorization script, the embedded device sets up to execute the authorization script, and then requests HTTP POST authorization, and then the production server responds with the authorization certificate, and then registers the authorization certificate with the embedded device to be deployed. In addition, the execution result needs to be returned to the production server.

[0086] Step 1042: Based on the installation configuration script, obtain the installation program package corresponding to the update resource package;

[0087] Specifically, in this step, after completing the authorization service, the resource deployment server needs to install the configuration script, that is, after the resource deployment server downloads the configuration script from the production server, the embedded device to be deployed executes the installation configuration script. Similarly, the execution result also needs to be returned to the production server.

[0088] Step 1043: Based on the installation program package, resources are deployed to the embedded device to be deployed.

[0089] Specifically, in this step, a software package, i.e., a DEB package, is downloaded via HTTP. The DEB package is a standard archive of Unixar, and the package file information and package content are packaged through gzip and tar. The classic program for processing these packages is dpkg, which is often operated through Debian's apt-get. Through the Alien tool, the deb package can be converted into rpm and tar.gz formats. That is, in an embodiment of the present invention, HTTP downloads the DEB package and tar, i.e., a compressed package, and tar represents an uncompressed tar file. The compressed tar file is attached with the extension of the compressed file, such as a tar file compressed by gzip, with an extension of ".tar.gz". The DEB package is installed through dpkg, and then decompressed, that is, the installation package is obtained, and the installation script is executed on the embedded device to be deployed, that is, the resource deployment of the embedded device to be deployed is completed.

[0090] The resource deployment method for embedded devices provided in the embodiment of the present invention discovers all embedded devices in the local area network through automatic ARP scanning, obtains the MAC addresses of all embedded devices, sequentially determines the embedded devices to be deployed in the preset network segment corresponding to the local area network, and then establishes links with these embedded devices to be deployed through SSH, and then reads the resource configuration file of the embedded device to be deployed for characterizing the resource package version of the embedded device to be deployed, compares the resource package version of the embedded device to be deployed with the resource package version stored in the production server, and when the resource package versions of the two are different, obtains an updated resource package from the production server, and sends the updated resource package to the resource deployment server, so that the resource deployment server performs resource deployment on the embedded device to be deployed based on the updated resource package. The resource deployment method for embedded devices in the embodiment of the present invention realizes the full automation of the resource deployment process, and can automatically count the upgrade status of the embedded device, and can also automatically count the installation status, thereby improving the efficiency of resource deployment for the embedded device. Improves ease of use.

[0091] Optionally, a resource deployment method for an embedded device provided according to an embodiment of the present invention further includes:

[0092] Receive the installation progress and resource deployment execution result returned by the embedded device to be deployed.

[0093] Specifically, after the embedded device to be deployed completes the installation of the update resource package, that is, after the resource deployment is completed, the installation progress and execution results need to be returned to the resource deployment server. The resource deployment server needs to save the technical documents generated during the resource configuration process and delete some temporary downloaded files.

[0094] The resource deployment method for embedded devices provided by the embodiment of the present invention realizes the full automation of the resource deployment process, and can automatically count the upgrade status of the embedded device and the installation status, thereby improving the efficiency of embedded device resource deployment and management efficiency. By deleting some temporary downloaded files, the stability of the resource deployment process is also guaranteed.

[0095] The resource deployment device of the embedded device provided by the present invention is described below. The resource deployment device of the embedded device described below and the resource deployment method of the embedded device described above can be referred to each other. Figure 5 is a schematic diagram of the structure of the resource deployment device of the embedded device provided by the present invention, such as Figure 5 As shown, the resource deployment device of the embedded device provided by the embodiment of the present invention includes:

[0096] Determination module 501, used to determine the embedded device to be deployed in the preset network segment corresponding to the local area network;

[0097] Specifically, this module scans through ARP, and performs ARP scanning within a fixed time interval, and the time interval can be 5s or 10s. ARP is a TCP / IP protocol that obtains a physical address based on an IP address. The host is the master control server in the embodiment of the present invention. When sending information, the ARP request containing the target IP address is broadcast to all hosts on the local area network. In the embodiment of the present invention, the host on the local area network is all embedded devices linked to the local area network, and then receives the return message of each embedded device to determine the physical address of the target. The address resolution protocol is based on the mutual trust of each host in the network. The host on the local area network can autonomously send an ARP reply message. When other hosts receive the reply message, they will not detect the authenticity of the message and will record it in the local ARP cache. According to the IP address of each embedded device, the MAC address returned by each embedded device is obtained, and then the MAC address stored in the previous database of the obtained MAC address is compared, so that the new device and the known device in the local area network can be distinguished based on the MAC address. The new device is the embedded device to be deployed in the embodiment of the present invention. Further, these embedded devices to be deployed are automatically connected through secure SSH, and the embedded devices to be deployed that can be successfully connected are followed by subsequent steps. It should also be noted that when using SSH connection, you need to obtain the IP address of the embedded device in advance. Embedded devices can be divided into devices with interface and devices without interface according to the human-computer interaction mode. For devices with interface interaction, the IP address of the device can be obtained through manual operation.

[0098] The reading module 502 is used to read the resource configuration file of the embedded device to be deployed; the resource configuration file is used to represent the resource package version of the embedded device to be deployed;

[0099] Specifically, after this module connects to the embedded device to be deployed through SSH, the device to be deployed will store a resource configuration file, which is used to represent the resource package version of the current embedded device to be deployed. By reading the resource configuration file of the embedded device to be deployed, the version information and resource version information of the current embedded device to be configured, that is, the resource package version, can be obtained.

[0100] The acquisition module 503 is used to acquire an updated resource package from the production server when the resource package version of the embedded device to be deployed is different from the resource package version stored in the production server;

[0101] Specifically, the latest resource package is stored in the production server. It is necessary to compare the resource configuration file read from the embedded device to be deployed, that is, the resource package version of the embedded device to be deployed and the latest resource package version in the production server. When the two resource package versions are different, it means that there are parts of the embedded device to be deployed that need to be updated. The updated part can be regarded as a patch. By comparing the resource package version stored in the production server with the resource package version of the embedded device to be deployed, the resources that need to be upgraded can be determined, that is, the difference between the two resource packages, and then the updated resource package can be obtained from the production server.

[0102] The deployment module 504 is used to send the updated resource package to the resource deployment server, so that the resource deployment server performs resource deployment on the embedded device to be deployed based on the updated resource package.

[0103] The resource deployment device for embedded devices provided by the embodiment of the present invention cooperates with each other to determine the module, discover all embedded devices in the local area network through automatic ARP scanning, obtain the MAC addresses of all embedded devices, determine the embedded devices to be deployed in the preset network segment corresponding to the local area network in turn, and then establish a link with these embedded devices to be deployed through SSH, and then read the resource configuration file of the embedded device to be deployed for characterizing the resource package version of the embedded device to be deployed, compare the resource package version of the embedded device to be deployed with the resource package version stored in the production server, and when the resource package versions of the two are different, obtain an updated resource package from the production server, and send the updated resource package to the resource deployment server, so that the resource deployment server can perform resource deployment on the embedded device to be deployed based on the updated resource package. The resource deployment method for embedded devices of the present invention realizes the full-process automated resource deployment of embedded devices and improves the efficiency of resource deployment of embedded devices.

[0104] Optionally, the above-mentioned determination module specifically includes the following units:

[0105] An establishing unit, used for establishing a link with the embedded device to be deployed based on an SSH service;

[0106] Specifically, after determining which embedded devices in the LAN are newly connected embedded devices in the LAN, it is necessary to establish connections with these embedded devices to be deployed. In the specific implementation of the embodiment of the present invention, there will be a situation where the new embedded device cannot be connected. Therefore, it is necessary to first establish a link with the embedded device to be deployed based on the SSH service.

[0107] It should be noted that there are generally two ways to link with embedded devices. One is serial port link. Serial port tool is a software used to debug and test serial port devices. However, the communication efficiency of serial port link is too slow and is only suitable for auxiliary monitoring work. In the embodiment of the present invention, SSH service is used to establish a link with the embedded device to be deployed. After the SSH remote link, the remote machine can be operated like a local machine, and the communication efficiency is high, which is suitable for the application scenario of the embodiment of the present invention.

[0108] An acquisition unit, configured to acquire device information of the embedded device to be deployed based on the link;

[0109] Specifically, after the management PC establishes a link with the embedded device to be deployed based on the SSH service, the device information of the embedded device to be deployed can be read through the home directory. The device information can include relevant basic information of the embedded device to be deployed, such as the model of the embedded device, the name of the embedded device, and the MAC address of the embedded device to be deployed mentioned above.

[0110] An updating unit is used to update the preset database based on the device information.

[0111] Specifically, after obtaining the device information of the embedded devices to be deployed based on the above steps, the device information is stored in the preset database, that is, the preset database is updated. Before the next ARP automatic scan, the preset database has been updated and the device information of the embedded devices to be deployed has been stored. Then, after the next ARP scan, a new round of comparison can be performed to discover new embedded devices to be deployed.

[0112] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the resource deployment method of the embedded device, which includes:

[0113] Determine the embedded devices to be deployed within the preset network segment corresponding to the local area network;

[0114] Reading a resource configuration file of the embedded device to be deployed; the resource configuration file is used to represent a resource package version of the embedded device to be deployed;

[0115] When the resource package version of the embedded device to be deployed is different from the resource package version stored in the production server, obtaining an updated resource package from the production server;

[0116] The update resource package is sent to a resource deployment server, so that the resource deployment server performs resource deployment on the embedded device to be deployed based on the update resource package.

[0117] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0118] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the resource deployment method of the embedded device provided by the above methods, the method includes:

[0119] Determine the embedded devices to be deployed within the preset network segment corresponding to the local area network;

[0120] Reading a resource configuration file of the embedded device to be deployed; the resource configuration file is used to represent a resource package version of the embedded device to be deployed;

[0121] When the resource package version of the embedded device to be deployed is different from the resource package version stored in the production server, obtaining an updated resource package from the production server;

[0122] The update resource package is sent to a resource deployment server, so that the resource deployment server performs resource deployment on the embedded device to be deployed based on the update resource package.

[0123] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for resource deployment of an embedded device provided by the above methods is implemented, and the method comprises:

[0124] Determine the embedded devices to be deployed within the preset network segment corresponding to the local area network;

[0125] Reading a resource configuration file of the embedded device to be deployed; the resource configuration file is used to represent a resource package version of the embedded device to be deployed;

[0126] When the resource package version of the embedded device to be deployed is different from the resource package version stored in the production server, obtaining an updated resource package from the production server;

[0127] The update resource package is sent to a resource deployment server, so that the resource deployment server performs resource deployment on the embedded device to be deployed based on the update resource package.

[0128] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0129] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0130] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A resource deployment method for an embedded device, characterized in that: include: Determine the embedded devices to be deployed within the preset network segment corresponding to the local area network; Read the resource configuration file of the embedded device to be deployed; The resource configuration file is used to represent the resource package version of the embedded device to be deployed; When the resource package version of the embedded device to be deployed is different from the resource package version stored in the production server, obtaining an updated resource package from the production server; The update resource package is sent to a resource deployment server, so that the resource deployment server performs resource deployment on the embedded device to be deployed based on the update resource package.

2. The resource deployment method for an embedded device according to claim 1, characterized in that: The step of determining the embedded device to be deployed within a preset network segment corresponding to the local area network includes: Performing an ARP scanning operation in the preset network segment to obtain response information of at least one embedded device; the response information is used to represent the MAC address of each embedded device; the local area network includes at least one embedded device; Based on the comparison result of the response information of each embedded device and the storage information in the preset database, the embedded devices to be deployed in the preset network segment corresponding to the local area network are determined.

3. The resource deployment method for an embedded device according to claim 2, characterized in that: After determining the embedded device to be deployed in the preset network segment, the method further includes: Based on the SSH service, establish a link with the embedded device to be deployed; Based on the link, obtaining device information of the embedded device to be deployed; Based on the device information, the preset database is updated.

4. The resource deployment method for an embedded device according to claim 1, characterized in that: The method further comprises: In an interval time period, comparing the resource package version of the production server with the resource package version of the publishing server; In the case that the resource bundle version of the production server is different from the resource bundle version of the publishing server, the resource bundle version of the production server is updated based on the resource bundle version of the publishing server.

5. The resource deployment method for an embedded device according to claim 1, characterized in that: The sending of the update resource package to the resource deployment server so that the resource deployment server performs resource deployment on the embedded device to be deployed based on the update resource package includes: Based on the resource package, obtaining an authorization response issued by the production server; the authorization response is used to instruct the resource deployment server to download the installation configuration script corresponding to the update resource package; Based on the installation configuration script, obtaining the installation program package corresponding to the update resource package; Based on the installation program package, resources are deployed to the embedded device to be deployed.

6. The resource deployment method for an embedded device according to claim 5, characterized in that: The method comprises: Receive the installation progress and resource deployment execution result returned by the embedded device to be deployed.

7. A resource deployment device for an embedded device, characterized in that: include: A determination module, used to determine the embedded device to be deployed within a preset network segment corresponding to the local area network; A reading module, used to read the resource configuration file of the embedded device to be deployed; The resource configuration file is used to represent the resource package version of the embedded device to be deployed; An acquisition module, configured to acquire an updated resource package from the production server when the resource package version of the embedded device to be deployed is different from the resource package version stored in the production server; The deployment module is used to send the update resource package to the resource deployment server, so that the resource deployment server performs resource deployment on the embedded device to be deployed based on the update resource package.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the resource deployment method for an embedded device as described in any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the resource deployment method for an embedded device as claimed in any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the resource deployment method for an embedded device as claimed in any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Batch updating method and device, electronic equipment and computer readable storage medium

    CN121934870A