Operation control method and device of master-slave system, master-slave system and storage medium
Through the main chip, the abnormal situation is monitored and the slave chip restart is controlled, and the intelligent service is transferred to the configurable slave chip, which solves the system restart problem caused by the slave chip abnormality, ensures the normal operation of the intelligent service, and improves the system stability.
Patent Information
- Application Number
- CN202411237602.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2024-12-27
AI Technical Summary
In the master-slave system, when an abnormality occurs in the slave chip, the system needs to be restarted, resulting in the intelligent services on the slave chip being unable to operate normally for a long time. The existing technology has not effectively solved this problem.
Monitor abnormal situations in the system through the main chip, control the slave chip to restart if an abnormality occurs, and during the restart process, the target intelligent service that is in the open state on the chip will be transferred to the configurable slave chip to ensure the normal operation of the intelligent service. .
It realizes avoiding restarting the system when an abnormality occurs in a slave chip, ensuring the normal operation of intelligent services on each slave chip, and improving the fault tolerance and stability of the system.
Smart Images

Figure CN119201523A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of security monitoring technology, and in particular to an operation control method and device for a master-slave system, a master-slave system, and a storage medium. Background Art
[0002] The master chip in the master-slave system can mount multiple slave chips, and the master chip controls the opening of each slave chip service. Each slave chip can open multiple intelligent processes. However, in the existing master-slave system, when the intelligence on the slave chip is abnormal, the system needs to be restarted. Since the system restart takes a long time, the intelligent services on each slave chip cannot operate normally for a long time.
[0003] There is currently no effective solution to the problem that when some slave chips have abnormalities, the system needs to be restarted, resulting in the inability of all intelligent services on the slave chips to operate normally. Summary of the invention
[0004] In this embodiment, a master-slave system operation control method, device, master-slave system and storage medium are provided to solve the problem in the related art that when some slave chips have abnormalities, the system needs to be restarted, resulting in the inability to operate the intelligent services on all slave chips normally.
[0005] In a first aspect, in this embodiment, a method for controlling the operation of a master-slave system is provided, wherein the master-slave system includes a master chip and a plurality of slave chips; the method is applied to the master chip; the method includes:
[0006] Determine the target subject of the anomaly within the system;
[0007] When the target subject is the slave chip, controlling the slave chip in which an abnormality occurs to restart;
[0008] Determine the target smart service that is in an enabled state on the slave chip where the abnormality occurs, and control the slave chip that can configure the target smart service to enable the target smart service;
[0009] The to-be-processed data corresponding to the target smart service is sent to the slave chip that starts the target smart service for processing.
[0010] In some embodiments, when the target subject is the slave chip, controlling the slave chip in which an abnormality occurs to restart includes:
[0011] When the heartbeat packet sent by the slave chip is not received within a preset period, it is determined that the slave chip is abnormal; the heartbeat packet is used to indicate that the slave chip is in a normal state;
[0012] The slave chip in which the abnormality occurs is controlled to be restarted.
[0013] In some embodiments, the determining the target smart service in the enabled state on the slave chip where the abnormality occurs, and controlling the slave chip that can configure the target smart service to enable the target smart service includes:
[0014] Acquire first configuration information corresponding to the slave chip where the exception occurs; the first configuration information is used to indicate a target smart service that is in an enabled state on the slave chip where the exception occurs;
[0015] Selecting the slave chip capable of configuring the target intelligent service as the first slave chip;
[0016] According to the first configuration information, the first slave chip is controlled to start a related process of the target smart service.
[0017] In some embodiments, the selecting the slave chip that can configure the target intelligent service as the first slave chip includes:
[0018] taking the slave chips without abnormality as slave chips to be selected;
[0019] Determine whether the number of smart services in the enabled state on each of the to-be-selected slave chips reaches a preset number;
[0020] The to-be-selected slave chip whose number of the intelligent services in the enabled state does not reach the preset number is selected as the first slave chip.
[0021] In some embodiments, each of the slave chips includes a plurality of intelligent processes; after determining the target subject where an abnormality occurs in the system, the method further includes:
[0022] When the target subject is the intelligent process, the intelligent process in which an abnormality occurs is controlled to be restarted.
[0023] In some embodiments, when the target subject is the intelligent process, controlling the intelligent process in which an abnormality occurs to restart includes:
[0024] When receiving the intelligent abnormality information uploaded from the chip, controlling the intelligent process in which the abnormality occurs to restart according to the intelligent abnormality information;
[0025] The intelligent abnormality information is used to indicate that the slave chip has not received the heartbeat packet sent by the intelligent process within a preset period.
[0026] In some embodiments, after the intelligent process in which the control abnormality occurs is restarted, the process further includes:
[0027] Acquire second configuration information corresponding to the intelligent process in which the exception occurs; the second configuration information is used to indicate the intelligent service category to which the intelligent process in which the exception occurs belongs and the corresponding slave chip;
[0028] When it is detected that the intelligent process that has an exception has been restarted successfully, the corresponding intelligent process is controlled to start according to the second configuration information.
[0029] In a second aspect, in this embodiment, a running control device of a master-slave system is provided, the master-slave system comprises a master chip and a plurality of slave chips; the device is applied to the master chip; the device comprises: a detection module, a control module, a transfer module and a forwarding module;
[0030] The detection module is used to determine the target subject where an abnormality occurs in the system;
[0031] The control module is used for controlling the slave chip in which an abnormality occurs to restart when the target subject is the slave chip;
[0032] The transfer module is used to determine the target smart service that is in an enabled state on the slave chip where the abnormality occurs, and control the slave chip that can be configured with the target smart service to enable the target smart service;
[0033] The forwarding module is used to send the to-be-processed data corresponding to the target intelligent service to the slave chip that starts the target intelligent service for processing.
[0034] In the third aspect, a master-slave system is provided in this embodiment, the system comprising a master chip and multiple slave chips; each of the slave chips comprises multiple intelligent processes; wherein the master chip is used to execute the operation control method of the master-slave system described in the first aspect above.
[0035] In a fourth aspect, a storage medium is provided in this embodiment, on which a computer program is stored, and when the program is executed by a processor, the operation control method of the master-slave system described in the first aspect is implemented.
[0036] Compared with the related art, the operation control method, device, master-slave system and storage medium of the master-slave system provided in this embodiment, wherein the master-slave system includes a master chip and multiple slave chips, and the method is applied to the master chip, by determining the target subject where an abnormality occurs in the system; when the target subject is a slave chip, controlling the slave chip where the abnormality occurs to restart; determining the target smart service that is in an turned-on state on the slave chip where the abnormality occurs; further, controlling the slave chip that can be configured with the target smart service to turn on the target smart service, and sending the to-be-processed data corresponding to the target smart service to the slave chip that turns on the target smart service for processing, thereby solving the problem that the system needs to be restarted when an abnormality occurs in some slave chips, resulting in the inability to operate the smart services on all slave chips normally, and realizing the avoidance of restarting the system when an abnormality occurs in the slave chip, thereby ensuring the normal operation of the smart services on each slave chip.
[0037] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0039] Figure 1 It is a hardware structure block diagram of a terminal device of a method for controlling the operation of a master-slave system provided in an embodiment of the present application;
[0040] Figure 2 is a flow chart of an operation control method of a master-slave system provided by an embodiment of the present application;
[0041] Figure 3 It is a structural block diagram of the operation control system of the master-slave system provided by an embodiment of the present application;
[0042] Figure 4 is a schematic diagram of a keep-alive mechanism for a master-slave system provided in an embodiment of the present application;
[0043] Figure 5 is a schematic diagram of a keep-alive mechanism for a master-slave system provided by another embodiment of the present application;
[0044] Figure 6 It is a flow chart of an operation control method of a master-slave system provided by a preferred embodiment of the present application;
[0045] Figure 7 This is a structural block diagram of an operation control device of a master-slave system provided in an embodiment of the present application.
[0046] Figure 8It is a structural diagram of an operation control system of a master-slave system provided in an embodiment of the present application;
[0047] Fig. 9 It is a structural diagram of an operation control system of a master-slave system provided in another embodiment of the present application.
[0048] In the figure: 102, processor; 104, memory; 106, transmission device; 108, input and output device; 10, detection module; 20, control module; 30, transfer module; 40, forwarding module. DETAILED DESCRIPTION
[0049] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0050] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the", "these" and the like in this application do not represent quantitative restrictions, and they can be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether directly or indirectly. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. Usually, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0051] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 is a hardware structure block diagram of a terminal of the operation control method of the master-slave system of this embodiment. Figure 1 As shown, the terminal may include one or more ( Figure 1Only one is shown in the figure) processor 102 and memory 104 for storing data, wherein processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0052] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the operation control method of the master-slave system in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0053] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by the communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0054] In this embodiment, a method for controlling the operation of a master-slave system is provided. Figure 2 is a flow chart of the operation control method of the master-slave system of this embodiment. Figure 2 As shown, the process includes the following steps:
[0055] Step S210, determining the target subject where an abnormality occurs in the system;
[0056] Step S220, when the target subject is a slave chip, controlling the slave chip where the abnormality occurs to restart;
[0057] Step S230, determining the target intelligent service that is in an enabled state on the slave chip where the abnormality occurs, and controlling the slave chip that can be configured with the target intelligent service to enable the target intelligent service;
[0058] Step S240: Send the to-be-processed data corresponding to the target smart service to the slave chip that starts the target smart service for processing.
[0059] In this embodiment, if Figure 3 As shown, the master-slave system includes a master chip and multiple slave chips. The master chip mounts multiple slave chips. Each slave chip can simultaneously enable multiple intelligent services, such as face recognition, video structuring, and video perimeter algorithms, and each intelligent service in the slave chip has a corresponding intelligent process. The system can access multiple Internet Protocol Cameras (IPCs). When the intelligence needs to be turned on, the master chip determines the slave chip to turn on the intelligence. The master chip process interacts with the slave chip process, wherein the master chip transmits the video stream of the corresponding IPC to the slave chip, and the slave chip decodes the video stream and processes it through an intelligent algorithm, and reports the intelligent processing results to the master chip.
[0060] See also Figure 4 In order to avoid restarting the system when some slave chips are abnormal, the master chip process is equipped with a master chip keep-alive thread, and each slave chip is equipped with a slave chip keep-alive thread, such as a face recognition keep-alive thread, a video structured keep-alive thread, and a video perimeter keep-alive thread, etc. The master and slave keep-alive threads communicate with each other. Based on the preset time interval, the slave chip keep-alive thread in each slave chip sends a heartbeat packet to the master chip keep-alive thread. If the master chip keep-alive thread normally receives the heartbeat packet sent by the slave chip, it indicates that the corresponding slave chip is operating normally. If the master chip keep-alive thread still does not receive the heartbeat packet sent by the slave chip within the preset period, it indicates that the corresponding slave chip is abnormal.
[0061] Specifically, the master chip monitors abnormal conditions in the system. When an abnormality is detected in a slave chip, the slave chip with the abnormality is controlled to restart. During the restart of the abnormal slave chip, the master chip keep-alive thread reports the slave chip abnormality to the business layer in the master chip.
[0062] Furthermore, the business layer obtains the corresponding slave chip configuration information, that is, determines the target intelligent business that is turned on on the slave chip where the exception occurs, and destroys all resources related to the slave chip intelligent business in the master chip, such as the link used for message communication between the master chip and the slave chip when the master chip triggers to turn on the slave chip intelligence. At this time, since it takes a long time to restart the slave chip where the exception occurs, a slave chip that can be configured with the target intelligent business is selected, and the slave chip that can be configured with the target intelligent business is controlled to turn on the target intelligent business, and the pending data corresponding to the target intelligent business is sent to the slave chip that turns on the target intelligent business for processing. It should be noted that when the master chip controls different intelligences to be turned on in different slave chips, the relevant pending data will be transmitted to the corresponding slave chip.
[0063] The slave chip for which the target intelligent service can be configured is a slave chip that operates normally, and the number of intelligent paths of the slave chip is not saturated, that is, the number of intelligent paths enabled in the slave chip is less than the preset number of intelligent paths.
[0064] Afterwards, when the abnormal slave chip comes back online, the slave chip sends a heartbeat packet to the master chip keep-alive thread based on a preset time interval to inform the master chip that the slave chip has completed the online process after restarting, that is, the master chip can communicate normally with the slave chip to start intelligent business.
[0065] Compared with the prior art, the present application determines the target subject where an abnormality occurs in the system through the master chip; when the target subject is a slave chip, controls the slave chip where the abnormality occurs to restart; determines the target intelligent service that is in an open state on the slave chip where the abnormality occurs; further, controls the slave chip that can be configured with the target intelligent service to turn on the target intelligent service, and sends the pending data corresponding to the target intelligent service to the slave chip that turns on the target intelligent service for processing. Based on this, the main chip monitors the operating status of each slave chip. When an abnormality occurs in the slave chip, while controlling the slave chip to restart, the target intelligent service that has been turned on on the slave chip is transferred to the slave chip that can be configured with the target intelligent service. In this way, during the slave chip restart phase, the normal operation of the target intelligent service is guaranteed without restarting the entire system. This solves the problem that when some slave chips have abnormalities, the system needs to be restarted, resulting in the inability of all intelligent services on the slave chips to operate normally. This avoids restarting the system when an abnormality occurs in the slave chip, ensuring the normal operation of the intelligent services on each slave chip.
[0066] In some embodiments, when the target subject is a slave chip, controlling the slave chip in which an abnormality occurs to restart in step S220 includes the following steps:
[0067] Step S221, when no heartbeat packet sent by the slave chip is received within a preset period, it is determined that an abnormality occurs in the slave chip; the heartbeat packet is used to indicate that the slave chip is in a normal state;
[0068] Step S222, controlling the slave chip where the abnormality occurs to restart.
[0069] In this embodiment, based on a preset time interval, the slave chip keep-alive thread in each slave chip sends a heartbeat packet to the master chip keep-alive thread in the master chip. If the master chip keep-alive thread normally receives the heartbeat packet sent by the slave chip, it indicates that the corresponding slave chip is running normally; if the master chip keep-alive thread still does not receive the heartbeat packet sent by the slave chip within the preset period, it indicates that there is an abnormality in the corresponding slave chip.
[0070] For example, under normal circumstances, the slave chip keep-alive thread in the slave chip sends a heartbeat packet to the master chip keep-alive thread every 10 seconds. When the master chip keep-alive thread does not receive the heartbeat packet sent by the slave chip for 30 seconds, it indicates that there is an abnormality in the slave chip.
[0071] Specifically, when the heartbeat packet sent by the slave chip is not received within the preset period, it is determined that an abnormality has occurred in the slave chip, and the slave chip with the abnormality is controlled to restart. During the restart process of the abnormal slave chip, the main chip keep-alive thread will report the slave chip abnormality to the business layer in the main chip, so that the business layer can execute subsequent intelligent business transfer operations in a timely manner.
[0072] Through this embodiment, when the heartbeat packet sent by the slave chip is not received within the preset period, it is determined that an abnormality has occurred in the slave chip. The heartbeat packet is used to indicate that the slave chip is in a normal state and control the slave chip where the abnormality has occurred to restart, so as to accurately monitor the abnormal state of the slave chip and avoid the continued existence of abnormalities in the slave chip, which affects related intelligent processing.
[0073] In some embodiments, the step S230 of determining the target smart service in the enabled state on the slave chip where the abnormality occurs, and controlling the slave chip capable of configurable target smart service to enable the target smart service includes the following steps:
[0074] Step S231, obtaining first configuration information corresponding to the slave chip where the abnormality occurs; the first configuration information is used to indicate the target smart service that is in an enabled state on the slave chip where the abnormality occurs;
[0075] Step S232, selecting a slave chip that can be configured with a target intelligent service as a first slave chip;
[0076] Step S233: According to the first configuration information, control the first slave chip to start the relevant process of the target smart service.
[0077] Specifically, during the restart process of the abnormal slave chip, the master chip keep-alive thread will report the chip exception to the business layer in the master chip, and the business layer obtains the corresponding slave chip configuration information, that is, the first configuration information corresponding to the slave chip where the exception occurs. The first configuration information is used to indicate the target intelligent business that is in an turned-on state on the slave chip where the exception occurs. At the same time, all resources related to the slave chip intelligent business in the master chip are destroyed, such as the link used for message communication between the master chip and the slave chip when the master chip triggers to turn on the slave chip intelligence, and the storage resources related to the slave chip intelligence.
[0078] Furthermore, according to the first configuration information, the target smart service that is turned on on the slave chip where the abnormality occurs is determined, a slave chip that can configure the target smart service is selected as the first slave chip, and according to the first configuration information, the first slave chip is controlled to turn on the relevant process of the target smart service.
[0079] Through this embodiment, the first configuration information corresponding to the slave chip where the exception occurs is obtained, the first configuration information is used to indicate the target intelligent service that is in an turned-on state on the slave chip where the exception occurs, and the slave chip that can be configured with the target intelligent service is selected as the first slave chip, and the relevant process of turning on the target intelligent service by the first slave chip is controlled according to the first configuration information, so that the intelligent service that has been turned on on the abnormal slave chip is transferred to other normal slave chips, thereby ensuring the normal operation of the intelligent service on the abnormal slave chip during the restart of the abnormal slave chip, thereby improving the fault tolerance and stability of the system.
[0080] In some embodiments, the step S232 of selecting a slave chip that can configure a target intelligent service as the first slave chip includes the following steps:
[0081] Each slave chip that has no abnormality is used as a slave chip to be selected;
[0082] Determine whether the number of smart services in the enabled state on each to-be-selected slave chip reaches a preset number;
[0083] A slave chip to be selected whose number of enabled smart services does not reach a preset number is selected as the first slave chip.
[0084] Specifically, each slave chip currently in normal operation is used as a slave chip to be selected, the number of smart services in the enabled state on each slave chip to be selected is obtained, and it is determined whether the number of smart services in the enabled state on each slave chip to be selected reaches a preset number. The preset number refers to the maximum number of smart services allowed to be enabled on the slave chip to be selected.
[0085] Further, a candidate slave chip whose number of smart services in the enabled state does not reach the preset number is selected as the first slave chip. For example, the candidate slave chip A is in a normal operating state, and the number of smart services currently enabled on the candidate slave chip A is 4, and the preset number is 8, which indicates that the candidate slave chip A can be configured with the target smart service, and the candidate slave chip A is selected as the first slave chip.
[0086] It should be noted that, based on whether the number of enabled smart services reaches the preset number, the first slave chip for configuring the target smart service is selected, and further screening can be performed based on the target ratio of the preset number to the number of enabled smart services, and the slave chip with a larger target ratio is selected as the first slave chip. Exemplarily, the selected slave chip B and the selected slave chip C are in normal operation, the number of enabled smart services on the selected slave chip B is 4, the preset number is 8, and the number of enabled smart services on the selected slave chip C is 4, the preset number is 16, and the target ratio of the selected slave chip C is greater than that of the selected slave chip B, and then the selected slave chip C is selected as the first slave chip, so as to balance the distribution of smart services between the slave chips, optimize resource utilization, and improve the stability of the system.
[0087] Through this embodiment, each slave chip that has not experienced any abnormality is used as a slave chip to be selected, and it is determined whether the number of smart services in an enabled state on each slave chip to be selected has reached a preset number, and the slave chip to be selected whose number of smart services in an enabled state has not reached the preset number is selected as the first slave chip, which helps to achieve a stable transfer of smart services and ensure that the smart services can operate normally after the transfer.
[0088] In some of the embodiments, each slave chip includes a plurality of intelligent processes; after determining the target subject where an abnormality occurs in the system, the operation control method of the master-slave system further includes the following steps:
[0089] When the target subject is an intelligent process, the intelligent process in which an abnormality occurs is controlled to be restarted.
[0090] In this embodiment, each slave chip in the system can simultaneously start multiple intelligent services, such as face recognition, video structuring, and video perimeter algorithm, and each intelligent service has a corresponding intelligent process. Figure 5 In order to avoid restarting the entire system when an exception occurs in some intelligent processes, each slave chip is equipped with a slave keep-alive thread, and each intelligent process under the slave chip is equipped with an intelligent keep-alive thread, such as a face recognition keep-alive thread, a video structured keep-alive thread, and a video perimeter keep-alive thread, etc. The slave keep-alive threads and the intelligent keep-alive threads communicate with each other.
[0091] Specifically, based on a preset time interval, each intelligent keep-alive thread sends a heartbeat packet to the corresponding slave keep-alive thread. If the slave keep-alive thread normally receives the heartbeat packet sent by the intelligent keep-alive thread, it indicates that the intelligent process corresponding to the intelligent keep-alive thread is running normally. If the slave keep-alive thread still does not receive the heartbeat packet sent by the intelligent keep-alive thread within the preset period, it indicates that the corresponding intelligent process has an abnormality.
[0092] Exemplarily, under normal circumstances, the intelligent keep-alive thread in the slave chip sends a heartbeat packet to the corresponding slave chip keep-alive thread every 10 seconds. If the slave chip keep-alive thread does not receive the heartbeat packet sent by the intelligent keep-alive thread for 30 seconds, it indicates that there is an abnormality in the intelligent process corresponding to the intelligent keep-alive thread.
[0093] Furthermore, when the slave chip keep-alive thread does not receive the heartbeat packet sent by the intelligent process within a preset period, the intelligent exception information indicating that there is an abnormality in the intelligent process is uploaded to the main chip, and the main chip controls the corresponding abnormal intelligent process to restart according to the intelligent exception information.
[0094] Through this embodiment, when the target subject is an intelligent process, the intelligent process in which the abnormality occurs is controlled to be restarted, thereby eliminating the need to restart the entire system, avoiding affecting the intelligent services on the current slave chip and other slave chips, improving the fault tolerance of the system, and optimizing system performance.
[0095] In some of the embodiments, when the target subject is an intelligent process, controlling the intelligent process in which an abnormality occurs to restart includes the following steps:
[0096] When receiving the intelligent abnormality information uploaded from the chip, the intelligent process where the abnormality occurs is controlled to restart according to the intelligent abnormality information;
[0097] Among them, the intelligent abnormality information is used to indicate that the slave chip has not received the heartbeat packet sent by the intelligent process within a preset period.
[0098] Specifically, when an abnormality occurs in an intelligent process, the slave chip where the abnormal intelligent process is located uploads corresponding intelligent abnormality information to the master chip keep-alive process through the slave chip keep-alive thread, wherein the intelligent abnormality information is used to indicate that the slave chip has not received the heartbeat packet sent by the intelligent process within a preset period, so as to inform the master chip that the intelligent process is abnormal.
[0099] Furthermore, when the main chip keep-alive process receives the intelligent exception information uploaded from the chip, the intelligent process that is currently abnormal is determined according to the intelligent exception information, and the abnormal intelligent process is controlled to restart.
[0100] Through this embodiment, when the intelligent exception information uploaded from the chip is received, the intelligent process where the exception occurs is controlled to restart according to the intelligent exception information, wherein the intelligent exception information is used to indicate that the chip has not received the heartbeat packet sent by the intelligent process within a preset period. The heartbeat packet mechanism is used to detect whether an exception occurs in each intelligent process, thereby accurately monitoring the status of each intelligent process.
[0101] In some of the embodiments, after controlling the abnormal intelligent process to restart, the following steps are also included:
[0102] Acquire second configuration information corresponding to the abnormal intelligent process; the second configuration information is used to indicate the intelligent service category to which the abnormal intelligent process belongs and the corresponding slave chip;
[0103] When it is detected that the intelligent process with an abnormality has been restarted successfully, the corresponding intelligent process is controlled to start according to the second configuration information.
[0104] Specifically, after the abnormal intelligent process is restarted, the main chip keep-alive thread reports the intelligent abnormal information to the business layer of the main chip. The business layer obtains the second configuration information related to the abnormal intelligent process, which is used to indicate the intelligent business category and slave chip to which the abnormal intelligent process belongs, and destroys all resources in the main chip related to the abnormal intelligent process on the slave chip.
[0105] Furthermore, when the abnormal intelligent process is restarted successfully, a heartbeat packet is sent to the slave chip keep-alive thread based on a preset time interval, and the message of successful restart of the abnormal intelligent process is reported to the master chip keep-alive thread and the business layer in sequence through the slave chip keep-alive thread to inform the master chip that the abnormal intelligent process has been completed online after the restart, that is, the master chip can re-send the intelligent business to the corresponding slave chip, and send the pending data related to the intelligent business to the slave chip. The pending data is decoded and transmitted to the corresponding intelligent process for processing.
[0106] It should be noted that since the restart time of the intelligent process is short, there is no need to transfer the relevant intelligent services to other slave chips during the restart of the intelligent process. Based on the monitored intelligent process status, the abnormal intelligent process can be automatically restarted, intelligently re-issued, and other operations can be quickly realized, giving the system user a good experience.
[0107] Through this embodiment, the second configuration information corresponding to the intelligent process where the abnormality occurs is obtained, and the second configuration information is used to indicate the intelligent business category and the corresponding slave chip to which the intelligent process where the abnormality occurs belongs. When it is detected that the intelligent process where the abnormality occurs is restarted successfully, the corresponding intelligent process is controlled to be started according to the second configuration information, so as to accurately control the intelligent process to be started again after the successful restart, thereby ensuring the normal operation of each intelligent process, avoiding affecting related intelligent processing, and improving user experience.
[0108] The present embodiment is described and illustrated below through preferred embodiments.
[0109] Figure 6 is a flow chart of the operation control method of the master-slave system of the preferred embodiment. Figure 6 As shown, the operation control method of the master-slave system includes the following steps:
[0110] Step S610, when no heartbeat packet sent by the slave chip is received within a preset period, it is determined that an abnormality occurs in the slave chip; the heartbeat packet is used to indicate that the slave chip is in a normal state;
[0111] Step S620, controlling the slave chip where the abnormality occurs to restart;
[0112] Step S630, obtaining first configuration information corresponding to the slave chip where the abnormality occurs; the first configuration information is used to indicate the target smart service that is in an enabled state on the slave chip where the abnormality occurs;
[0113] Step S640, selecting a slave chip that can be configured with a target intelligent service as a first slave chip;
[0114] Step S650, controlling the first slave chip to start the relevant process of the target smart service according to the first configuration information;
[0115] Step S660: Send the to-be-processed data corresponding to the target smart service to the first slave chip for processing.
[0116] Through this embodiment, when the heartbeat packet sent by the slave chip is not received within a preset period, it is determined that an abnormality has occurred in the slave chip, the slave chip where the abnormality has occurred is controlled to restart, and the first configuration information corresponding to the slave chip where the abnormality has occurred is obtained. The first configuration information is used to indicate the target intelligent service that is in an turned-on state on the slave chip where the abnormality has occurred.
[0117] Furthermore, a slave chip that can be configured with a target intelligent service is selected as the first slave chip, and according to the first configuration information, the first slave chip is controlled to start the relevant process of the target intelligent service, and then the to-be-processed data corresponding to the target intelligent service is sent to the first slave chip for processing. This solves the problem that when some slave chips have abnormalities, the system needs to be restarted, resulting in the inability to operate the intelligent services on all slave chips normally. This avoids restarting the system when an abnormality occurs in the slave chip, and ensures the normal operation of the intelligent services on each slave chip.
[0118] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0119] In this embodiment, a master-slave system operation control device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. The terms "module", "unit", "subunit" and the like used below can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0120] Figure 7 is a structural block diagram of the operation control device of the master-slave system of this embodiment, such as Figure 7 As shown, the device includes: a detection module 10, a control module 20, a transfer module 30 and a forwarding module 40;
[0121] Detection module 10, used to determine the target subject where an abnormality occurs in the system;
[0122] The control module 20 is used to control the slave chip where an abnormality occurs to restart when the target subject is a slave chip;
[0123] The transfer module 30 is used to determine the target intelligent service in the enabled state on the slave chip where the abnormality occurs, and control the slave chip that can configure the target intelligent service to enable the target intelligent service;
[0124] The forwarding module 40 is used to send the to-be-processed data corresponding to the target intelligent service to the slave chip that starts the target intelligent service for processing.
[0125] Through the device provided in this embodiment, the target subject where the abnormality occurs in the system is determined; when the target subject is a slave chip, the slave chip where the abnormality occurs is controlled to restart; the target intelligent service that is in an enabled state on the slave chip where the abnormality occurs is determined; further, the slave chip that can be configured with the target intelligent service is controlled to enable the target intelligent service, and the to-be-processed data corresponding to the target intelligent service is sent to the slave chip that enables the target intelligent service for processing, thereby solving the problem that the system needs to be restarted when an abnormality occurs in some slave chips, resulting in the inability to operate the intelligent services on all slave chips normally. This achieves the goal of avoiding restarting the system when an abnormality occurs in the slave chip, and ensuring the normal operation of the intelligent services on each slave chip.
[0126] In some of the embodiments, the control module 20 is also used to determine that an abnormality has occurred in the slave chip when no heartbeat packet sent by the slave chip is received within a preset period; the heartbeat packet is used to indicate that the slave chip is in a normal state; and the slave chip with the abnormality is controlled to restart.
[0127] In some of the embodiments, the transfer module 30 is also used to obtain first configuration information corresponding to the slave chip where the exception occurs; the first configuration information is used to indicate a target smart service that is in an turned-on state on the slave chip where the exception occurs; a slave chip that can be configured with the target smart service is selected as the first slave chip; and according to the first configuration information, the first slave chip is controlled to start the relevant process of the target smart service.
[0128] In some of the embodiments, the transfer module 30 is also used to select each slave chip that has not experienced an abnormality as a slave chip to be selected; determine whether the number of smart services in an enabled state on each slave chip to be selected has reached a preset number; and select a slave chip to be selected whose number of smart services in an enabled state does not reach a preset number as the first slave chip.
[0129] In some of the embodiments, the control module 20 is also used to control the intelligent process in which an abnormality occurs to restart when the target subject is an intelligent process.
[0130] In some of the embodiments, the control module 20 is also used to control the restart of the intelligent process where the abnormality occurs according to the intelligent exception information when the intelligent exception information uploaded from the chip is received; wherein the intelligent exception information is used to indicate that the heartbeat packet sent by the intelligent process has not been received from the chip within a preset period.
[0131] In some of the embodiments, the transfer module 30 is also used to obtain second configuration information corresponding to the intelligent process where the abnormality occurs; the second configuration information is used to indicate the intelligent business category and the corresponding slave chip to which the intelligent process where the abnormality occurs belongs; when it is detected that the intelligent process where the abnormality occurs is restarted successfully, the corresponding intelligent process is controlled to start according to the second configuration information.
[0132] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0133] In this embodiment, a master-slave system is also provided, which includes a master chip and multiple slave chips, each slave chip includes multiple intelligent processes; wherein the master chip is used to execute the steps in any of the above method embodiments.
[0134] Specifically, the master-slave system includes a master chip and multiple slave chips. The master chip mounts multiple slave chips. Each slave chip can simultaneously enable multiple intelligent services, such as face recognition, video structuring, and video perimeter algorithms, and each intelligent service in the slave chip has a corresponding intelligent process.
[0135] The above-mentioned master-slave system can be connected to multiple IPCs. When the intelligence needs to be turned on, the master chip determines the slave chip to turn on the intelligence, and the master chip process interacts with the slave chip process. The master chip transmits the video code stream of the corresponding IPC to the slave chip. The slave chip decodes the video code stream and processes it through an intelligent algorithm, and reports the intelligent processing results to the master chip.
[0136] Among them, Figure 8 As shown, the master chip process is provided with a master chip keep-alive thread, and each slave chip is provided with a slave chip keep-alive thread, and the master and slave keep-alive threads communicate with each other. Based on a preset time interval, the slave chip keep-alive thread in each slave chip sends a heartbeat packet to the master chip keep-alive thread. If the master chip keep-alive thread normally receives the heartbeat packet sent by the slave chip, it indicates that the corresponding slave chip is running normally. If the master chip keep-alive thread still does not receive the heartbeat packet sent by the slave chip within the preset period, it indicates that the corresponding slave chip is abnormal.
[0137] It should be noted that, in addition to the main chip keep-alive thread, the main chip also includes a business layer and an intelligent switch module. The business layer is connected to the main chip keep-alive thread and the intelligent switch module respectively, wherein the intelligent switch module is responsible for the opening and closing of each intelligent business to accurately select the slave chip used to turn on the intelligence. When the main chip detects that an abnormality has occurred in the slave chip, it controls the slave chip with the abnormality to restart. During the restart process of the abnormal slave chip, the main chip keep-alive thread will report the chip abnormality to the business layer. At this time, the business layer obtains the corresponding slave chip configuration information, that is, determines the target intelligent business that is in the turned-on state on the slave chip with the abnormality, and destroys all resources related to the intelligent business of the slave chip in the main chip.
[0138] Further, a slave chip that can be configured with a target smart service is selected, the slave chip that can be configured with a target smart service is controlled to start the target smart service, and the to-be-processed data corresponding to the target smart service is sent to the slave chip that starts the target smart service for processing.
[0139] In addition, if Fig. 9 As shown, each intelligent process under the slave chip is provided with an intelligent keep-alive thread, for example, slave chip 1 includes intelligent keep-alive thread 1 and intelligent keep-alive thread 2, and slave chip 2 includes intelligent keep-alive thread 3 and intelligent keep-alive thread 4, and the intelligent keep-alive threads and the corresponding slave keep-alive threads communicate with each other. Based on a preset time interval, each intelligent keep-alive thread sends a heartbeat packet to the corresponding slave keep-alive thread. If the slave keep-alive thread normally receives the heartbeat packet sent by the intelligent keep-alive thread, it indicates that the intelligent process corresponding to the intelligent keep-alive thread is running normally. If the slave keep-alive thread still does not receive the heartbeat packet sent by the intelligent keep-alive thread within the preset period, it indicates that the corresponding intelligent process is abnormal.
[0140] Accordingly, when an abnormality occurs in an intelligent process, the abnormal intelligent process is controlled to be restarted, and the master chip keep-alive thread reports the received intelligent abnormality information to the business layer of the master chip. The business layer obtains the configuration information related to the abnormal intelligent process to determine the intelligent business category and slave chip to which the abnormal intelligent process belongs, and destroys all resources in the master chip related to the abnormal intelligent process on the slave chip.
[0141] Through this embodiment, when the target subject is a slave chip, the slave chip where the exception occurs is controlled to restart, the target intelligent service that is in an turned-on state on the slave chip where the exception occurs is determined, the slave chip that can be configured with the target intelligent service is controlled to turn on the target intelligent service, and the pending data corresponding to the target intelligent service is sent to the slave chip that turns on the target intelligent service for processing; when the target subject is an intelligent process, the intelligent process where the exception occurs is controlled to restart, which solves the problem that the system needs to be restarted when an exception occurs in some slave chips or intelligent processes, resulting in the inability to operate various intelligent services normally, and effectively improves the stability of the system.
[0142] In this embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0143] Optionally, the computer device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0144] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0145] S1, determine the target subject where the anomaly occurs in the system;
[0146] S2, when the target subject is a slave chip, controlling the slave chip where the abnormality occurs to restart;
[0147] S3, determining the target intelligent service that is in an enabled state on the slave chip where the abnormality occurs, and controlling the slave chip that can be configured with the target intelligent service to enable the target intelligent service;
[0148] S4, sending the to-be-processed data corresponding to the target intelligent service to the slave chip that starts the target intelligent service for processing.
[0149] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.
[0150] In addition, in combination with the operation control method of the master-slave system provided in the above embodiments, a storage medium can also be provided in this embodiment to implement the operation control method of the master-slave system. The storage medium stores a computer program; when the computer program is executed by the processor, any of the operation control methods of the master-slave system in the above embodiments is implemented.
[0151] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.
[0152] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.
[0153] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.
[0154] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.
Claims
1. A method for controlling the operation of a master-slave system, characterized in that: The master-slave system includes a master chip and a plurality of slave chips; the method is applied to the master chip; the method includes: Determine the target subject of the anomaly within the system; When the target subject is the slave chip, controlling the slave chip in which an abnormality occurs to restart; Determine the target smart service that is in an enabled state on the slave chip where the abnormality occurs, and control the slave chip that can configure the target smart service to enable the target smart service; The to-be-processed data corresponding to the target smart service is sent to the slave chip that starts the target smart service for processing.
2. The operation control method of the master-slave system according to claim 1, characterized in that: When the target subject is the slave chip, controlling the slave chip in which an abnormality occurs to restart includes: When the heartbeat packet sent by the slave chip is not received within a preset period, it is determined that the slave chip is abnormal; the heartbeat packet is used to indicate that the slave chip is in a normal state; The slave chip in which the abnormality occurs is controlled to be restarted.
3. The operation control method of the master-slave system according to claim 1, characterized in that: The step of determining the target smart service in the enabled state on the slave chip where the abnormality occurs, and controlling the slave chip that can configure the target smart service to enable the target smart service includes: Acquire first configuration information corresponding to the slave chip where the exception occurs; the first configuration information is used to indicate a target smart service that is in an enabled state on the slave chip where the exception occurs; Selecting the slave chip capable of configuring the target intelligent service as the first slave chip; According to the first configuration information, the first slave chip is controlled to start a related process of the target smart service.
4. The operation control method of the master-slave system according to claim 3, characterized in that: The selecting the slave chip that can configure the target intelligent service as the first slave chip includes: taking the slave chips without abnormality as slave chips to be selected; Determine whether the number of smart services in the enabled state on each of the to-be-selected slave chips reaches a preset number; The to-be-selected slave chip whose number of the intelligent services in the enabled state does not reach the preset number is selected as the first slave chip.
5. The operation control method of the master-slave system according to claim 1, characterized in that: Each of the slave chips includes a plurality of intelligent processes; after determining the target subject where an abnormality occurs in the system, the method further includes: When the target subject is the intelligent process, the intelligent process in which an abnormality occurs is controlled to be restarted.
6. The operation control method of the master-slave system according to claim 5, characterized in that: When the target subject is the intelligent process, controlling the intelligent process in which an abnormality occurs to restart includes: When receiving the intelligent abnormality information uploaded from the chip, controlling the intelligent process in which the abnormality occurs to restart according to the intelligent abnormality information; The intelligent abnormality information is used to indicate that the slave chip has not received the heartbeat packet sent by the intelligent process within a preset period.
7. The operation control method of the master-slave system according to claim 5, characterized in that: After the intelligent process in which the control abnormality occurs is restarted, the method further includes: Acquire second configuration information corresponding to the intelligent process in which the exception occurs; the second configuration information is used to indicate the intelligent service category to which the intelligent process in which the exception occurs belongs and the corresponding slave chip; When it is detected that the intelligent process that has an exception has been restarted successfully, the corresponding intelligent process is controlled to start according to the second configuration information.
8. An operation control device for a master-slave system, characterized in that: The master-slave system includes a master chip and a plurality of slave chips; the device is applied to the master chip; the device includes: a detection module, a control module, a transfer module and a forwarding module; The detection module is used to determine the target subject where an abnormality occurs in the system; The control module is used for controlling the slave chip in which an abnormality occurs to restart when the target subject is the slave chip; The transfer module is used to determine the target smart service that is in an enabled state on the slave chip where the abnormality occurs, and control the slave chip that can be configured with the target smart service to enable the target smart service; The forwarding module is used to send the to-be-processed data corresponding to the target intelligent service to the slave chip that starts the target intelligent service for processing.
9. A master-slave system, characterized in that: The system includes a master chip and multiple slave chips; each of the slave chips includes multiple intelligent processes; wherein the master chip is used to execute the steps of the operation control method of the master-slave system described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the operation control method of the master-slave system according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Equipment control method and system and cascade system
CN119472453A