CN109462646B - Abnormal response method and equipment - Google Patents
Abnormal response method and equipment Download PDFInfo
- Publication number
- CN109462646B CN109462646B CN201811339833.5A CN201811339833A CN109462646B CN 109462646 B CN109462646 B CN 109462646B CN 201811339833 A CN201811339833 A CN 201811339833A CN 109462646 B CN109462646 B CN 109462646B
- Authority
- CN
- China
- Prior art keywords
- service
- terminal
- instruction
- service terminal
- coding
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/51—Discovery or management thereof, e.g. service location protocol [SLP] or web services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0654—Management of faults, events, alarms or notifications using network fault recovery
- H04L41/0663—Performing the actions predefined by failover planning, e.g. switching to standby network elements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The invention is suitable for the technical field of communication, and provides a method and equipment for abnormal response, which comprises the following steps: if receiving an equipment starting instruction, executing an equipment starting process, and detecting whether a first coding instruction is received within a preset starting time threshold value; if the first coding instruction is received within the starting time threshold, setting a local number based on the equipment number; generating a second coding instruction according to the local number, and broadcasting the second coding instruction in the local area network; if the coding completion instruction is received in the effective waiting period, identifying the second service terminal as a related backup terminal; and if the local current moment meets the preset abnormal triggering condition, sending each service request processed currently and the service data of the service request to the associated backup terminal. The invention can forward the service request and the service data of the service request to the associated backup terminal for response continuously without executing the operated process again by the user, thereby improving the service response efficiency.
Description
Technical Field
The invention belongs to the technical field of communication, and particularly relates to a method and equipment for abnormal response.
Background
With the continuous development of intellectualization and automation, a user can often finish the service through a service terminal without the intervention of an entity salesman when handling the service, thereby reducing the labor cost and improving the efficiency of service response. However, in the existing service response technology, when a user uses a terminal device to handle related services, if the terminal device fails or is abnormal and the service response is terminated, the user needs to re-execute a service handling process on another terminal device, and the processed operation also needs to be re-responded, so that the success rate and processing efficiency of the service response are reduced, and the service handling time of the user is prolonged.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and a device for abnormal response, so as to solve the problem that, in the existing abnormal response technology, when a terminal device is abnormal, a user needs to re-respond to an already operated service flow, thereby reducing the success rate and processing efficiency of service response and prolonging the service transaction time of the user.
A first aspect of an embodiment of the present invention provides a method for abnormal response, including:
if receiving an equipment starting instruction, executing an equipment starting process, and detecting whether a first coding instruction is received within a preset starting time threshold value; the first coding instruction carries a device number of a first service terminal which sends the coding instruction;
if the first coding instruction is received within the starting time threshold, setting a local number based on the equipment number;
generating a second coding instruction according to the local number, and broadcasting the second coding instruction in a local area network so that any second service terminal executing the starting process sets the equipment number of the second service terminal based on the second coding instruction;
if a coding completion instruction returned by the second service terminal based on the second coding instruction is received in an effective waiting period, identifying the second service terminal as a related backup terminal;
and if the local current moment meets a preset abnormal triggering condition, sending each service request which is processed currently and the service data of the service request to the associated backup terminal so that the associated backup terminal responds to each service request based on the service data.
A second aspect of an embodiment of the present invention provides an apparatus for exception response, including:
the device starting unit is used for executing a device starting process if a device starting instruction is received, and detecting whether a first coding instruction is received within a preset starting time threshold value; the first coding instruction carries a device number of a first service terminal which sends the coding instruction;
a local number setting unit, configured to set a local number based on the device number if the first encoding instruction is received within the start time threshold;
the coding instruction broadcasting unit is used for generating a second coding instruction according to the local number and broadcasting the second coding instruction in a local area network so as to enable any second service terminal executing the starting process to set the equipment number of the second service terminal based on the second coding instruction;
the associated backup terminal identification unit is used for identifying the second service terminal as an associated backup terminal if a coding completion instruction returned by the second service terminal based on the second coding instruction is received in an effective waiting period;
and the exception response unit is used for sending each service request processed currently and service data of the service request to the associated backup terminal if the local current time meets a preset exception triggering condition so as to enable the associated backup terminal to respond to each service request based on the service data.
A third aspect of embodiments of the present invention provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the first aspect when executing the computer program.
A fourth aspect of embodiments of the present invention provides a computer-readable storage medium storing a computer program which, when executed by a processor, performs the steps of the first aspect.
The method and the equipment for the abnormal response provided by the embodiment of the invention have the following beneficial effects:
the embodiment of the invention monitors whether a first coding instruction exists or not during starting, sets a local number based on the first coding instruction, generates a second coding instruction according to the local number after the starting is finished, and is used for equipment coding of a subsequently started service terminal, so that all service terminals in a local area network form an equipment chain, the service terminal of the next node is used as an associated backup terminal, and when an abnormal event is detected, the service request and the service data of the service request can be forwarded to the associated backup terminal for continuing to respond without the need of a user to execute an operated process again, thereby improving the service response efficiency and reducing the service operation duration. On the other hand, the mode does not need to introduce a server, and the service terminals in the formed equipment chain form a mutual backup relationship, so that the manufacturing cost of the service response system is reduced, and the overall robustness of the system is also improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a flowchart of an implementation of a method for exception response according to a first embodiment of the present invention;
fig. 2 is a flowchart of a specific implementation of a method for responding to an exception according to a second embodiment of the present invention;
fig. 3 is a flowchart of a specific implementation of a method for responding to an exception according to a third embodiment of the present invention;
fig. 4 is a flowchart illustrating a specific implementation of a method for responding to an exception according to a fourth embodiment of the present invention;
fig. 5 is a flowchart of a specific implementation of a method for responding to an exception according to a fifth embodiment of the present invention;
FIG. 6 is a block diagram of an exception response apparatus according to an embodiment of the present invention;
fig. 7 is a schematic diagram of a terminal device according to another embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the invention monitors whether a first coding instruction exists or not during starting, sets a local number based on the first coding instruction, generates a second coding instruction according to the local number after the starting is finished, and is used for equipment coding of a subsequently started service terminal, so that all service terminals in a local area network form an equipment chain, the service terminal of the next node is used as an associated backup terminal, when an abnormal event is detected, the service request and the service data of the service request can be forwarded to the associated backup terminal for continuous response, the technology of abnormal response is solved, when the terminal equipment is abnormal, a user needs to re-respond to the operated service flow, the success rate and the processing efficiency of the service response are reduced, and the problem of service handling time of the user is prolonged.
In the embodiment of the invention, the execution subject of the process is the terminal equipment. The terminal devices include but are not limited to: and devices such as servers, computers, smart phones and tablet computers capable of executing abnormal response operations. Particularly, the terminal device may be a terminal placed in a service handling website, and a user may perform service handling through the terminal in the service handling website, thereby achieving the purpose of self-service handling. Fig. 1 shows a flowchart of an implementation of the method for exception response provided by the first embodiment of the present invention, which is detailed as follows:
in S101, if an equipment starting instruction is received, executing an equipment starting process, and detecting whether a first coding instruction is received within a preset starting time threshold value; the first coding instruction carries a device number of a first service terminal sending the coding instruction.
In this embodiment, a plurality of terminal devices for users to self-service services may be configured in the service handling website, and an administrator may send a device start instruction to each terminal device at a preset start time interval, that is, only one terminal device may be sent a device start instruction at the same time. Specifically, the administrator can send a device start instruction to the terminal device by clicking an open button on the body of the terminal device. Optionally, after the terminal device executes the shutdown operation, a monitoring thread of the device start instruction is reserved for detecting whether the upper computer server sends the device start instruction to the local terminal, and except for the monitoring thread, other processes and programs are all in a closed state. Through the mode, the terminal equipment can reduce energy consumption in the closed state, can also respond to the remote start instruction of the upper computer in real time, and improves the operation efficiency of the terminal equipment.
In this embodiment, in the process of executing the start-up procedure, the terminal device may first start up an encoding instruction monitoring thread to receive the first encoding instruction sent by the other started service terminals. Specifically, the starting process refers to that the terminal device loads a system file, constructs a service system of the service terminal, and starts a plurality of threads to run a preset application program. It should be noted that the encoding instruction monitoring thread is independent of the start-up process, that is, one thread that is parallel to the start-up thread in the main process of the terminal device, and performs the monitoring operation of the encoding instruction during the start-up operation.
In this embodiment, the service terminal in the lan includes a terminal device, and after the start is completed and the device code of the service terminal is configured, the service terminal broadcasts a first coding instruction in the lan, so that the service terminal that is started later can configure the local device code according to the first coding instruction. Therefore, after the terminal device provided in this embodiment is started, if the first encoding instruction of the first service terminal is received, the relevant operation of S102 is executed; otherwise, if the first coding instruction of the first service terminal is not received, the first coding instruction is continuously monitored within the preset starting time threshold.
Optionally, if the first coding instruction is received within a preset starting time threshold, a coding configuration request may be sent to the terminal of the administrator, so that the administrator performs a manual local number setting operation on the terminal device.
In S102, if the first encoding instruction is received within the starting time threshold, a local number is set based on the device number.
In this embodiment, when the terminal device receives the first coding instruction sent by the first service terminal within the start time threshold, it may identify that the first service terminal is an upper node of the terminal device, extract the device number of the first service terminal described in the first coding instruction, and set the local number based on the device code, optionally, the terminal device may add 1 on the basis of the device number, for example, if the device number of the first service terminal is 3, the local number of the terminal device is 4.
Optionally, after the terminal device completes configuration of the local number, a communication link with the first service terminal is established, and a coding completion instruction is returned to the first service terminal, and after the first service terminal receives the coding completion instruction returned by the terminal device, the terminal device is identified as an associated backup terminal of the first service terminal, and when the first service terminal sends an exception, all local currently-processed service requests may be responded to by the terminal device.
Preferably, after the terminal device establishes the communication link between the first service terminals, the first service terminal sends heartbeat packets to the terminal device at preset heartbeat time intervals, so that the validity of the communication link can be maintained, on the other hand, the terminal device can also monitor whether an abnormal event occurs at the first service terminal, and when an abnormal event occurs, the abnormal service request currently processed by the first service terminal and the service data associated with the service request can be retrieved from the first service terminal through the communication link.
In S103, a second coding instruction is generated according to the local number, and the second coding instruction is broadcasted in the local area network, so that any second service terminal executing the start process sets the device number of the second service terminal based on the second coding instruction.
In this embodiment, after the terminal device configures the local number, a second coding instruction is generated, where the second coding instruction carries the local number of the terminal device, and the second coding instruction is broadcast in the local area network, so that a subsequently started second service terminal can monitor the second coding instruction in a starting process, and the device number of the second service terminal is configured based on the local number in the second coding instruction. Therefore, through the operations of S101 to S103, all service terminals in the local area network, including the terminal device provided in this embodiment, may configure a local number according to the device number of the service terminal started previously, and then generate a second coding instruction according to the local number, so that the service terminal started later may set its own device number on the basis of the local number, thereby forming a device chain.
For example, the device number of the service terminal a is 1, after the local number configuration of the service terminal a is completed, a first coding instruction is generated, at this time, the service terminal B enters a start process, because only one service terminal is in the start process at the same time in the local area network, at this time, only the service terminal B receives the first coding instruction sent by the service terminal a, thereby configuring the device number of the service terminal B to be 2, and then the service terminal B also generates a second coding instruction, at this time, the service terminal C enters the start process, and sets the device number of the service terminal C based on the second coding instruction to be 3, and so on.
It should be noted that, in the process of configuring the local number, the terminal device may still be in a start-up flow, that is, loading the service system and starting the application program, in this case, after receiving the first encoding instruction, the terminal device may modify the local EPROM, that is, the storage unit for storing the local number, through the encoding instruction monitoring thread, where the storage unit is a fixed value in the process of this start-up, and will not be changed until the next time the terminal device is started up or logs out of the local area network abnormally. Similarly, after the terminal device finishes setting the local code, the terminal device may still generate the second coding instruction through the coding instruction monitoring thread and execute the broadcast operation, and meanwhile, the terminal device may still be in the starting process, or may have already executed the starting process, and receive the service request initiated by the user, that is, the starting process and the setting process of the local code are independent from each other.
In S104, if a coding completion instruction returned by the second service terminal based on the second coding instruction is received within an effective waiting period, the second service terminal is identified as an associated backup terminal.
In this embodiment, after the second service terminal device receives the second encoding instruction sent by the terminal device, the device number of the second service terminal device may be configured through the second encoding instruction. After the device number has been configured, in order to avoid that the terminal device continues to broadcast the second coding instruction, thereby repeatedly coding the other service terminals except the second service terminal, the second service terminal generates a coding completion instruction based on the second coding instruction, and returns the coding completion instruction to the terminal device. When the terminal equipment receives the coding completion instruction, the second service terminal can be identified as the next node of the terminal equipment and used as the associated backup terminal, and when an abnormal condition occurs, the local service request can be delivered to the second service terminal for subsequent response, so that the conditions of data loss of a user and service re-handling are avoided.
Specifically, the terminal device is configured with an effective waiting period, when the terminal device broadcasts the second encoding instruction for the first time, the waiting timer is started, and if the count value of the waiting timer is smaller than the effective waiting period and the encoding completion instruction is received, the relevant operation of S104 is executed; on the contrary, if the count value of the waiting timer is greater than or equal to the effective waiting period and the coding completion instruction is not received, it may be determined that the terminal device in the local area network is the last started service terminal, and the service terminal of the first node in the local area network may be identified as the associated backup terminal, or of course, the service terminal of the previous node, that is, the first service terminal may also be identified as the associated backup terminal.
In S105, if the local current time meets a preset abnormal triggering condition, sending each currently processed service request and service data of the service request to the associated backup terminal, so that the associated backup terminal responds to each service request based on the service data.
In this embodiment, the terminal device is provided with an abnormal triggering condition, and the terminal device monitors an operation parameter of the local terminal and determines whether the current time meets a preset abnormal triggering condition. For example, the abnormal triggering condition may be that the terminal electric quantity is lower than 5%, based on which, the terminal device may obtain the electric quantity value of the terminal device in a preset abnormal monitoring period, and if the obtained electric quantity value at the current time is lower than 5%, identify that the current time meets the preset abnormal triggering condition, and execute the relevant operation of S105. Of course, the terminal device may determine that an abnormal event occurs locally in a self-checking manner, or in a monitoring manner of other devices. For example, as described above, the terminal device may send a heartbeat packet to the associated backup terminal at a preset heartbeat cycle, so as to maintain the validity of the communication link between the terminal device and the associated backup terminal. If the associated backup terminal does not receive the heartbeat data packet sent by the terminal device in the heartbeat cycle, the terminal device may be in a down state, and it is not possible to detect that the current time meets the abnormal triggering condition and send the heartbeat data packet, at this time, the associated backup terminal may send an abnormal triggering instruction to the terminal device, and at this time, the terminal device may also execute the relevant operation of S105.
In this embodiment, after the terminal device is started, the terminal device may receive a service request initiated by a user, and generate corresponding service data based on a service operation of the user. When the terminal device detects that the current time meets the preset abnormal triggering condition, all the service requests which are not completed currently and the service data associated with each service request are sent to the associated backup terminal in a unified mode, the associated backup terminal can continuously respond to the service requests according to the service data, a user does not need to initiate the service requests again, the operated process is executed again, and the service handling progress is reserved.
It can be seen from the above that, in the method for responding to an exception provided in the embodiment of the present invention, when the method is started, whether a first coding instruction exists is monitored, a local number is set based on the first coding instruction, and after the method is started, a second coding instruction is generated according to the local number for device coding of a subsequently started service terminal, so that all service terminals in a local area network form a device chain, and a service terminal of a next node is used as an associated backup terminal. On the other hand, the mode does not need to introduce a server, and the service terminals in the formed equipment chain form a mutual backup relationship, so that the manufacturing cost of the service response system is reduced, and the overall robustness of the system is also improved.
Fig. 2 is a flowchart illustrating a specific implementation of a method for responding to an exception according to a second embodiment of the present invention. Referring to fig. 2, with respect to the embodiment shown in fig. 1, the method for responding to an anomaly provided in this embodiment further includes: s201 to S205 are specifically detailed as follows:
further, as another embodiment of the present invention, after setting a local number based on the device number if the first encoding instruction is received within the starting time threshold, the method further includes:
in S201, all service requests and service data sent by the first service terminal having an abnormal event are received, and the number of the service requests of the first service terminal is counted.
In this embodiment, when each service terminal is abnormal in the device chain, the service request and the service data are all transferred to the next node for exception handling, that is, the terminal device provided in this embodiment is also an associated backup node of the first service terminal, so that when an exception event occurs in the first service terminal, the currently processed service request and the corresponding service data can be sent to the terminal device. The terminal device may serve as a processing middleware and forward the service request to each service terminal based on the number of the service requests and the load condition of each service terminal in a normal state in the local area network. Based on this, after receiving the service request and the service data, the terminal device counts the total number of the service requests sent by the first service terminal.
It should be noted that, since the terminal device is the associated backup terminal of the first service terminal, after receiving the service request and the service data sent by the terminal device, the associated backup terminal of the terminal device in the first embodiment may also respond in the manner of S201 to S205, which is not described herein again.
In S202, the operation parameters and the service request number of each service terminal in the normal state in the local area network at the current time are obtained.
In this embodiment, in order to implement load balancing and avoid the situation that all service requests are handled locally to cause overload, the terminal device needs to determine the load situation of each service terminal in a normal state in the local area network, so as to determine the forwarding number of each service terminal. Based on this, the terminal device broadcasts in the local area network, so that each service terminal in a normal state reports the operation parameters at the current time and the number of service requests processed by the services processed normally.
In this embodiment, the operating parameters include, but are not limited to: and parameters related to the operation of the service response terminal, such as operation rate, network bandwidth, idle thread number, storage resources and the like. The service response capability of the service terminal can be determined through the operation parameter, and if the operation parameter is larger, the response efficiency of the service terminal is higher. The load pressure of the service terminal at the current moment can be determined through the service request number processed at the current moment, preferably, the terminal device records the maximum response number of each service terminal, after the terminal device obtains the service request number of each service response terminal, the load proportion of each service terminal can be determined according to the service request number and the corresponding maximum response number, and the load parameters can be normalized through the method, so that the accuracy of the subsequent calculation processing priority can be improved.
In S203, the processing priority of each service terminal in the normal state is calculated based on the operation parameter and the service request number.
In this embodiment, after acquiring the operation parameters and the service request number of each service terminal in the normal state, the terminal device may import the two parameters into the priority selection model, so as to calculate and obtain the processing priority of each service terminal in the normal state, wherein if the value of the operation parameter of the service terminal is larger, it indicates that the operation efficiency of the service terminal is higher, and the value of the corresponding priority is larger; on the other hand, the smaller the number of service requests, the smaller the load pressure of the service terminal, and the larger the number of service requests that can be received, the larger the corresponding priority value.
It should be noted that the numerical value of the priority is used to indicate the task processing capability of the service terminal, that is, the larger the numerical value of the priority is, the stronger the task processing capability is, and a larger number of service requests can be forwarded; on the contrary, if the numerical value of the priority is smaller, it indicates that the task processing capability of the device is poor, the corresponding forwarding number is smaller, and even no forwarding is performed. When calculating each processing priority, the terminal device may also count local operating parameters and the number of service requests, thereby determining the number of service requests that need to be processed locally.
Alternatively, the processing priority may be calculated by the following formula:
wherein, PRI (j) is the processing priority of the jth service terminal in normal state; RunPrmerjThe operation parameters of the jth service terminal in the normal state are obtained; requustjThe service request number of the jth service terminal in the normal state; m is the number of the service terminals in the normal state; alpha is a preset coefficient.
In S204, respectively importing each processing priority and the number into a forwarding number calculation model, and determining the forwarding number of each normal service terminal; the forwarding number calculation model specifically comprises:
wherein, replynum (j) is the forwarding number of the jth service terminal in the normal state; PROjThe priority of the jth service terminal in the normal state; requstuckum is the number; n is the same asThe number of terminals of the service terminal in the normal state.
In this embodiment, after determining the processing priority value of each service response terminal, the terminal device may import the priority value and the counted number of service requests sent by the first service terminal into the forwarding number conversion model, and if the priority value is larger, the number of service requests to be forwarded is larger; conversely, if the value of the priority is smaller, the number of service requests to be forwarded is smaller. Preferably, after obtaining the calculation result, the terminal device performs a rounding operation on the calculation result, and takes a rounded value as the forwarding number.
In S205, based on the forwarding number, the service request and the service data are respectively forwarded to each of the service terminals in the normal state.
In this embodiment, after determining the forwarding number of each service terminal, the terminal device may forward the service requests of the corresponding number and the service data of each service request to the service terminal, and respond to the service request based on the service data through the forwarded service terminal.
In the embodiment of the invention, the processing priority of each service terminal is determined by acquiring the operation parameters and the service request number of each service terminal, and the forwarding number of each service terminal is determined based on the processing priority, so that when an abnormal condition occurs, the service request of the abnormal terminal can be subjected to load distribution through the associated backup node, the load balance is realized, and the process condition is avoided.
Fig. 3 is a flowchart illustrating a specific implementation of a method for responding to an exception according to a third embodiment of the present invention. Referring to fig. 3, with respect to the embodiment described in fig. 1, in the method for responding to an exception provided in this embodiment, if the local current time meets a preset exception triggering condition, after sending each service request currently processed and service data of the service request to the associated backup terminal, the method further includes: s301 to S302 are described in detail as follows:
in S301, if the abnormal repair completion instruction is received, broadcasting a link entry request in the local area network, so that a third service terminal with a maximum device number in the local area network feeds back a third coding instruction; the third encoding instruction includes a device number of the third service terminal.
In this embodiment, when detecting that the current time meets the abnormal triggering condition, the terminal device forwards the service request and the service data to the associated backup terminal, and at this time, the terminal device logs out the device chain. After the terminal device is abnormally repaired and needs to join the device chain again, a chain entering request can be broadcasted in the local area network to execute the chain entering operation.
Optionally, in this embodiment, when detecting that the current time meets the abnormal triggering condition, the terminal device broadcasts a device log-out instruction in the local area network, where the device log-out instruction carries a local number of the terminal device, and if any service terminal in the local area network detects that the device number of the service terminal is greater than the local number of the device log-out instruction, the device number of the service terminal is adjusted, so that when the service terminal is abnormal and logs out of the device chain, each service terminal in the device chain can still maintain a mutual backup relationship, and the ordering among the device numbers is continuous.
In this embodiment, since each service terminal in this embodiment may establish a connection with the associated backup device, the device number of the associated backup device may be obtained through the communication link, and if it is detected that the local number is smaller than the device number of the associated backup device, it may be determined that the service terminal is not located at the tail node of the device chain, that is, the value of the device number of the service terminal is not the maximum, and the third encoding instruction is not generated; on the contrary, if the local number is detected to be greater than the device number of the associated backup terminal, it can be determined that the local number is at the tail node of the device chain, that is, the numerical value of the device number of the local number is the largest, a third coding instruction is generated and sent to the terminal device, and the terminal device is identified as the associated backup terminal of the local number.
In S302, the third encoding instruction is received, a local number is set based on the device number of the third service terminal, the second encoding instruction generated according to the local number is returned to be executed, and the second encoding instruction is broadcasted in the local area network.
In this embodiment, after receiving the third encoding instruction, the terminal device reconfigures its local number according to the device number carried in the third encoding instruction, and the operation is completely the same as the operation of S102, which is not described herein again.
In the embodiment of the invention, the local number of the device chain is configured based on the third coding instruction with the largest device number by broadcasting the link entering request, so that the local number is automatically added to the tail of the device chain after the abnormity is repaired, the backup relation of the normally running service terminal is not influenced, and the link entering efficiency is improved.
Fig. 4 is a flowchart illustrating a specific implementation of a method for responding to an exception according to a fourth embodiment of the present invention. Referring to fig. 4, with respect to the embodiment shown in fig. 1 to fig. 3, after the generating a second encoding instruction according to the local number and broadcasting and sending the second encoding instruction in the local area network, the method for responding to an exception according to this embodiment further includes: s401 to S402 are specifically described as follows:
in S401, if the encoding completion instruction is not received within the valid waiting period, the device number of each service terminal in the local area network is obtained.
In this embodiment, the terminal device broadcasts the second encoding instruction in the local area network, and when all the service terminals in the local area network have completed encoding, there is a case where no service terminal returns an encoding completion instruction to the terminal device. Based on this, the terminal device detects whether a coding completion instruction is received in an effective waiting period, if the coding completion instruction returned by any service terminal is not received even if the effective waiting period is exceeded, the terminal device indicates that the terminal device is located at the tail node of the device chain, the number of each service terminal device in the local area network is inquired, and the first node is selected as the associated backup terminal of the terminal device, so that a device ring is formed.
In S402, the service terminal whose device number is the preset initial number value is identified as an associated backup terminal.
In this embodiment, the terminal device may identify the service terminal whose device number is the initial coding value as the associated backup terminal, for example, the initial coding value is 1, that is, when the first service terminal is started in the local area network, the terminal device may set the device number of the terminal device to 1, and therefore, the terminal device may identify the service terminal whose device number is 1 as the associated backup terminal according to the obtained device number of each service terminal. Of course, if the initial value of the code of the lan is 2, the service terminal with the device number 2 may also be selected as the associated backup terminal.
In the embodiment of the invention, the situation that the associated backup terminal cannot be configured due to the fact that the terminal equipment continuously broadcasts the second coding instruction and waits for the coding completion instruction to return is avoided by setting the effective waiting period, and the efficiency of backup configuration is improved.
Fig. 5 is a flowchart illustrating a specific implementation of a method for responding to an exception according to a fifth embodiment of the present invention. Referring to fig. 5, with respect to the embodiment described in fig. 1 to fig. 3, after the detecting whether the first encoding instruction is received within the preset starting time threshold, the method for responding to an exception according to this embodiment further includes: s501, detailed details are as follows:
in S501, if the first encoding instruction is not received within the starting time threshold, the local number is set as a preset initial number value.
In this embodiment, when the terminal device does not receive the first coding instruction sent by the started service terminal within the starting time threshold, it indicates that the terminal device is the first started service terminal, and at this time, the terminal device uses the coding initial value as its local number based on the coding initial value pre-configured in the local area network.
In the embodiment of the invention, when the first started service terminal is started, the local number can be set based on the initial coding value, so that the purpose of automatic number numbering can be carried out on the first node, and the configuration efficiency is improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Fig. 6 is a block diagram illustrating a structure of an exception response device according to an embodiment of the present invention, where the exception response device includes units for performing the steps in the corresponding embodiment of fig. 1. Please refer to fig. 1 and fig. 1 for the corresponding description of the embodiment. For convenience of explanation, only the portions related to the present embodiment are shown.
Referring to fig. 6, the apparatus for abnormal response includes:
the device starting unit 61 is configured to execute a device starting process if a device starting instruction is received, and detect whether a first coding instruction is received within a preset starting time threshold; the first coding instruction carries a device number of a first service terminal which sends the coding instruction;
a local number setting unit 62, configured to set a local number based on the device number if the first encoding instruction is received within the start time threshold;
a coding instruction broadcasting unit 63, configured to generate a second coding instruction according to the local number, and broadcast the second coding instruction in a local area network, so that any second service terminal that executes a start procedure sets a device number of the second service terminal based on the second coding instruction;
the associated backup terminal identification unit 64 is configured to identify the second service terminal as an associated backup terminal if a coding completion instruction returned by the second service terminal based on the second coding instruction is received within an effective waiting period;
an exception response unit 65, configured to send each currently processed service request and service data of the service request to the associated backup terminal if a local current time meets a preset exception triggering condition, so that the associated backup terminal responds to each service request based on the service data.
Optionally, the apparatus for exception response further comprises:
a request number counting unit, configured to receive all service requests and service data sent by the first service terminal having an abnormal event, and count the number of the service requests of the first service terminal;
a terminal parameter obtaining unit, configured to obtain an operation parameter and a service request number of each service terminal in a normal state in the local area network at the current time;
a processing priority calculating unit, configured to calculate a processing priority of each service terminal in a normal state based on the operation parameter and the service request number;
a forwarding number determining unit, configured to import each processing priority and the number into a forwarding number calculation model, and determine the forwarding number of each normal service terminal; the forwarding number calculation model specifically comprises:
wherein, replynum (j) is the forwarded number of the jth service terminal in the normal state; PROjThe priority of the jth service terminal in the normal state; requstuckum is the number; n is the number of the service terminals in the normal state;
and respectively forwarding the service request and the service data to each service terminal in the normal state based on the forwarding number.
Optionally, the apparatus for exception response further comprises:
the network access request unit is used for broadcasting a link access request in the local area network if the abnormal repair completion instruction is received so as to enable a third service terminal with the largest numerical value of the equipment number in the local area network to feed back a third coding instruction; the third coding instruction comprises a device number of the third service terminal;
and the network access configuration unit is used for receiving the third coding instruction, setting a local number based on the equipment number of the third service terminal, returning and executing the second coding instruction generated according to the local number, and broadcasting the second coding instruction in the local area network.
Optionally, the apparatus for exception response further comprises:
an equipment number obtaining unit, configured to obtain an equipment number of each service terminal in the local area network if the coding completion instruction is not received within the effective waiting period;
an initial code identification unit for identifying the service terminal with the equipment number as a preset number initial value as an associated backup terminal
Optionally, the apparatus for exception response further comprises:
and the initial code setting unit is used for setting the local number as a preset number initial value if the first coding instruction is not received within the starting time threshold.
Therefore, the device for abnormal response provided in the embodiment of the present invention may also monitor whether a first coding instruction exists during starting, set a local number based on the first coding instruction, and generate a second coding instruction according to the local number after the starting is completed, so that the service terminal for subsequent starting performs device coding, and thus all the service terminals in the local area network may form a device chain, and use the service terminal of the next node as an associated backup terminal. On the other hand, the mode does not need to introduce a server, and the service terminals in the formed equipment chain form a mutual backup relationship, so that the manufacturing cost of the service response system is reduced, and the overall robustness of the system is also improved.
Fig. 7 is a schematic diagram of a terminal device according to another embodiment of the present invention. As shown in fig. 7, the terminal device 7 of this embodiment includes: a processor 70, a memory 71 and a computer program 72, such as a program for exception response, stored in said memory 71 and operable on said processor 70. The processor 70, when executing the computer program 72, implements the steps in the various above-described method embodiments of exception response, such as S101-S105 shown in fig. 1. Alternatively, the processor 70, when executing the computer program 72, implements the functions of the units in the above-described device embodiments, such as the functions of the modules 61 to 65 shown in fig. 6.
Illustratively, the computer program 72 may be divided into one or more units, which are stored in the memory 71 and executed by the processor 70 to accomplish the present invention. The one or more units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 72 in the terminal device 7. For example, the computer program 72 may be divided into a device start-up unit, a local number setting unit, a coding instruction broadcasting unit, an associated backup terminal identification unit, and an abnormality response unit, each of which functions specifically as described above.
The terminal device 7 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor 70, a memory 71. It will be appreciated by those skilled in the art that fig. 7 is merely an example of a terminal device 7 and does not constitute a limitation of the terminal device 7 and may comprise more or less components than shown, or some components may be combined, or different components, for example the terminal device may further comprise input output devices, network access devices, buses, etc.
The Processor 70 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 71 may be an internal storage unit of the terminal device 7, such as a hard disk or a memory of the terminal device 7. The memory 71 may also be an external storage device of the terminal device 7, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the terminal device 7. The memory 71 is used for storing the computer program and other programs and data required by the terminal device. The memory 71 may also be used to temporarily store data that has been output or is to be output.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.
Claims (10)
1. A method of anomalous response comprising:
if receiving an equipment starting instruction, executing an equipment starting process, and detecting whether a first coding instruction is received within a preset starting time threshold value; the first coding instruction carries a device number of a first service terminal which sends the first coding instruction; only one service terminal is in a starting process at the same time in the local area network;
if the first coding instruction is received within the starting time threshold, setting a local number based on the equipment number;
generating a second coding instruction according to the local number, and broadcasting the second coding instruction in a local area network so that any second service terminal executing the starting process sets the equipment number of the second service terminal based on the second coding instruction;
if a coding completion instruction returned by the second service terminal based on the second coding instruction is received in an effective waiting period, identifying the second service terminal as a related backup terminal;
and if the local current moment meets a preset abnormal triggering condition, sending each service request which is processed currently and the service data of the service request to the associated backup terminal so that the associated backup terminal responds to each service request based on the service data.
2. The method of claim 1, further comprising:
receiving all service requests and service data sent by the first service terminal with abnormal events, and counting the number of the service requests of the first service terminal;
acquiring the operation parameters and the service request number of each service terminal in a normal state in the local area network at the current moment;
calculating the processing priority of each service terminal in the normal state based on the operation parameters and the service request number;
respectively importing the processing priorities and the numbers into a forwarding number calculation model, and determining the forwarding numbers of the service terminals in the normal state; the forwarding number calculation model specifically comprises:
wherein, ReplyNum (j) is the jth stationThe forwarding number of the service terminals in the normal state; PROjThe processing priority of the jth service terminal in the normal state; RequstNum is the number of the service requests of the first service terminal; n is the number of the service terminals in the normal state;
and respectively forwarding the service request and the service data to each service terminal in the normal state based on the forwarding number.
3. The method according to claim 1, wherein after sending each currently processed service request and the service data of the service request to the associated backup terminal if the local current time meets a preset abnormal trigger condition, the method further comprises:
if the abnormal repairing completion instruction is received, broadcasting a link-in request in the local area network so that a third service terminal with the largest numerical value of the equipment number in the local area network feeds back a third coding instruction; the third coding instruction comprises a device number of the third service terminal;
and receiving the third coding instruction, setting a local number based on the equipment number of the third service terminal, returning to execute the second coding instruction generated according to the local number, and broadcasting the second coding instruction in a local area network.
4. The method according to any one of claims 1-3, further comprising, after said generating a second encoding instruction according to said local number and broadcasting said second encoding instruction within a local area network:
if the coding completion instruction is not received in the effective waiting period, acquiring the equipment number of each service terminal in the local area network;
and identifying the service terminal with the equipment number as a preset number initial value as an associated backup terminal.
5. The method according to any one of claims 1-3, wherein after the detecting whether the first encoding instruction is received within a preset startup time threshold, the method further comprises:
and if the first coding instruction is not received within the starting time threshold, setting the local number as a preset number initial value.
6. An abnormally responsive apparatus, comprising:
the device starting unit is used for executing a device starting process if a device starting instruction is received, and detecting whether a first coding instruction is received within a preset starting time threshold value; the first coding instruction carries a device number of a first service terminal which sends the first coding instruction; only one service terminal is in a starting process at the same time in the local area network;
a local number setting unit, configured to set a local number based on the device number if the first encoding instruction is received within the start time threshold;
the coding instruction broadcasting unit is used for generating a second coding instruction according to the local number and broadcasting the second coding instruction in a local area network so as to enable any second service terminal executing the starting process to set the equipment number of the second service terminal based on the second coding instruction;
the associated backup terminal identification unit is used for identifying the second service terminal as an associated backup terminal if a coding completion instruction returned by the second service terminal based on the second coding instruction is received in an effective waiting period;
and the exception response unit is used for sending each service request processed currently and service data of the service request to the associated backup terminal if the local current time meets a preset exception triggering condition so as to enable the associated backup terminal to respond to each service request based on the service data.
7. The apparatus of claim 6, wherein the apparatus for exception response comprises:
a request number counting unit, configured to receive all service requests and service data sent by the first service terminal having an abnormal event, and count the number of the service requests of the first service terminal;
a terminal parameter obtaining unit, configured to obtain an operation parameter and a service request number of each service terminal in a normal state in the local area network at the current time;
a processing priority calculating unit, configured to calculate a processing priority of each service terminal in a normal state based on the operation parameter and the service request number;
a forwarding number determining unit, configured to import each processing priority and the number into a forwarding number calculation model, and determine the forwarding number of each normal service terminal; the forwarding number calculation model specifically comprises:
wherein, replynum (j) is the forwarded number of the jth service terminal in the normal state; PROjThe processing priority of the jth service terminal in the normal state; RequstNum is the number of the service requests of the first service terminal; n is the number of the service terminals in the normal state;
and respectively forwarding the service request and the service data to each service terminal in the normal state based on the forwarding number.
8. The apparatus of claim 6, wherein the apparatus for exception response further comprises:
the network access request unit is used for broadcasting a link access request in the local area network if the abnormal repair completion instruction is received so as to enable a third service terminal with the largest numerical value of the equipment number in the local area network to feed back a third coding instruction; the third coding instruction comprises a device number of the third service terminal;
and the network access configuration unit is used for receiving the third coding instruction, setting a local number based on the equipment number of the third service terminal, returning and executing the second coding instruction generated according to the local number, and broadcasting the second coding instruction in the local area network.
9. A terminal device, characterized in that the terminal device comprises a memory, a processor and a computer program stored in the memory and being executable on the processor, the processor implementing the steps of the method according to any one of claims 1 to 5 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811339833.5A CN109462646B (en) | 2018-11-12 | 2018-11-12 | Abnormal response method and equipment |
PCT/CN2019/091501 WO2020098266A1 (en) | 2018-11-12 | 2019-06-17 | Abnormal response method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811339833.5A CN109462646B (en) | 2018-11-12 | 2018-11-12 | Abnormal response method and equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109462646A CN109462646A (en) | 2019-03-12 |
CN109462646B true CN109462646B (en) | 2021-11-19 |
Family
ID=65609989
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811339833.5A Active CN109462646B (en) | 2018-11-12 | 2018-11-12 | Abnormal response method and equipment |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109462646B (en) |
WO (1) | WO2020098266A1 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109462646B (en) * | 2018-11-12 | 2021-11-19 | 平安科技(深圳)有限公司 | Abnormal response method and equipment |
CN111343161B (en) * | 2020-02-14 | 2021-12-10 | 平安科技(深圳)有限公司 | Abnormal information processing node analysis method, abnormal information processing node analysis device, abnormal information processing node analysis medium and electronic equipment |
CN114043053B (en) * | 2021-11-22 | 2023-09-08 | 常州九圣焊割设备股份有限公司 | Control method and device of plasma cutting system |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102833103A (en) * | 2012-08-24 | 2012-12-19 | 上海创件信息科技有限公司 | Error detecting and processing method relate to electronic map collaboration mark |
CN103036719A (en) * | 2012-12-12 | 2013-04-10 | 北京星网锐捷网络技术有限公司 | Cross-regional service disaster method and device based on main cluster servers |
CN106856489A (en) * | 2015-12-08 | 2017-06-16 | 阿里巴巴集团控股有限公司 | A kind of service node switching method and apparatus of distributed memory system |
CN108011929A (en) * | 2017-11-14 | 2018-05-08 | 平安科技(深圳)有限公司 | Data request processing method, apparatus, computer equipment and storage medium |
CN108156236A (en) * | 2017-12-22 | 2018-06-12 | 平安养老保险股份有限公司 | Service request processing method, device, computer equipment and storage medium |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101179432A (en) * | 2007-12-13 | 2008-05-14 | 浪潮电子信息产业股份有限公司 | Method of implementing high availability of system in multi-machine surroundings |
CN103188110B (en) * | 2013-03-29 | 2016-01-06 | 汉柏科技有限公司 | Based on the heat backup method that the cloud platform of zookeeper is served |
US20160205066A1 (en) * | 2015-01-09 | 2016-07-14 | Texas Instruments Incorporated | Unique device address assignment technique for bidirectional daisy chain system |
US9996434B2 (en) * | 2016-10-28 | 2018-06-12 | International Business Machines Corporation | Data mirror volume verification |
CN107770269B (en) * | 2017-10-20 | 2019-07-19 | 平安科技(深圳)有限公司 | A kind of service response method and its terminal |
CN108134700B (en) * | 2017-12-22 | 2021-04-20 | 南京因泰莱电器股份有限公司 | Method for realizing electric power automation communication data integrity |
CN108566290B (en) * | 2018-02-07 | 2020-05-08 | 平安科技(深圳)有限公司 | Service configuration management method, system, storage medium and server |
CN108616429B (en) * | 2018-05-14 | 2019-12-13 | 平安科技(深圳)有限公司 | reconnection method and device for push service |
CN109462646B (en) * | 2018-11-12 | 2021-11-19 | 平安科技(深圳)有限公司 | Abnormal response method and equipment |
-
2018
- 2018-11-12 CN CN201811339833.5A patent/CN109462646B/en active Active
-
2019
- 2019-06-17 WO PCT/CN2019/091501 patent/WO2020098266A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102833103A (en) * | 2012-08-24 | 2012-12-19 | 上海创件信息科技有限公司 | Error detecting and processing method relate to electronic map collaboration mark |
CN103036719A (en) * | 2012-12-12 | 2013-04-10 | 北京星网锐捷网络技术有限公司 | Cross-regional service disaster method and device based on main cluster servers |
CN106856489A (en) * | 2015-12-08 | 2017-06-16 | 阿里巴巴集团控股有限公司 | A kind of service node switching method and apparatus of distributed memory system |
CN108011929A (en) * | 2017-11-14 | 2018-05-08 | 平安科技(深圳)有限公司 | Data request processing method, apparatus, computer equipment and storage medium |
CN108156236A (en) * | 2017-12-22 | 2018-06-12 | 平安养老保险股份有限公司 | Service request processing method, device, computer equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
WO2020098266A1 (en) | 2020-05-22 |
CN109462646A (en) | 2019-03-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107688496B (en) | Task distributed processing method and device, storage medium and server | |
CN107832126B (en) | Thread adjusting method and terminal thereof | |
CN109462646B (en) | Abnormal response method and equipment | |
CN101510167B (en) | A kind of method of plug-in component operation, Apparatus and system | |
CN110858843B (en) | Service request processing method and device and computer readable storage medium | |
CN108616429B (en) | reconnection method and device for push service | |
CN113141383B (en) | Device information subscription method, client, server, system and storage medium | |
CN109800204B (en) | Data distribution method and related product | |
CN109981737B (en) | Network request processing method, device, terminal and storage medium | |
CN111163018B (en) | Network equipment and method for reducing transmission delay thereof | |
WO2021115054A1 (en) | Method for adjusting node configuration in cluster system, and server | |
CN109542718B (en) | Service call monitoring method and device, storage medium and server | |
WO2022179486A1 (en) | Multi-core processor task scheduling method and apparatus, and device and storage medium | |
CN109584105B (en) | Service response method and system | |
CN111669308A (en) | Modbus communication method, device, terminal and medium based on polling optimization strategy | |
CN109885384B (en) | Task parallelism optimization method and device, computer equipment and storage medium | |
CN108429703B (en) | DHCP client-side online method and device | |
CN112612635B (en) | Multi-level protection method for application program | |
CN110865877B (en) | Task request response method and device | |
CN108255704B (en) | Abnormal response method of script calling event and terminal thereof | |
CN102023997A (en) | Data query system, construction method thereof and corresponding data query method | |
CN111376255B (en) | Robot data acquisition method and device and terminal equipment | |
CN110609758A (en) | Queue-based device operating method, computer device and readable storage medium | |
CN108924013B (en) | Network flow accurate acquisition method and device | |
TW202127250A (en) | Method for computation resource allocation and management and proxy server thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |