Video recording method and device during device migration and storage medium
Patent Information
- Application Number
- CN202111620862.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2026-09-29
- Estimated Expiration
- 2041-12-27
AI Technical Summary
但是单个摄像机存在单点故障、录像易丢失等弱点,于是现有产生了一种集群化拓扑结构的安防监控方案
[0053]本申请实施例提供的设备迁移时的录像方法、装置及存储介质,该方法在第二服务器的录像设备发生迁移时,通过第一服务器确定该录像设备待迁入的第三服务器,并判断两个服务器的状态是否正常,如果两个服务器的状态正常,则控制第三服务器添加上述录像设备,并在添加成功,上述录像设备恢复录像后,再通知第二服务器删除上述录像设备,即延迟在第二服务器上删除上述录像设备,保证上述录像设备在迁移过程中录像不中断。如果第二服务器的状态异常,则通过第一服务器控制第三服务器根据第二服务器的录像截止时间,从上述录像设备缓存的录像中获取缺失的录像,即采取缓存补录的方式恢复录像,实现录像连续,解决设备迁移场景录像中断的问题,从而,使得用户能够获得迁移过程中的相关录像,实现实时安防监控。
Smart Images

Figure CN116366792B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of video recording technology, and in particular to a video recording method, apparatus and storage medium for device relocation. Background Technology
[0002] With the rapid development of the network video surveillance market, users' demands for high-definition, networked, large-scale access, and reliable monitoring are constantly increasing. Many projects require the connection of tens of thousands of recording devices, such as cameras.
[0003] A camera is a core device in a security monitoring network. However, individual cameras have weaknesses such as single point of failure and easy loss of recordings. Therefore, a clustered topology security monitoring solution has emerged.
[0004] However, in a cluster scenario, if a server is under high load or malfunctions, it may trigger device migration, such as camera migration. During the camera migration process, recording will be interrupted, making it impossible for users to obtain the relevant recordings during the migration process and thus preventing real-time security monitoring. Summary of the Invention
[0005] To address the problems existing in the prior art, this application provides a recording method, apparatus, and storage medium for device migration.
[0006] In a first aspect, embodiments of this application provide a recording method during device migration. The method is applied to a first server, which manages the remaining servers in the cluster besides itself. The method includes:
[0007] If the recording device of the second server in the cluster is migrated, then the third server to which the recording device is to be migrated is determined in the cluster, and it is determined whether the status of the second server and the third server is normal.
[0008] If the second server and the third server are both in normal condition, then the third server is controlled to add the recording device. After the recording device resumes recording, the second server is notified to delete the recording device.
[0009] If the second server is in an abnormal state while the third server is in a normal state, the third server retrieves the missing recordings from the recordings cached by the recording device based on the recording cutoff time of the second server.
[0010] In one possible implementation, the step of controlling the third server to add the recording device, and after successful addition and the recording device resuming recording, notifying the second server to delete the recording device, includes:
[0011] The device parameters of the recording device are sent to the third server. The device parameters are used to instruct the third server to add the recording device according to the device parameters. After the recording device resumes recording after successful addition, the device status of the recording device is returned to the first server.
[0012] Based on the device status of the recording device, a message to delete the recording device is sent to the second server, and the message to delete the recording device is used to instruct the second server to delete the recording device.
[0013] In one possible implementation, the third server includes a Cluster Manager Unit (CMU), a first Server Control Unit (SCU), a first Database (DB), a first Device Connect Gateway (DCG), and a first Media Unit (MU).
[0014] The step of sending the device parameters of the recording device to the third server, wherein the device parameters are used to instruct the third server to add the recording device according to the device parameters, and after successful addition and resumption of recording by the recording device, returning the device status of the recording device to the first server, includes:
[0015] The device parameters of the recording device are sent to the CMU. The device parameters are used to instruct the CMU to notify the first SCU to add the recording device and save the device parameters to the first DB. The device parameters are sent to the first DCG, which logs in to the recording device based on the device parameters. After successful login, the first MU is notified to start recording with the recording device, so that the first SCU returns the device status of the recording device to the first server.
[0016] In one possible implementation, the second server includes a second SCU, a second DB, a second DCG, and a second MU;
[0017] The step of sending information to delete the recording device to the second server based on the device status of the recording device, wherein the information to delete the recording device is used to instruct the second server to delete the recording device, includes:
[0018] Based on the device status of the recording device, a message to delete the recording device is sent to the second SCU. The message to delete the recording device is used to instruct the second SCU to delete the relevant information of the recording device in the second DB, log out of the recording device in the second DCG, and stop the recording device from recording in the second MU.
[0019] In one possible implementation, the step of retrieving the missing recordings from the recordings cached by the recording device based on the recording cutoff time of the second server by the third server includes:
[0020] The system controls the third server to add the recording device. After successful addition and the recording device resumes recording, the system determines the time when the third server resumes recording and retrieves the missing recordings from the recordings cached by the recording device based on the recording deadline of the second server and the recording resumption time of the third server.
[0021] In one possible implementation, the third server retrieves the missing recordings from the recordings cached by the recording device based on the recording deadline and the recording recovery time of the second server, including:
[0022] The recording cutoff time of the second server is sent to the third server. The recording cutoff time is used to instruct the third server to determine that there is a recording interruption in the second server, and to retrieve the missing recording from the recording cache of the recording device according to the recording cutoff time and the time when the third server resumes recording.
[0023] In one possible implementation, determining the third server to which the recording device is to be migrated within the cluster includes:
[0024] Obtain the performance parameters of the remaining servers in the cluster, excluding the first server and the second server;
[0025] Based on the performance parameters of the remaining servers and the performance parameters of the recording device, the third server to which the recording device is to be migrated is determined in the cluster.
[0026] Secondly, embodiments of this application provide a recording device during device migration. The device is applied to a first server, which manages the remaining servers in the cluster besides itself. The device includes:
[0027] The status judgment module is used to determine the third server to which the recording device is to be migrated in the cluster if the recording device of the second server in the cluster is migrated, and to determine whether the status of the second server and the third server is normal.
[0028] The first recording processing module is used to control the third server to add the recording device if the second server is in a normal state and the third server is in a normal state, and to notify the second server to delete the recording device after the addition is successful and the recording device resumes recording.
[0029] The second video recording processing module is used to retrieve the missing video recordings from the video recordings cached by the recording device if the second server is in an abnormal state and the third server is in a normal state, based on the recording deadline of the second server.
[0030] In one possible implementation, the first video recording module is specifically used for:
[0031] The device parameters of the recording device are sent to the third server. The device parameters are used to instruct the third server to add the recording device according to the device parameters. After the recording device resumes recording after successful addition, the device status of the recording device is returned to the first server.
[0032] Based on the device status of the recording device, a message to delete the recording device is sent to the second server, and the message to delete the recording device is used to instruct the second server to delete the recording device.
[0033] In one possible implementation, the third server includes a CMU, a first SCU, a first DB, a first DCG, and a first MU;
[0034] The first video recording processing module is specifically used for:
[0035] The device parameters of the recording device are sent to the CMU. The device parameters are used to instruct the CMU to notify the first SCU to add the recording device and save the device parameters to the first DB. The device parameters are sent to the first DCG, which logs in to the recording device based on the device parameters. After successful login, the first MU is notified to start recording with the recording device, so that the first SCU returns the device status of the recording device to the first server.
[0036] In one possible implementation, the second server includes a second SCU, a second DB, a second DCG, and a second MU;
[0037] The first video recording processing module is specifically used for:
[0038] Based on the device status of the recording device, a message to delete the recording device is sent to the second SCU. The message to delete the recording device is used to instruct the second SCU to delete the relevant information of the recording device in the second DB, log out of the recording device in the second DCG, and stop the recording device from recording in the second MU.
[0039] In one possible implementation, the second video recording module is specifically used for:
[0040] The system controls the third server to add the recording device. After successful addition and the recording device resumes recording, the system determines the time when the third server resumes recording and retrieves the missing recordings from the recordings cached by the recording device based on the recording deadline of the second server and the recording resumption time of the third server.
[0041] In one possible implementation, the second video recording module is specifically used for:
[0042] The recording cutoff time of the second server is sent to the third server. The recording cutoff time is used to instruct the third server to determine that there is a recording interruption in the second server, and to retrieve the missing recording from the recording cache of the recording device according to the recording cutoff time and the time when the third server resumes recording.
[0043] In one possible implementation, the state determination module is specifically used for:
[0044] Obtain the performance parameters of the remaining servers in the cluster, excluding the first server and the second server;
[0045] Based on the performance parameters of the remaining servers and the performance parameters of the recording device, the third server to which the recording device is to be migrated is determined in the cluster.
[0046] Thirdly, embodiments of this application provide a server, including:
[0047] processor;
[0048] Memory; and
[0049] Computer programs;
[0050] The computer program is stored in the memory and configured to be executed by the processor, the computer program including instructions for performing the method as described in the first aspect.
[0051] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that causes a server to perform the method described in the first aspect.
[0052] Fifthly, embodiments of this application provide a computer program product, including computer instructions, which are executed by a processor according to the method described in the first aspect.
[0053] The device migration recording method, apparatus, and storage medium provided in this application embodiment describe a method for recording video during device migration. When a recording device on a second server is migrated, the first server determines the third server to which the recording device will be migrated and checks the status of both servers. If both servers are functioning normally, the third server is controlled to add the recording device. After successful addition and resumption of recording by the recording device, the second server is notified to delete the recording device, thus delaying its deletion and ensuring uninterrupted recording during the migration process. If the second server is functioning abnormally, the first server controls the third server to retrieve missing recordings from the cached recordings of the recording device based on the second server's recording cutoff time. This cached recording method restores the recording, ensuring continuous recording and resolving the problem of recording interruption during device migration. This allows users to obtain relevant recordings during the migration process, enabling real-time security monitoring. Attached Figure Description
[0054] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0055] Figure 1 This is a schematic diagram of the recording system architecture during device migration provided in an embodiment of this application;
[0056] Figure 2 A flowchart illustrating a recording method during device migration provided in an embodiment of this application;
[0057] Figure 3 A flowchart illustrating another recording method during device migration provided in this application embodiment;
[0058] Figure 4 A schematic diagram illustrating the interaction between the first server, the second server, and the third server provided in an embodiment of this application;
[0059] Figure 5A schematic flowchart illustrating another recording method during device migration provided in an embodiment of this application;
[0060] Figure 6 This application provides a schematic diagram of the structure of a recording device during device relocation.
[0061] Figure 7 This is a schematic diagram of the basic hardware architecture of a server provided in an embodiment of this application. Detailed Implementation
[0062] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0063] The terms “first,” “second,” “third,” and “fourth,” etc. (if present), in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0064] In current video surveillance solutions, camera migration will inevitably cause recording interruptions to some extent. During the process of migrating a camera from one server to another, the device will first go offline from the source server and then come online from the new server. The recordings during the time between going offline and going offline cannot be obtained, resulting in the loss of recordings during this period.
[0065] To ensure uninterrupted recording, the devices need to be online continuously, which is practically impossible. Simultaneously, it's necessary to ensure communication between the migrating-in and migrating-out servers, with the migrating-in server needing to promptly inform the migrating-out server of the recording status. All of these are difficult to achieve.
[0066] To address the aforementioned issues, this application proposes a recording method during device migration. Considering the status of the migration-in and migration-out servers, when both servers are in normal condition, the deletion of the recording device (such as the aforementioned camera) on the migration-out server is delayed to ensure uninterrupted recording during the migration process. When the migration-out server is in an abnormal state, the recording is restored on the migration-in server by retrieving the missing recordings from the aforementioned recording device's cache, thus achieving continuous recording and resolving the problem of recording interruption during device migration.
[0067] Optionally, the recording method for device migration provided in this application embodiment can be applied to, for example... Figure 1 The video recording system shown is used during device relocation. Figure 1 In this example, a cluster consisting of a first server, a second server, and a third server is used. The first server is the master server of the cluster, responsible for managing the second and third servers. The second and third servers can be video processing units (VPUs).
[0068] The video recording system architecture during device migration may include the first server, which includes a central database. Here, the first server can obtain migration information of the recording devices in the second and third servers (e.g., the recording devices in the second server have been migrated), and then store the migration information in the central database.
[0069] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the recording architecture during device migration. In other feasible embodiments of this application, the above architecture may include more or fewer components than illustrated, or combine some components, or split some components, or arrange different components, which can be determined according to the actual application scenario and is not limited here. Figure 1 The components shown can be implemented in hardware, software, or a combination of both.
[0070] In the specific implementation process, the first server obtains the migration information of the recording devices from the central database, such as the migration information of the recording devices on the second server. Then, the first server determines the server to which the recording devices are to be migrated, such as the third server, and checks whether the status of the second and third servers is normal. When both servers are normal, the first server delays deleting the recording devices from the migration-out server (i.e., the second server) to ensure uninterrupted recording during the migration process. If the migration-out server is abnormal, the first server restores the recordings on the migration-in server (i.e., the third server) by retrieving the missing recordings from the recording devices' cache, thus achieving continuous recording and resolving the problem of recording interruption during device migration.
[0071] It should be understood that the aforementioned first server can be implemented by reading instructions from memory and executing those instructions, or it can be implemented by chip circuitry.
[0072] The above system is only an example system. In specific implementation, it can be set up according to application requirements.
[0073] It is understood that the system architecture described in the embodiments of this application is for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and does not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0074] The technical solutions of this application are described below using several embodiments as examples. The same or similar concepts or processes may not be repeated in some embodiments.
[0075] Figure 2 This is a flowchart illustrating a recording method during device migration provided in an embodiment of this application. The execution entity in this embodiment can be... Figure 1 The specific entity executing the first server in the cluster can be determined based on the actual application scenario; this application embodiment does not impose any particular restrictions. The aforementioned first server is used to manage the remaining servers in the cluster, excluding the first server itself. Figure 2 As shown, the recording method for device migration provided in this application embodiment may include the following steps:
[0076] S201: If the recording device of the second server in the above cluster is migrated, then the third server to which the recording device is to be migrated is determined in the above cluster, and it is determined whether the status of the second server and the third server is normal.
[0077] Here, the second server mentioned above refers to any one of the remaining servers in the cluster other than the first server mentioned above. The third server mentioned above is different from the second server mentioned above.
[0078] As can be seen from the above, the first server can manage the remaining servers in the cluster except for the first server. For example, when a server has a high load or is abnormal, it can determine that the recording device in the server needs to be migrated. Then, it can obtain the migration information of the recording device in the server (such as the identifier of the recording device and the identifier of the server where the recording device is located), and store the obtained migration information in the central database.
[0079] The first server retrieves migration information of the recording devices from the central database, such as migration information of the recording devices on the second server, and determines the third server in the cluster to which the recording devices will be migrated. Specifically, the first server can obtain the performance parameters of the remaining servers in the cluster besides the first and second servers, and then, based on the performance parameters and the performance parameters of the recording devices, determine the third server in the cluster to which the recording devices will be migrated.
[0080] The first server can first determine the idle servers based on the performance parameters of the remaining servers, and then determine the server that matches the performance parameters of the recording equipment from the idle servers as the third server to be moved into the recording equipment.
[0081] Here, if there are multiple servers in the cluster that can access the recording device, the first server can sort the multiple servers, for example, according to performance from high to low. Then, the server ranked first will be used as the third server to be migrated to the recording device, thereby improving the success rate of device migration.
[0082] In addition, after determining the third server to which the recording device is to be moved, the first server can further determine whether the status of the second and third servers is normal. Based on the determination results, the recording processing during the device migration is carried out. That is, different recording processing strategies are adopted for different determination results to ensure the continuity of recording during the device migration.
[0083] For example, the first server can send a first test message to the second server, and then determine whether it receives a first response message from the second server based on the first test message within a first preset time period. If so, the second server is considered to be in a normal state; otherwise, the second server is considered to be in an abnormal state. Similarly, the first server can send a second test message to the third server, and then determine whether it receives a second response message from the third server based on the second test message within a second preset time period. If so, the third server is considered to be in a normal state; otherwise, the third server is considered to be in an abnormal state.
[0084] In this embodiment, after the recording device on the second server is migrated and the third server to which the recording device is to be migrated is determined, the first server may also consider whether the second server is online. If the second server is online, the first server performs the step of determining whether the status of the second and third servers is normal. If the second server is offline (i.e., not recording), the first server can directly delete the recording device from the second server without performing subsequent status judgments or other operations.
[0085] S202: If the status of the second server and the status of the third server are normal, then control the third server to add the recording device, and after the recording device resumes recording, notify the second server to delete the recording device.
[0086] Here, the fact that the second and third servers are in normal status indicates that they are working properly. As long as the recording devices are kept online and offline without interruption during the migration process, complete recordings can be obtained.
[0087] Accordingly, when both the second and third servers are functioning normally, the first server delays deleting the device from the second server. Once the device is successfully added to the third server, is online, and the recording is restored, the second server is notified to delete the device. This ensures that the recording is not interrupted when the device goes online or offline again during the migration process, thus guaranteeing the continuity of the recording.
[0088] S203: If the status of the second server is abnormal and the status of the third server is normal, then the third server shall retrieve the missing recordings from the recordings cached by the recording device according to the recording deadline of the second server.
[0089] The abnormal status of the second server indicates that it has stopped working and recording is interrupted. To obtain complete recordings, the first server can inform the third server of the recording deadline of the second server during the device migration process. Once the recording device is back online, the recordings from the offline period can be restored on the third server through cached recording.
[0090] Here, the aforementioned recording device is a recording device with image buffering function.
[0091] In this embodiment, when the recording device on the second server is migrated, the first server determines the third server to which the recording device will be migrated and checks the status of both servers. If both servers are in normal condition, the third server is controlled to add the recording device. After successful addition and the recording device resuming recording, the second server is notified to delete the recording device, thus delaying its deletion from the second server and ensuring uninterrupted recording during the migration process. If the second server is in an abnormal state, the first server controls the third server to retrieve the missing recordings from the cached recordings of the recording device based on the recording deadline of the second server. This cached recording method restores the recording, ensuring continuous recording and resolving the problem of recording interruption during device migration. This allows users to obtain relevant recordings during the migration process, enabling real-time security monitoring.
[0092] Furthermore, when the first server controls the third server to add the recording device, and after successful addition and resumption of recording by the recording device, notifies the second server to delete the recording device, it can consider sending the device parameters of the recording device to the third server. These device parameters instruct the third server to add the recording device, and after successful addition and resumption of recording, return the device's device status. Therefore, the first server can send deletion information to the second server based on the device status, instructing the second server to delete the recording device. This delays deletion on the second server, ensuring uninterrupted recording during the migration process. Figure 3 This is a schematic flowchart illustrating another recording method for device migration proposed in an embodiment of this application. Figure 3 As shown, the method includes:
[0093] S301: If the recording device of the second server in the above cluster is migrated, then the third server to which the recording device is to be migrated is determined in the above cluster, and it is determined whether the status of the second server and the third server is normal.
[0094] Step S301 is implemented in the same way as step S201 above, and will not be described again here.
[0095] S302: If the status of the second server and the status of the third server are normal, the device parameters of the recording device are sent to the third server. The device parameters are used to instruct the third server to add the recording device according to the device parameters. After the addition is successful and the recording device resumes recording, the device status of the recording device is returned to the first server.
[0096] The device parameters of the aforementioned recording equipment can be determined according to actual conditions, including, for example, IP address, port, username, and password. The device status of the aforementioned recording equipment can include status information such as successful addition and resumption of recording.
[0097] For example, such as Figure 4 As shown, the third server includes a CMU, a first SCU, a first DB, a first DCG, and a first MU. The first server can send device parameters of the recording device to the CMU. These device parameters instruct the CMU to notify the first SCU to add the recording device, save the device parameters in the first DB, and send the device parameters to the first DCG. The first DCG then logs into the recording device based on the device parameters and, upon successful login, notifies the first MU to start recording, so that the first SCU returns the device status of the recording device to the first server.
[0098] In addition, such as Figure 4 As shown, the first server includes a CMU and a central database (CDB). The first server can send the device parameters of the recording device to the CMU of the third server through its own CMU. The first SCU of the third server can return the device status of the recording device to the CDB of the first server, and the CDB updates the device status of the recording device.
[0099] S303: Based on the device status of the aforementioned recording device, send information to the aforementioned second server to delete the recording device. This information is used to instruct the aforementioned second server to delete the aforementioned recording device.
[0100] Here, as Figure 4As shown, the second server includes a second SCU, a second DB, a second DCG, and a second MU. The first server can send information to the second SCU to delete the recording device based on its device status. This information instructs the second SCU to delete the relevant information of the recording device in the second DB, log out the recording device in the second DCG, and stop recording in the second MU.
[0101] In this embodiment of the application, the above operations ensure that the recording device can still record normally on the second server while it is online on the third server, thus achieving uninterrupted recording service.
[0102] S304: If the status of the second server is abnormal and the status of the third server is normal, then the third server shall retrieve the missing recordings from the recordings cached by the recording device according to the recording deadline of the second server.
[0103] Step S304 is implemented in the same way as step S203 above, and will not be described again here.
[0104] In this embodiment, when the second and third servers are functioning normally, the first server sends device parameters of the recording device to the third server to instruct the third server to add the recording device. After successful addition and resumption of recording, the first server returns the device status of the recording device. Furthermore, the first server can send deletion information to the second server based on the device status, instructing the second server to delete the recording device. This delays deletion on the second server, ensuring uninterrupted recording during migration. Moreover, when the second server is in an abnormal state, the first server uses a buffered recording method to resume recording, achieving continuous recording and resolving the problem of recording interruption during device migration.
[0105] In addition, when the third server retrieves the missing recordings from the recordings cached by the recording device based on the recording deadline of the second server, the first server may consider controlling the third server to add the recording device. After the addition is successful and the recording device resumes recording, the first server determines the recording resumption time and retrieves the missing recordings from the recordings cached by the recording device based on the recording deadline of the second server and the recording resumption time of the third server. That is, the recording is resumed by using a cache-filling method to achieve continuous recording. Figure 5 This is a flowchart illustrating another recording method for device migration proposed in an embodiment of this application. Figure 5 As shown, the method includes:
[0106] S501: If the recording device of the second server in the above cluster is migrated, then the third server to which the recording device is to be migrated is determined in the above cluster, and it is determined whether the status of the second server and the third server is normal.
[0107] S502: If the status of the second server and the status of the third server are normal, control the third server to add the recording device, and after the recording device resumes recording, notify the second server to delete the recording device.
[0108] The implementation of steps S501-S502 is the same as that of steps S201-S202 above, and will not be repeated here.
[0109] S503: If the status of the second server is abnormal and the status of the third server is normal, control the third server to add the recording device. After the addition is successful and the recording device resumes recording, determine the recording time of the third server and retrieve the missing recordings from the recordings cached by the recording device according to the recording deadline of the second server and the recording time of the third server.
[0110] The first server can send the recording cutoff time of the second server to the third server. This time is used to instruct the third server to determine that there is a recording interruption in the second server, and to retrieve the missing recording from the recording cached by the recording device based on the recording cutoff time and the recording recovery time of the third server.
[0111] For example, with Figure 4For example, the first server can send the recording deadline of the second server and the device parameters of the recording device to the CMU of the third server. The CMU notifies the first SCU to add the recording device and saves the recording deadline and device parameters to the first DB. The CMU then sends the device parameters to the first DCG, which logs in to the recording device based on the device parameters. After successful login, the DCG notifies the first MU to start recording. Simultaneously, if it is determined that there is a recording interruption on the second server based on the recording deadline, a cache recovery process is initiated. Based on the recording deadline and the time when the third server resumes recording, the missing recordings are retrieved from the recording device and transferred to the third server to achieve continuous recording. If the aforementioned recording deadline is 12:01 on December 1, 2021, and the aforementioned recording recovery time is 12:06 on December 1, 2021, the aforementioned third server can, based on these two times, retrieve the missing recordings (the recordings from 12:01 to 12:06 on December 1, 2021) from the aforementioned recording device to the third server, thus resolving the recording interruption issue in the device migration scenario.
[0112] In this embodiment, when the second and third servers are functioning normally, the first server delays deleting the recording device from the second server to ensure uninterrupted recording during the migration process. Furthermore, when the second server is in an abnormal state, the first server considers controlling the third server to add the recording device. After successful addition and the recording device resuming recording, the first server determines the recording resumption time of the third server and, based on the recording deadline of the second server and the recording resumption time of the third server, retrieves the missing recordings from the cached recordings of the recording device. This cache-based supplementary recording method restores recording continuity and solves the problem of recording interruption during device migration.
[0113] Corresponding to the recording method during device migration in the above embodiment, Figure 6 This is a schematic diagram of the recording device during device migration provided in an embodiment of this application. For ease of explanation, only the parts relevant to the embodiment of this application are shown. Figure 6This is a schematic diagram of a recording device during device migration provided in an embodiment of this application. The recording device 60 during device migration includes: a status judgment module 601, a first recording processing module 602, and a second recording processing module 603. The recording device during device migration can be the aforementioned first server itself, or a chip or integrated circuit that implements the functions of the first server. It should be noted that the division into the status judgment module, the first recording processing module, and the second recording processing module is only a logical functional division; physically, they can be integrated or independent.
[0114] The status judgment module 601 is used to determine the third server to which the recording device is to be migrated if the recording device of the second server in the cluster is migrated, and to determine whether the status of the second server and the third server is normal.
[0115] The first recording processing module 602 is used to control the third server to add the recording device if the second server is in a normal state and the third server is in a normal state, and to notify the second server to delete the recording device after the addition is successful and the recording device resumes recording.
[0116] The second video recording processing module 603 is used to retrieve the missing video recordings from the video recordings cached by the recording device if the state of the second server is abnormal and the state of the third server is normal.
[0117] In one possible implementation, the first video recording processing module 602 is specifically used for:
[0118] The device parameters of the recording device are sent to the third server. The device parameters are used to instruct the third server to add the recording device according to the device parameters. After the recording device resumes recording after successful addition, the device status of the recording device is returned to the first server.
[0119] Based on the device status of the recording device, a message to delete the recording device is sent to the second server, and the message to delete the recording device is used to instruct the second server to delete the recording device.
[0120] In one possible implementation, the third server includes a CMU, a first SCU, a first DB, a first DCG, and a first MU.
[0121] The first video recording processing module 602 is specifically used for:
[0122] The device parameters of the recording device are sent to the CMU. The device parameters are used to instruct the CMU to notify the first SCU to add the recording device and save the device parameters to the first DB. The device parameters are sent to the first DCG, which logs in to the recording device based on the device parameters. After successful login, the first MU is notified to start recording with the recording device, so that the first SCU returns the device status of the recording device to the first server.
[0123] In one possible implementation, the second server includes a second SCU, a second DB, a second DCG, and a second MU.
[0124] The first video recording processing module 602 is specifically used for:
[0125] Based on the device status of the recording device, a message to delete the recording device is sent to the second SCU. The message to delete the recording device is used to instruct the second SCU to delete the relevant information of the recording device in the second DB, log out of the recording device in the second DCG, and stop the recording device from recording in the second MU.
[0126] In one possible implementation, the second video recording processing module 603 is specifically used for:
[0127] The system controls the third server to add the recording device. After successful addition and the recording device resumes recording, the system determines the time when the third server resumes recording and retrieves the missing recordings from the recordings cached by the recording device based on the recording deadline of the second server and the recording resumption time of the third server.
[0128] In one possible implementation, the second video recording processing module 603 is specifically used for:
[0129] The recording cutoff time of the second server is sent to the third server. The recording cutoff time is used to instruct the third server to determine that there is a recording interruption in the second server, and to retrieve the missing recording from the recording cache of the recording device according to the recording cutoff time and the time when the third server resumes recording.
[0130] In one possible implementation, the state determination module 601 is specifically used for:
[0131] Obtain the performance parameters of the remaining servers in the cluster, excluding the first server and the second server;
[0132] Based on the performance parameters of the remaining servers and the performance parameters of the recording device, the third server to which the recording device is to be migrated is determined in the cluster.
[0133] The apparatus provided in this application embodiment can be used to execute the technical solutions of the above method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0134] Optionally, Figure 7 A schematic diagram of one possible basic hardware architecture of the server described in this application is provided.
[0135] See Figure 7 The server includes at least one processor 701 and a communication interface 703. Optionally, it may also include a memory 702 and a bus 704.
[0136] In the server, the number of processors 701 can be one or more. Figure 7 Only one processor 701 is illustrated. Optionally, processor 701 can be a central processing unit (CPU), a graphics processing unit (GPU), or a digital signal processor (DSP). If the server has multiple processors 701, the types of the multiple processors 701 can be different or the same. Optionally, the multiple processors 701 of the server can also be integrated into a multi-core processor.
[0137] The memory 702 stores computer instructions and data; the memory 702 may store computer instructions and data required to implement the recording method for device migration provided in this application, for example, the memory 702 stores instructions for implementing the steps of the recording method for device migration. The memory 702 may be any one or any combination of the following storage media: non-volatile memory (e.g., read-only memory (ROM), solid-state drive (SSD), hard disk drive (HDD), optical disk), volatile memory.
[0138] The communication interface 703 can provide information input / output for the at least one processor. It may also include any one or any combination of the following devices: a network interface (e.g., an Ethernet interface), a wireless network card, or other devices with network access capabilities.
[0139] Optionally, the communication interface 703 can also be used for data communication between the server and other computing devices or terminals.
[0140] Further optional, Figure 7Bus 704 is represented by a thick line. Bus 704 connects processor 701 to memory 702 and communication interface 703. In this way, through bus 704, processor 701 can access memory 702 and can also use communication interface 703 to exchange data with other computing devices or terminals.
[0141] In this application, the server executes computer instructions stored in memory 702, causing the server to implement the recording method for device migration provided in this application, or causing the server to deploy the recording device for device migration.
[0142] From the perspective of logical functional division, for example, such as Figure 7 As shown, the memory 702 may include a status judgment module 601, a first video recording processing module 602, and a second video recording processing module 603. This inclusion refers only to the fact that the instructions stored in the memory, when executed, can respectively implement the functions of the status judgment module, the first video recording processing module, and the second video recording processing module, and is not limited to the physical structure.
[0143] In addition, the servers mentioned above can, besides being able to, [do something like the ones described above] Figure 7 Besides being implemented through software, it can also be implemented as a hardware module or as a circuit unit through hardware.
[0144] This application provides a computer-readable storage medium, the computer program product including computer instructions that instruct a computing device to execute the recording method for device migration provided in this application.
[0145] This application provides a computer program product, including computer instructions, which are executed by a processor to describe the recording method during device migration.
[0146] This application provides a chip including at least one processor and a communication interface, wherein the communication interface provides information input and / or output to the at least one processor. Furthermore, the chip may also include at least one memory for storing computer instructions. The at least one processor is used to invoke and execute the computer instructions to perform the recording method for device migration provided in this application.
[0147] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0148] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0149] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in a combination of hardware and software functional units.
Claims
1. A recording method during device relocation, characterized in that, The method is applied to a first server, which manages the remaining servers in the cluster besides itself. The method includes: If a migration instruction is received for the recording device of the second server in the cluster, the third server to which the recording device is to be migrated is determined in the cluster, and it is determined whether the status of the second server and the third server is normal. If the second server and the third server are both in normal condition, then the third server is controlled to add the recording device. After the recording device resumes recording, the second server is notified to delete the recording device. If the second server is in an abnormal state and the third server is in a normal state, then obtain the recording cutoff time when the second server stopped recording, control the third server to add the recording device, and after successful addition and the recording device resumes recording, determine the recording resumption time of the third server, and obtain the missing recording from the recording cached by the recording device according to the recording cutoff time and the recording resumption time.
2. The method according to claim 1, characterized in that, The step of controlling the third server to add the recording device, and after successful addition and resumption of recording by the recording device, notifying the second server to delete the recording device includes: The device parameters of the recording device are sent to the third server. The device parameters are used to instruct the third server to add the recording device according to the device parameters. After the recording device resumes recording after successful addition, the device status of the recording device is returned to the first server. Based on the device status of the recording device, a message to delete the recording device is sent to the second server, and the message to delete the recording device is used to instruct the second server to delete the recording device.
3. The method according to claim 2, characterized in that, The third server includes a cluster management unit, a first service control unit, a first database, a first device access gateway, and a first media processing unit; The step of sending the device parameters of the recording device to the third server, wherein the device parameters are used to instruct the third server to add the recording device according to the device parameters, and after successful addition and resumption of recording by the recording device, returning the device status of the recording device to the first server, includes: The device parameters of the recording device are sent to the cluster management unit. The device parameters are used to instruct the cluster management unit to notify the first service control unit to add the recording device according to the device parameters, and to save the device parameters to the first database. The device parameters are sent to the first device access gateway, which logs in to the recording device based on the device parameters. After successful login, the first media processing unit is notified to start recording by the recording device, so that the first service control unit returns the device status of the recording device to the first server.
4. The method according to claim 2, characterized in that, The second server includes a second service control unit, a second database, a second device access gateway, and a second media processing unit; The step of sending information to delete the recording device to the second server based on the device status of the recording device, wherein the information to delete the recording device is used to instruct the second server to delete the recording device, includes: Based on the device status of the recording device, a message to delete the recording device is sent to the second service control unit. The message to delete the recording device is used to instruct the second service control unit to delete the relevant information of the recording device in the second database, log out of the recording device at the second device access gateway, and stop recording by the recording device at the second media processing unit.
5. The method according to any one of claims 1 to 4, characterized in that, The step of determining the third server in the cluster to which the recording device is to be migrated includes: Obtain the performance parameters of the remaining servers in the cluster, excluding the first server and the second server; Based on the performance parameters of the remaining servers and the performance parameters of the recording device, the third server to which the recording device is to be migrated is determined in the cluster.
6. A video recording device for equipment relocation, characterized in that, The device is applied to a first server, which manages the remaining servers in the cluster besides itself. The device includes: The status judgment module is used to determine the third server to which the recording device is to be migrated in the cluster if a migration instruction for the recording device of the second server in the cluster is received, and to determine whether the status of the second server and the third server is normal. The first recording processing module is used to control the third server to add the recording device if the second server is in a normal state and the third server is in a normal state, and to notify the second server to delete the recording device after the addition is successful and the recording device resumes recording. The second recording processing module is used to obtain the recording cutoff time when the second server stops recording if the second server is in an abnormal state and the third server is in a normal state. After controlling the third server to add the recording device and after the addition is successful and the recording device resumes recording, the module determines the recording resumption time of the third server and retrieves the missing recordings from the recordings cached by the recording device based on the recording cutoff time and the recording resumption time.
7. A server, characterized in that, include: processor; Memory; as well as Computer programs; The computer program is stored in the memory and configured to be executed by the processor, the computer program including instructions for performing the method as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that causes the server to perform the method according to any one of claims 1-5.
Citation Information
Patent Citations
Online database migration
CN105359147A
Method and device for processing data in video cloud system
CN106331642A