Construction debugging method and device, equipment and medium
By introducing heavy connection status variables in the client module of the construction tool, updating the status value, and obtaining update files during the hot update operation, solving the problem of client status caused by the server restart, and realizing automatic update and efficient debugging.
Patent Information
- Application Number
- CN202411388432.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-24
AI Technical Summary
During the construction process of the construction tool, the connection between the server and the client is interrupted, causing the internal state of the client to be inconsistent, and it cannot be updated automatically and in time. It needs to be refreshed manually. The workload is high when the number of restarts is large, and the debugging efficiency is low.
Introduce heavy connection state variables in the client module, update the previous status value and current status value through the valid value of the heavy connection state, and obtain the update file to update the display target object when the thermal update operation is used to solve the problem of the state of chaos.
Automatically update the display after the server module is restarted, avoiding manual refresh and improving the efficiency of building and debugging.
Smart Images

Figure CN119357012A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a construction debugging method, device, equipment and medium. Background Art
[0002] A build tool is a module packager that can build web pages and other types of front-end applications, and the application can be packaged into a module for use by the browser through the build tool. In the related art, the build tool can automatically update the web page or front-end application during the build process to allow technicians to debug. However, when the build process is restarted, the internal state of the client is disordered due to the interruption of the connection between the server and the client, and it cannot be automatically updated in time and can only be refreshed manually. When the number of restarts is too many, the workload is large, resulting in low debugging efficiency. Summary of the invention
[0003] In order to solve the above technical problems, the present disclosure provides a construction debugging method, device, equipment and medium.
[0004] The present disclosure provides a construction debugging method, which is applied to a client module of a construction tool, wherein the construction tool includes the client module and a server module, including:
[0005] During the construction and debugging of the target object, if a first update message sent by the server module in response to a restart operation is received, the previous state value and the current state value are both updated to the first value in the first update message based on the valid value of the reconnection state, and the reconnection state is updated from the valid value to the invalid value;
[0006] A second update message sent by the server module in response to a hot update operation is received, an update file corresponding to the first value of the previous state value in the server module is obtained, and the update file is used to update the display target object for debugging.
[0007] The embodiment of the present disclosure further provides a construction debugging device, the device is arranged in a client module of a construction tool, the construction tool includes the client module and a server module, including:
[0008] A first updating module is configured to update both the previous state value and the current state value to the first value in the first updating message based on the valid value of the reconnection state, and update the reconnection state from the valid value to the invalid value, if a first updating message sent by the server module in response to the restart operation is received during the construction and debugging of the target object;
[0009] The second update module is used to receive a second update message sent by the server module in response to the hot update operation, obtain an update file corresponding to the first value of the previous state value in the server module, and use the update file to update the display target object for debugging.
[0010] An embodiment of the present disclosure also provides an electronic device, comprising: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement the construction and debugging method provided in the embodiment of the present disclosure.
[0011] The embodiment of the present disclosure further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the construction and debugging method provided by the embodiment of the present disclosure.
[0012] The technical solution provided by the embodiments of the present disclosure has the following advantages over the prior art: the construction and debugging solution provided by the embodiments of the present disclosure, through the client module of the construction tool, during the construction and debugging process of the target object, if a first update message sent by the server module in response to a restart operation is received, the previous state value and the current state value are both updated to the first value in the first update message based on the valid value of the reconnection state, and the reconnection state is updated from a valid value to an invalid value; the second update message sent by the server module in response to a hot update operation is received, the update file corresponding to the first value of the previous state value in the server module is obtained, and the update file is used to update the display target object for debugging. By adopting the above technical solution, during the process of building and debugging the target object, the client module of the construction tool can simultaneously update the previous state value and the next state value to the same value based on the current valid value of the reconnection state after the server module is restarted. Later, when the server module performs a hot update operation, the previous state value at this time can be used to obtain the corresponding update file to update, display and debug the target object. By adding a reconnection state in the client module to follow the restart operation update of the server module, and the update of the state value is associated with the reconnection state, the state confusion caused by the restart operation of the server module is effectively solved. After the restart, the display can be automatically updated to avoid manual refresh, thereby greatly improving the debugging efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0014] Figure 1A schematic diagram of state changes of a restart operation in the related art;
[0015] Figure 2 A flowchart of a construction debugging method provided in some embodiments of the present disclosure;
[0016] Figure 3 A schematic diagram of state changes of a restart operation provided in some embodiments of the present disclosure;
[0017] Figure 4 A schematic diagram of a structure of a debugging device provided in some embodiments of the present disclosure;
[0018] Figure 5 A schematic diagram of the structure of an electronic device provided for some embodiments of the present disclosure. DETAILED DESCRIPTION
[0019] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0020] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0021] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0022] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0023] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0024] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0025] Build tools can build web pages and other types of front-end applications. For example, Figure 1 FIG. 1 is a schematic diagram of a state change of a restart operation in a related art. Figure 1 As shown, before the server module of the build tool restarts, the previous state value of the client module is 1, and the current state value is 2. After the restart, the previous state value is updated to 2, and the current state value is updated to 3. If an update message is received later, the previous state value will be used to request to update the file. However, since there is no file with a previous state value of 2 after the restart, the request to update the file will fail, causing the internal state of the client module to be destroyed, and subsequent updates still cannot be completed, resulting in the inability to continue debugging. In the related art, only manual refresh is available. When the number of restarts is too many, the workload is large, resulting in low debugging efficiency.
[0026] In order to solve the above problems, the embodiments of the present disclosure provide a construction debugging method, which is introduced below in conjunction with specific embodiments.
[0027] Figure 2 This is a flow chart of a construction debugging method provided in some embodiments of the present disclosure. The method can be executed by a construction debugging device, wherein the device can be implemented by software and / or hardware and can generally be integrated in an electronic device. Figure 2 As shown, the method is applied to the client module of the build tool, including:
[0028] Step 101. During the construction and debugging process of the target object, if a first update message sent by the server module in response to a restart operation is received, the previous state value and the current state value are updated to the first value in the first update message based on the valid value of the reconnection state, and the reconnection state is updated from a valid value to an invalid value.
[0029] The construction and debugging method of the disclosed embodiment can be executed by the client module of the construction tool, and the construction tool can build web pages and other types of front-end applications, and the specific tool is not limited. The construction tool may include a client module and a server module. The client module, also known as the client runtime (Client Runtime), is used to load and execute the modules packaged by the construction tool in the browser environment, apply hot updates and resource management, etc.; the server module, also known as the development server (DevServer), is used to provide static file services, real-time compilation and hot updates and other functions to support the construction of web pages or other types of front-end applications. The static file service of the server module can provide the browser with packaged files, and these files can be loaded in the browser for direct access and debugging; hot updates can be the server module transmitting the updated files to the client module during the construction process to show the update effect without reloading the entire file of the object.
[0030] The target object may be an object that the build tool supports to build or develop, for example, the target object may include a web page, a web application, a desktop application, etc., with no limitation on the specific type and quantity. The build and debug process of the target object may be a process in which a technician uses a build tool to build the target object and continuously modifies and debugs it to continuously optimize the target object.
[0031] The restart operation may be an operation in which the server module restarts the build process after shutting it down, which may be understood as a cold start operation that starts from a completely shut down state. The first update message may be an update message sent by the server module due to an update of the timestamp of the target object caused by the restart operation, and the first update message may include the latest current state value, where the first value is the latest current state value after the server module updates the object.
[0032] The reconnection state (isReconnecting) can be a newly added variable in the client module. The reconnection state is bound to the connection state of whether the client module and the server module are reconnecting. That is, the reconnection state indicates whether the client module and the server module are reconnecting. When the reconnection state is a valid value (true), it indicates that the client module and the server module are in a connection state of reconnecting. When the reconnection state is an invalid value (false), it indicates that the client module and the server module are in a normal connection and are not reconnecting.
[0033] The state value may be a parameter value representing the update state stored in the client module. The state value may include the previous state value and the current state value. It is updated following the cold start operation or hot update operation after the update of the object constructed by the server module. Specifically, the previous state value may be updated to the current state value each time an update message is received, and the current state value may be updated to the latest state value in the update message each time an update message is received. The previous state value and the current state value may be represented by hash values. The previous state value may be represented by previousHash, and the current state value may be represented by currentHash.
[0034] In some embodiments, before receiving a first update message sent by the server module in response to a restart operation, the construction debugging method may further include: updating the reconnection state from the invalid value to the valid value in response to a shutdown operation of the server module.
[0035] Specifically, during the construction and debugging process of the target object by the server module of the construction tool, when the construction process is triggered to close, the connection between the server module and the client module is interrupted and is being reconnected. The client module can update the reconnection state from an invalid value to a valid value; the client module can receive the first update message sent by the server module based on the restart operation, and based on the valid value of the reconnection state at this time, the previous state value and the current state value can be simultaneously updated to the first value in the first update message, and the reconnection state is updated from a valid value to an invalid value. When the server module receives an update message each time there is a restart operation on the target object being built, only the timestamp changes. At this time, the client module only updates the previous state value and the current state value. The display effect of the target object after the restart operation is the same as the display effect before the restart operation, so there is no need to obtain the update file for display.
[0036] Compared with the related art in which the previous state value is updated to the current state value after the restart operation, and the previous state value does not have a corresponding changed update file in the server module, resulting in state confusion, this case sets the reconnection state. When the reconnection state is a valid value, if the state value is updated due to the restart operation, the previous state value and the current state value can be directly updated to the same value at the same time, avoiding updating the previous state value according to the update message of the unchanged update file, solving the problem of state loss caused by the restart operation, and effectively ensuring the accuracy of the state in the client module.
[0037] Step 102: Receive a second update message sent by the server module in response to a hot update operation, obtain an update file corresponding to the first value of the previous state value in the server module, and use the update file to update the display target object for debugging.
[0038] Among them, the hot update operation can be understood as the server module can update part of the target object being built at this time without completely shutting down and restarting during the construction process, such as code, resources, etc. The server module can be regarded as triggering the hot update operation when the target object is updated without any special operation during the construction process of the target object, that is, the target object is updated and the server module can receive the hot update operation and send an update message to the client module. The client module can realize the dynamic update of the target object's file or module through the hot update runtime (Hot Module Replacement Runtime, HMR Runtime), and the update includes replacement, addition and deletion, etc. The second update message can be an update message received by the server module after the restart operation. The number of the second update messages is not limited to one or more. The latest current state value included in the second update message is a second value, and the second value is different from the above-mentioned first value.
[0039] The update file may be a metadata file for describing the configuration information of the target object. The file name of the update file may include a previous state value, so that the update file can be obtained according to the matching of the previous state value and the file name. The specific format of the update file is not limited. For example, the update file may be a manifest file, which is only an example. The debugging of the disclosed embodiment may be a process in which, during the process of building the target object, the target object is updated in the server module, the update effect is checked in the client module, and the update is continued in the server module according to the update effect until the update effect meets the requirements.
[0040] Specifically, after the restart operation, the server module can trigger a hot update operation after the target object is updated, and send a second update message to the client module, wherein the second update message includes a second value; after receiving the second update message, the client module can update the previous state value to the current state value. Since the previous state value is the same as the current state value after the restart operation, the previous state value is still the first value at this time, and the corresponding update file can be obtained from the server module according to the first value. Specifically, the server module can match the first value with the file name of the update file in the server module, extract the update file whose file name includes the first value and return it to the client module; after receiving the update file, the client module can load and execute the update file to display the updated target object so as to continue debugging.
[0041] When the server module performs a hot update operation on the target object being constructed, the client module can use the previous state value to obtain the corresponding update file from the server module and display the updated object for debugging. After the restart operation, the previous state value and the current state value are simultaneously updated to the same value, so that the previous state value of the subsequent hot update operation remains accurate. In addition, after receiving the second update message sent by the server module in response to the hot update operation, the client module can also update the current state value from the first value to the second value in the second update message, so as to obtain the corresponding update file according to the second value when the target object is updated next time.
[0042] In some embodiments, when the target object is a web page, using the update file to update and display the target object includes: switching and displaying the web page from a current page to an updated page corresponding to the update file.
[0043] Among them, the web page can be a type of target object, the current page can be the page displayed by the web page before the hot update operation, and the update page can be the page corresponding to the update file after the hot update operation. When the target object is a web page, when the client module uses the update file to update and display the target object, it can load and execute the update file to obtain the update page, close the current page of the web page, and switch to display the update page. The update effect can be displayed by the update page without reloading all the files of the entire page, which effectively improves the efficiency of the construction tool in building the web page.
[0044] The construction and debugging solution provided by the embodiment of the present disclosure uses a client module of a construction tool. During the construction and debugging process of a target object, if a first update message sent by the server module in response to a restart operation is received, the previous state value and the current state value are both updated to the first value in the first update message based on the valid value of the reconnection state, and the reconnection state is updated from a valid value to an invalid value; a second update message sent by the server module in response to a hot update operation is received, an update file corresponding to the first value of the previous state value in the server module is obtained, and the update file is used to update the display target object for debugging. By adopting the above technical solution, during the process of building and debugging the target object, the client module of the construction tool can simultaneously update the previous state value and the next state value to the same value based on the current valid value of the reconnection state after the server module is restarted. Later, when the server module performs a hot update operation, the previous state value at this time can be used to obtain the corresponding update file to update, display and debug the target object. By adding a reconnection state in the client module to follow the restart operation update of the server module, and the update of the state value is associated with the reconnection state, the state confusion caused by the restart operation of the server module is effectively solved. After the restart, the display can be automatically updated to avoid manual refresh, thereby greatly improving the debugging efficiency.
[0045] In some embodiments, the construction debugging method may also include: when it is detected that the connection status between the client module and the server module is reconnecting, using a callback function to set the reconnection status to the valid value; when it is detected that the connection status between the client module and the server module is not reconnecting, using a callback function to set the reconnection status to the invalid value.
[0046] The client module and the server module can be connected via WebSocket, which is a network communication protocol that provides the ability to perform full-duplex communication on a single persistent connection. The client module and the server module can send and receive data at the same time to achieve real-time, two-way data transmission. The callback function can be a function called when the connection status between the browser and the server module changes. The client module monitors and registers the callback function. When the callback function is called due to a change in the connection status, the client module determines the change in the connection status with the server module and uses the callback function to modify the value of the reconnection status.
[0047] The client module can monitor the connection status between the client and the server module through a callback function. When the server module is triggered to restart, since the restart operation includes a shutdown operation and a cold start operation, the connection between the client and the server module is disconnected after the server module is shut down, and the callback function is called to determine that the connection status is reconnecting. The callback function can be used to set the reconnection status to a valid value; after the server module cold start operation, the connection between the client and the server module changes from disconnection to recovery, and the callback function is called to determine that the connection status is not reconnected. The callback function is used to set the reconnection status to an invalid value, that is, it is updated from a valid value to an invalid value.
[0048] This solution binds the reconnection state to the connection state between the client module and the server module in the construction tool. When the connection state changes, the value of the reconnection state changes accordingly, and the update of the previous state value and the current state value of the client module is also associated with the value of the reconnection state. When the reconnection state is a valid value, the previous state value and the current state value can be updated to the same value at the same time when they need to be updated. When the reconnection state is an invalid value, the previous state value and the current state value are updated normally, effectively solving the state confusion caused by the restart operation of the server module.
[0049] For example, Figure 3 A schematic diagram of state changes of a restart operation provided in some embodiments of the present disclosure, such as Figure 3As shown in the figure, the state changes before and after the server module restart operation using the build debugging method provided by the present solution are shown. Before the restart operation of the server module of the build tool, the previous state value of the client module is 1, the current state value is 2, and the reconnection state is an invalid value; after the server module is shut down, the reconnection state is updated from an invalid value to a valid value; after the server module restarts, the previous state value and the current state value based on the valid value of the reconnection state are both updated to 3, and the valid value of the reconnection state is also updated to an invalid value. After that, if the client module receives an update message triggered by a hot update operation, it will use the previous state value to request an update file. Since the previous state value is updated to the current state value at this time, it is still 3 and has not changed. 3 has an updated file in the server module, so that the client can automatically update the target object without being affected by the restart operation of the server module.
[0050] This solution uses the newly added reconnection status variable to save the hot update status of the client module across the build process. After the build process of the server module is restarted, debugging can continue, greatly improving the debugging speed and debugging experience.
[0051] Figure 4 This is a schematic diagram of a structure of a debugging device provided in some embodiments of the present disclosure. The device can be implemented by software and / or hardware and can generally be integrated into an electronic device. Figure 4 As shown, the device is arranged in the client module of the construction tool, and the construction tool includes the client module and the server module, including:
[0052] The first update module 401 is used for updating both the previous state value and the current state value to the first value in the first update message based on the valid value of the reconnection state, and updating the reconnection state from a valid value to an invalid value, if a first update message sent by the server module in response to a restart operation is received during the construction and debugging process of the target object;
[0053] The second update module 402 is used to receive a second update message sent by the server module in response to the hot update operation, obtain an update file corresponding to the first value of the previous state value in the server module, and use the update file to update the display target object for debugging.
[0054] Optionally, the device further comprises a closing module, configured to:
[0055] Before receiving a first update message sent by the server module in response to a restart operation, in response to a shutdown operation of the server module, the reconnection state is updated from the invalid value to the valid value.
[0056] Optionally, the reconnection status is bound to a connection status of whether the client module and the server module are being reconnected.
[0057] Optionally, the device further includes a state setting module, configured to:
[0058] When it is detected that the connection state between the client module and the server module is reconnecting, the reconnection state is set to the valid value by using a callback function;
[0059] When it is detected that the connection state between the client module and the server module is not reconnected, the reconnection state is set to the invalid value by using a callback function.
[0060] Optionally, the device further comprises a third updating module, configured to: after receiving a second updating message sent by the server module in response to the hot updating operation,
[0061] The current state value is updated from the first value to a second value in the second update message.
[0062] Optionally, when the target object is a webpage, the second updating module 402 is used to:
[0063] The web page is switched from the current page to an updated page corresponding to the updated file.
[0064] The construction and debugging device provided in the embodiments of the present disclosure can execute the construction and debugging method provided in any embodiment of the present disclosure, and has the functional modules and beneficial effects corresponding to the execution method.
[0065] The embodiments of the present disclosure also provide a computer program product, including a computer program / instruction, which implements the construction and debugging method provided by any embodiment of the present disclosure when executed by a processor.
[0066] Figure 5 A schematic diagram of the structure of an electronic device provided for some embodiments of the present disclosure.
[0067] The following specific reference Figure 5 , which shows a schematic diagram of the structure of an electronic device 500 suitable for implementing the embodiment of the present disclosure. The electronic device 500 in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0068] like Figure 5 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0069] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0070] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the construction and debugging method of the embodiment of the present disclosure are executed.
[0071] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0072] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0073] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0074] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: during the construction and debugging process of the target object, if a first update message is received from the server module in response to a restart operation, the previous state value and the current state value are updated to the first value in the first update message based on the valid value of the reconnection state, and the reconnection state is updated from a valid value to an invalid value; the second update message is received from the server module in response to a hot update operation, the update file corresponding to the first value of the previous state value in the server module is obtained, and the update file is used to update the display target object for debugging.
[0075] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0076] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0077] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.
[0078] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0079] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0080] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0081] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0082] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0083] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A construction debugging method, characterized in that: A client module applied to a construction tool, the construction tool comprising the client module and the server module, including: During the construction and debugging of the target object, if a first update message sent by the server module in response to a restart operation is received, the previous state value and the current state value are both updated to the first value in the first update message based on the valid value of the reconnection state, and the reconnection state is updated from the valid value to the invalid value; A second update message sent by the server module in response to a hot update operation is received, an update file corresponding to the first value of the previous state value in the server module is obtained, and the update file is used to update the display target object for debugging.
2. The method according to claim 1, characterized in that Before receiving a first update message sent by the server module in response to a restart operation, the method further includes: In response to a closing operation of the server module, the reconnection state is updated from the invalid value to the valid value.
3. The method according to claim 1 or 2, characterized in that: The reconnection status is bound to the connection status of whether the client module and the server module are being reconnected.
4. The method according to claim 3, characterized in that The method further comprises: When it is detected that the connection state between the client module and the server module is reconnecting, the reconnection state is set to the valid value by using a callback function; When it is detected that the connection state between the client module and the server module is not reconnected, the reconnection state is set to the invalid value by using a callback function.
5. The method according to claim 1, characterized in that After receiving the second update message sent by the server module in response to the hot update operation, the method further includes: The current state value is updated from the first value to a second value in the second update message.
6. The method according to claim 1, characterized in that When the target object is a web page, updating and displaying the target object using the update file includes: The web page is switched from the current page to an updated page corresponding to the updated file.
7. A construction and debugging device, characterized in that: A client module is provided in a construction tool, wherein the construction tool includes the client module and the server module, including: A first updating module is configured to update both the previous state value and the current state value to the first value in the first updating message based on the valid value of the reconnection state, and update the reconnection state from the valid value to the invalid value, if a first updating message sent by the server module in response to the restart operation is received during the construction and debugging of the target object; The second update module is used to receive a second update message sent by the server module in response to the hot update operation, obtain an update file corresponding to the first value of the previous state value in the server module, and use the update file to update the display target object for debugging.
8. The device according to claim 7, further comprising a closing module, configured to: Before receiving a first update message sent by the server module in response to a restart operation, in response to a shutdown operation of the server module, the reconnection state is updated from the invalid value to the valid value.
9. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the construction and debugging method described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is used to execute the construction and debugging method described in any one of claims 1 to 7.