Address allocation method and device, electronic equipment and computer readable storage medium
By receiving a request in the CEC device and returning a retry instruction, and sending a reassignment instruction when necessary, the address conflict and preemption problems of the CEC device when allocating a logical address are solved, and the effect of automated address allocation and simultaneous communication of multiple devices is achieved when an address conflict occurs.
Patent Information
- Application Number
- CN202510115899.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-05-06
AI Technical Summary
In the prior art, CEC devices often experience address conflicts and preemption problems when allocating logical addresses, resulting in the device being unable to communicate normally.
By receiving the request from the device, return the retry instruction, and sending a reassignment instruction if necessary, reallocating the address according to the request occupancy of the target address by other devices.
It realizes automatic address allocation when an address conflict occurs, and can still communicate with other devices at the same time after resolving the address conflict.
Smart Images

Figure CN119946020A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of communication technology, and specifically to an address allocation method, device, electronic device, and computer-readable storage medium. Background Art
[0002] With the continuous development of smart devices, High-Definition Multimedia Interface (HDMI) has been widely used in smart devices, such as TVs, monitors, game consoles, Blu-ray players and other smart devices.
[0003] Using the Consumer Electronics Control (CEC) protocol through the HDMI interface can achieve mutual control between smart devices. In the HDMI CEC protocol, each device needs to be assigned a unique logical address in order to communicate on the CEC bus, which can greatly simplify user operations and improve user experience.
[0004] However, in the prior art, when CEC devices allocate logical addresses, address conflicts and preemption problems often occur, resulting in the inability of devices to communicate normally. Summary of the invention
[0005] The embodiments of the present application provide an address allocation method, apparatus, electronic device, and computer-readable storage medium, which can enable a smart device to reallocate addresses based on the degree of occupancy of the target addresses requested by other devices when an address conflict occurs in the target address used to communicate with multiple other devices, thereby achieving simultaneous communication with other devices.
[0006] In a first aspect, an embodiment of the present application provides an address allocation method, which is applied to a smart device, and the method includes:
[0007] receiving a first request from a first device, wherein the first request is used to request to occupy a target address of the smart device;
[0008] In case the smart device communicates with the second device via the target address, returning a retry instruction to the first device;
[0009] receiving a second request from the first device;
[0010] In the case where the second request is still used to request to occupy the target address, a reallocation instruction is sent to the second device, and communication is performed with the first device through the target address.
[0011] Optionally, in some embodiments of the present application, before returning the retry instruction to the first device, the method further includes:
[0012] Determine whether there is tag information for the target address, where the tag information is used to indicate whether the target address has been reallocated;
[0013] In the case where the target address does not have tag information, the retry instruction is generated.
[0014] Optionally, in some embodiments of the present application, after sending the reallocation instruction to the second device, the method further includes:
[0015] The marking information is generated to mark the target address.
[0016] Optionally, in some embodiments of the present application, after sending the reallocation instruction to the second device, the method further includes:
[0017] receiving a third request from a second device;
[0018] In the case where the third request is used to request to occupy the target address, an alarm message is generated, where the alarm message is used to indicate that an address conflict exists at the target address.
[0019] Optionally, in some embodiments of the present application, after sending the reallocation instruction to the second device, the method further includes:
[0020] In a case where the third request is used to request to occupy addresses other than the target address, communication with the second device is performed through the addresses other than the target address.
[0021] Optionally, in some embodiments of the present application, when the second request is used to request to occupy an address other than the target address, the method includes:
[0022] Communicate with the first device via an address other than the target address.
[0023] Optionally, in some embodiments of the present application, the target address is one or more logical addresses of the smart device.
[0024] In a second aspect, an embodiment of the present application further provides an address allocation device, which is applied to a smart device, and the device includes:
[0025] A receiving module, configured to receive a first request from a first device, wherein the first request is used to request to occupy a target address of the smart device;
[0026] a processing module, configured to return a retry instruction to the first device when the smart device communicates with the second device via the target address;
[0027] The receiving module is further used to receive a second request from the first device;
[0028] The processing module is further configured to send a reallocation instruction to the second device and communicate with the first device through the target address when the second request is still used to request to occupy the target address.
[0029] Optionally, in some embodiments of the present application, the processing module is further used to:
[0030] Determine whether there is tag information for the target address, where the tag information is used to indicate whether the target address has been reallocated;
[0031] In the case where the target address does not have tag information, the retry instruction is generated.
[0032] Optionally, in some embodiments of the present application, the processing module is further used to:
[0033] The marking information is generated to mark the target address.
[0034] Optionally, in some embodiments of the present application, the processing module is further used to:
[0035] receiving a third request from a second device;
[0036] In the case where the third request is used to request to occupy the target address, an alarm message is generated, where the alarm message is used to indicate that an address conflict exists at the target address.
[0037] Optionally, in some embodiments of the present application, the processing module is further used to:
[0038] In a case where the third request is used to request to occupy addresses other than the target address, communication with the second device is performed through the addresses other than the target address.
[0039] Optionally, in some embodiments of the present application, the processing module is further used to:
[0040] Communicate with the first device via an address other than the target address.
[0041] In a third aspect, an embodiment of the present application further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps in the above-mentioned address allocation method when executed by the processor.
[0042] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the above-mentioned address allocation method are implemented.
[0043] In a fifth aspect, the embodiments of the present application further provide a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in various optional implementations described in the embodiments of the present application.
[0044] In summary, the embodiment of the present application adopts a technical solution of receiving a first request from a first device, wherein the first request is used to request to occupy the target address of the smart device; when the smart device communicates with the second device through the target address, returning a retry instruction to the first device; receiving a second request from the first device; and when the second request is still used to request to occupy the target address, sending a reallocation instruction to the second device, and communicating with the first device through the target address. This can enable the smart device to reallocate the address according to the degree of occupation of the target address requested by other devices when an address conflict occurs in the target address used to communicate with multiple other devices, thereby achieving automatic address allocation when an address conflict occurs, and the technical effect of being able to communicate with other devices at the same time after resolving the address conflict. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0046] Figure 1 A schematic diagram of a scenario of an address allocation method provided in an embodiment of the present application;
[0047] Figure 2 It is a schematic diagram of a scenario in which a smart device according to an embodiment of the present application executes the address allocation method;
[0048] Figure 3 It is a schematic diagram of logical address types corresponding to the address allocation method provided in the embodiment of the present application;
[0049] Figure 4 It is a schematic diagram of the overall flow of the address allocation method provided in the embodiment of the present application;
[0050] Figure 5 is a schematic diagram of the structure of the address allocation device provided in an embodiment of the present application;
[0051] Figure 6 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in this application to clearly and completely describe the technical solutions in this application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments in the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0053] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the above features. In the description of the present invention, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0054] In this application, the word "exemplary" is used to mean "serving as an example, illustration, or illustration." Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. The following description is given to enable any person skilled in the art to implement and use the invention. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the invention can be implemented without using these specific details. In other instances, well-known structures and processes are not elaborated in detail to avoid obscuring the description of the invention with unnecessary details. Therefore, the present invention is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in this application.
[0055] First, the terms involved in this application are explained:
[0056] HDMI (High-Definition Multimedia Interface): High-Definition Multimedia Interface;
[0057] CEC (Consumer Electronics Control): Consumer Electronics Control;
[0058] Logical Address: The unique identifier of a CEC device on the bus, used for communication between devices;
[0059] Address Conflict: Multiple devices attempt to assign the same logical address, resulting in communication failure;
[0060] Arbitration: The process in which multiple devices compete for control of the bus;
[0061] Compatibility: The ability of a device to work properly in a specific environment.
[0062] The embodiments of the present application provide an address allocation method, device, electronic device and computer-readable storage medium. Specifically, the embodiments of the present application provide an address allocation device applicable to the address allocation method, the address allocation device includes a smart device and a processor of the smart device, and the smart device can be a TV, a mobile phone, a tablet, a computer, etc.
[0063] In the prior art, CEC devices, i.e., smart devices that can communicate with other devices through the HDMI interface using the CEC protocol to achieve mutual control, have address conflicts and preemption problems when allocating logical addresses, which affects the normal communication and user experience between multiple smart devices. How to optimize the logical address allocation algorithm of CEC devices, reduce address conflicts, and improve the reliability and stability of device communication has become a technical problem that needs to be solved urgently.
[0064] For example, in the prior art, when CEC devices allocate logical addresses, the algorithm used is relatively simple, which is prone to address conflicts and preemption problems. The solution is to immediately allocate addresses as soon as the smart device responds to the allocation message sent by this logical address, without deduplication or other processing, resulting in device display confusion when the logical address of some devices is occupied, and increasing communication errors between smart devices.
[0065] Therefore, the address allocation method in the prior art has the problems of address conflict and preemption, and the solution is relatively simple, which still leads to technical problems such as the inability of devices to communicate normally and chaotic display.
[0066] The embodiment of the present application provides an address allocation method, device, electronic device and computer-readable storage medium. The method adopts a technical solution of receiving a first request from a first device, the first request is used to request to occupy the target address of the smart device; when the smart device communicates with the second device through the target address, a retry instruction is returned to the first device; receiving a second request from the first device; when the second request is still used to request to occupy the target address, a reallocation instruction is sent to the second device, and the second device communicates with the first device through the target address.
[0067] In summary, the address allocation method in the embodiment of the present application can enable the smart device to reallocate the address according to the degree of occupancy of the target address requested by other devices when an address conflict occurs in the target address used to communicate with multiple other devices, thereby realizing automatic address allocation when an address conflict occurs, and the technical effect of still being able to communicate with other devices simultaneously after resolving the address conflict.
[0068] It should be noted that the order of description of the following embodiments is not intended to limit the priority order of the embodiments.
[0069] See also Figure 1 , Figure 1 The following is a scene diagram of the address allocation method provided in the embodiment of the present application. The address allocation system may include a smart device 100 and a processor 601. The smart device 100 and the processor 601 may be connected to each other in any manner, including but not limited to signal communication through electronic circuits, communication through wireless signals, and the wireless signals may be computer network communications of the TCP / IP Protocol Suite (TCP / IP) and the User Datagram Protocol (UDP). The smart device 100 may receive control signals from a remote control or a control panel, and the smart device 100 may also receive instruction information sent by the processor 601. The smart device 100 may perform corresponding operations according to the corresponding instruction information, such as the address allocation method in the present application.
[0070] In the embodiment of the present application, the smart device 100 includes but is not limited to a television, a mobile phone, a tablet, a computer, etc.
[0071] Those skilled in the art will understand that Figure 1 The application environment shown in the figure is only one application scenario of the present application solution and does not constitute a limitation on the application scenario of the present application solution. Other application environments may also include Figure 1 More or fewer smart devices as shown in Figure 1 Only one smart device is shown, and no specific limitation is given here.
[0072] In addition, if Figure 1 As shown, the processor 601 may include any hardware device capable of performing data processing and instruction sending, such as a CPU or a single-chip microcomputer embedded in the smart device, and the specific details are not limited here.
[0073] It should be noted that Figure 1 The scenario diagram of the address allocation system shown is only an example. The address allocation system and scenario described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. Ordinary technicians in this field can know that with the evolution of the address allocation system and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.
[0074] For details, please refer to Figure 2 , Figure 2 : is a schematic diagram of a scenario in which a smart device according to an embodiment of the present application performs the address allocation method, wherein the specific execution process of the smart device performing the address allocation method is as follows:
[0075] S201: Receive a first request from a first device.
[0076] In an embodiment of the present application, the first device, the second device and the smart device are CEC devices of the same type or different types, for example, a television, a mobile phone, a tablet computer, a computer, etc. The first device, the second device and the smart device all have an HDMI interface, and can communicate with other devices using the CEC protocol through the HDMI interface and achieve mutual control.
[0077] As an optional embodiment, taking the CEC device as a TV as an example, after the TV is powered on, use an HDMI cable to connect other devices with CEC function (for example, other TVs); at this time, the TV starts the CEC initialization action, enables the CEC switch to the bottom layer, and then starts to assign logical addresses to other CEC devices.
[0078] Optionally, the logical address allocation process is to send an empty packet Polling message to other CEC devices through the HDMI protocol. The TV will first cyclically construct and send 16 empty packet CEC messages according to the 16 logical addresses of the HDMI specification, so as to allocate the logical address through the response of the device.
[0079] It should be noted that the target address is one or more logical addresses of the intelligent device, such as Figure 3As shown in the schematic diagram of logical address types, these 16 logical addresses are divided into preferred addresses, dedicated addresses and alternative addresses. The logical addresses mainly include: display device address, camera device address, tuner address, playback device address, audio system address, reserved port address, special purpose address, initial address and destination address, etc.
[0080] In the present application embodiment, Figure 4 The overall flow chart of the address allocation method shown in the figure shows that when a device (first device) is connected to the CEC network (smart device) through the HDMI interface and started, the first device will try to obtain a logical address and send an empty packet to each logical address of the smart device. At this time, the smart device enables the chip SOC or processor to initialize the CEC service. If a logical address does not respond, the device will consider the address to be idle and assign it to itself, that is, at this time, the first device will send a first request to the smart device to request to occupy a certain idle logical address. The smart device receives the request and determines the target address that the first device wants to occupy.
[0081] Optionally, some devices (first devices) still insist on using a certain logical address even if the logical address has been used, that is, when the target address has been occupied, the first device will still send a first request to the smart device to request to occupy a certain logical address that has been used.
[0082] It should be noted that the first request is used to request to occupy the target address of the smart device, and the target address may be idle or may have been occupied by other devices.
[0083] S202: When the smart device communicates with the second device through the target address, return a retry instruction to the first device.
[0084] In an embodiment of the present application, when a certain logical address has been used, for example, the logical address (the target address selected by the first device) has been occupied by the second device, and the smart device and the second device are controlling each other through the target address, that is, the smart device detects a logical address conflict at this time and needs to send a retry instruction to the first device so that the first device reselects the logical address.
[0085] As an optional embodiment, Figure 4 As shown, if the smart device detects that there is an address conflict, the address allocation module can be used to reallocate the logical address according to the conflict detection result. For example, if the first device seizes the logical address of the second device, an address conflict occurs, and the address allocation needs to be retried once, that is, the logical address allocation algorithm can be recursively called again to make the first device reselect the logical address.
[0086] Optionally, in some embodiments of the present application, before returning a retry instruction to the first device, the method further includes: determining whether there is tag information for the target address, the tag information being used to characterize whether the target address has been reallocated; and generating a retry instruction if there is no tag information for the target address.
[0087] In an embodiment of the present application, before returning a retry instruction to the first device, it is necessary to determine whether there is tag information for the target address, that is, to determine whether the target address has been reallocated before. If there is no tag information, a retry instruction is generated.
[0088] As an optional embodiment, Figure 4 As shown, before the smart device sends a retry instruction, it first determines whether there is marking information on the target address that the first device wants to occupy. If not, a retry instruction is generated and sent to the first device; if so, it proves that the target address has been compromised (reallocated) before. For example, before the first device sends the first request, the first device communicates with the smart device through the target address. After the second device is connected to the smart device, it occupies the target address, causing the first device to reselect the logical address.
[0089] Optionally, when there is tag information in the target address, that is, the first device and the second device do not yield in this logical address selection, and it is handled as a device problem.
[0090] S203: Receive a second request from the first device.
[0091] In the present application embodiment, Figure 4 As shown, after receiving the retry instruction, the first device will reselect the logical address and send a second request to the smart device.
[0092] As an optional embodiment, the second request may be used to request to occupy the target address again, or may be used to request to occupy other addresses except the target address.
[0093] S204: When the second request is still used to request to occupy the target address, send a reallocation instruction to the second device, and communicate with the first device through the target address.
[0094] In an embodiment of the present application, when the second request is still used to request occupation of the target address, a reallocation instruction needs to be sent to the second device so that the second device reselects the logical address, communicates with the first device through the target address, and generates tag information for the target address.
[0095] As an optional embodiment, Figure 4As shown, if the second request indicates that the first device still occupies the logical address of the second device, the recorded logical address of the second device is removed, and the occupied logical address is given to the first device.
[0096] After sending the reallocation instruction to the second device, optionally, the address allocation method provided in the embodiment of the present application further includes: generating marking information to mark the target address.
[0097] In the embodiment of the present application, it is marked that the logical address has been compromised, that is, the generated marking information indicates that the target address has been reallocated.
[0098] In the case where the second request is used to request to occupy addresses other than the target address, optionally, the address allocation method provided in the embodiment of the present application also includes: communicating with the first device through addresses other than the target address.
[0099] In the embodiment of the present application, when the second request is used to request to occupy other addresses except the target address, communication with the first device is carried out through other addresses.
[0100] After sending the reallocation instruction to the second device, optionally, the address allocation method provided in the embodiment of the present application also includes: receiving a third request from the second device; when the third request is used to request occupation of the target address, generating an alarm message, the alarm information being used to indicate that there is an address conflict in the target address.
[0101] In the embodiment of the present application, after the logical address of the second device is allocated to the first device, a reallocation instruction is sent to the second device to inform the second device to reselect the logical address.
[0102] As an optional embodiment, a third request from the second device is received; when the third request is used to request occupation of the target address, because the target address has been reallocated, a new mark has been added to the target address, and an alarm message can be generated to inform the second device or the relevant user that there is an address conflict in the target address selected.
[0103] After sending the reallocation instruction to the second device, optionally, the address allocation method provided in the embodiment of the present application also includes: when the third request is used to request to occupy other addresses except the target address, communicating with the second device through other addresses except the target address.
[0104] In the embodiment of the present application, when the third request is used to request to occupy other addresses except the target address, communication with the second device is carried out through the other addresses.
[0105] The embodiment of the present application receives a first request from a first device, where the first request is used to request the occupation of a target address of a smart device; when the smart device communicates with a second device through the target address, returns a retry instruction to the first device; receives a second request from the first device; and when the second request is still used to request the occupation of the target address, sends a reallocation instruction to the second device, and communicates with the first device through the target address. The technical solution can enable the smart device to reallocate an address according to the degree of occupation of the target address requested by other devices when an address conflict occurs at the target address used to communicate with multiple other devices, thereby achieving automatic address allocation when an address conflict occurs, and the technical effect of being able to communicate with other devices at the same time after resolving the address conflict.
[0106] In order to better implement the address allocation method of the present application, the present application also provides an address allocation device based on the above address allocation method. The meanings of the terms are the same as those in the above address allocation method, and the specific implementation details can refer to the description in the method embodiment.
[0107] See also Figure 5 , Figure 5 : is a schematic diagram of the structure of the address allocation device provided in an embodiment of the present application, wherein the address allocation device 500 is applied to a smart device, and specifically can be as follows:
[0108] A receiving module 501 is used to receive a first request from a first device, where the first request is used to request to occupy a target address of a smart device;
[0109] The processing module 502 is used to return a retry instruction to the first device when the smart device communicates with the second device through the target address;
[0110] The receiving module 501 is further configured to receive a second request from the first device;
[0111] The processing module 502 is further configured to send a reallocation instruction to the second device and communicate with the first device through the target address when the second request is still used to request to occupy the target address.
[0112] Optionally, in some embodiments of the present application, the processing module 502 is further configured to:
[0113] Determine whether there is tag information of the target address, where the tag information is used to indicate whether the target address has been reallocated;
[0114] When there is no tag information at the target address, a retry instruction is generated.
[0115] Optionally, in some embodiments of the present application, the processing module 502 is further configured to:
[0116] Generate tag information to tag the target address.
[0117] Optionally, in some embodiments of the present application, the processing module 502 is further configured to:
[0118] receiving a third request from a second device;
[0119] In the case where the third request is used to request to occupy the target address, an alarm message is generated, and the alarm message is used to indicate that an address conflict exists in the target address.
[0120] Optionally, in some embodiments of the present application, the processing module 502 is further configured to:
[0121] In the case where the third request is used to request to occupy other addresses except the target address, communication with the second device is performed through the other addresses except the target address.
[0122] Optionally, in some embodiments of the present application, the processing module 502 is further configured to:
[0123] Communicate with the first device via an address other than the target address.
[0124] In the embodiment of the present application, the receiving module 501 first receives a first request from the first device, where the first request is used to request to occupy the target address of the smart device. Then, when the smart device communicates with the second device through the target address, the processing module 502 returns a retry instruction to the first device. Subsequently, the receiving module 501 receives a second request from the first device. Then, when the second request is still used to request to occupy the target address, the processing module 502 sends a reallocation instruction to the second device and communicates with the first device through the target address.
[0125] Among them, the embodiment of the present application receives a first request from a first device, the first request is used to request to occupy the target address of the smart device; when the smart device communicates with the second device through the target address, returns a retry instruction to the first device; receives a second request from the first device; when the second request is still used to request to occupy the target address, sends a reallocation instruction to the second device, and communicates with the first device through the target address. The technical solution can enable the smart device to reallocate the address according to the degree of occupation of the target address requested by other devices when an address conflict occurs in the target address used to communicate with other multiple devices, thereby realizing automatic address allocation when an address conflict occurs, and the technical effect of being able to communicate with other devices at the same time after resolving the address conflict.
[0126] In addition, the present application also provides an electronic device, such as Figure 6 As shown, it shows a schematic diagram of the structure of the electronic device involved in this application, specifically:
[0127] The electronic device may include components such as a processor 601 with one or more processing cores, a memory 602 with one or more computer-readable storage media, a power supply 603, and an input unit 604. Those skilled in the art will appreciate that Figure 6 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0128] The processor 601 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 602, and calling data stored in the memory 602, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 601.
[0129] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.
[0130] The electronic device also includes a power supply 603 for supplying power to various components. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, so as to manage charging, discharging, power consumption management and other functions through the power management system. The power supply 603 can also include one or more DC or AC power supplies, recharging systems, power supply device debugging circuits, power converters or inverters, power status indicators and other arbitrary components.
[0131] The electronic device may further include an input unit 604, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0132] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 601 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 602 according to the following instructions, and the processor 601 will run the application programs stored in the memory 602, thereby implementing the steps in any one of the address allocation methods provided in the embodiments of the present application.
[0133] The embodiment of the present application receives a first request from a first device, wherein the first request is used to request occupation of a target address of the smart device; when the smart device communicates with a second device through the target address, returns a retry instruction to the first device; receives a second request from the first device; and when the second request is still used to request occupation of the target address, sends a reallocation instruction to the second device, and communicates with the first device through the target address. The technical solution can enable the smart device to reallocate an address according to the degree of occupation of the target address requested by other devices when an address conflict occurs with the target address used to communicate with multiple other devices, thereby achieving automatic address allocation when an address conflict occurs, and the technical effect of being able to communicate with other devices at the same time after resolving the address conflict.
[0134] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0135] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0136] To this end, the present application provides a computer-readable storage medium, on which a computer program is stored. The computer program can be loaded by a processor to execute the steps in any address allocation method provided in the present application.
[0137] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0138] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0139] Since the instructions stored in the computer-readable storage medium can execute the steps in any address allocation method provided in the present application, the beneficial effects that can be achieved by any address allocation method provided in the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0140] The above is a detailed introduction to an address allocation method, device, electronic device and computer-readable storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. An address allocation method, characterized in that: Applied to a smart device, the method comprises: receiving a first request from a first device, wherein the first request is used to request to occupy a target address of the smart device; In case the smart device communicates with the second device via the target address, returning a retry instruction to the first device; receiving a second request from the first device; In the case where the second request is still used to request to occupy the target address, a reallocation instruction is sent to the second device, and communication is performed with the first device through the target address.
2. The method according to claim 1, characterized in that: Before returning the retry instruction to the first device, the method further includes: Determine whether there is tag information for the target address, where the tag information is used to indicate whether the target address has been reallocated; In the case where the target address does not have tag information, the retry instruction is generated.
3. The method according to claim 2, characterized in that After sending the reallocation instruction to the second device, the method further includes: The marking information is generated to mark the target address.
4. The method according to claim 3, characterized in that After sending the reallocation instruction to the second device, the method further includes: receiving a third request from a second device; In the case where the third request is used to request to occupy the target address, an alarm message is generated, where the alarm message is used to indicate that an address conflict exists at the target address.
5. The method according to claim 4, characterized in that After sending the reallocation instruction to the second device, the method further includes: In a case where the third request is used to request to occupy addresses other than the target address, communication with the second device is performed through the addresses other than the target address.
6. The method according to claim 1, characterized in that In the case where the second request is used to request to occupy an address other than the target address, the method includes: Communicate with the first device via an address other than the target address.
7. The method according to claim 1, characterized in that The target address is one or more logical addresses of the smart device.
8. An address allocation device, characterized in that: Applied to a smart device, the device comprises: A receiving module, configured to receive a first request from a first device, wherein the first request is used to request to occupy a target address of the smart device; a processing module, configured to return a retry instruction to the first device when the smart device communicates with the second device via the target address; The receiving module is further used to receive a second request from the first device; The processing module is further configured to send a reallocation instruction to the second device and communicate with the first device through the target address when the second request is still used to request to occupy the target address.
9. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the address allocation method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the address allocation method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Video stream transmission method and device, electronic equipment and storage medium
CN120151317A
First controller, second controller, and address conflict processing system and method
CN120256360A
First controller, second controller, address conflict processing system and method
CN120256360B