Method, apparatus, device and product for introducing signal in code

The method addresses the challenge of integrating signal characteristics into legacy software by precisely identifying key nodes and converting code using a rule-based approach, ensuring efficient and consistent signal integration with improved maintainability.

CN120315690AActive Publication Date: 2025-07-15KYLIN CORP
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510804419.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-17
Publication Date
2025-07-15
Estimated Expiration
2045-06-17

AI Technical Summary

Technical Problem

When introducing signal characteristics in old projects, the workload is large and it is difficult to accurately identify the introduced location, resulting in poor code quality and maintainability and lack of unified standards.

Method used

By traversing the project files, identifying refactorable files, conducting semantic analysis, establishing a rule library, and using the rule library to convert state management methods into signal methods to write code to ensure consistency in the code style.

Benefits of technology

It realizes fast and accurate signal introduction, ensures high quality of code conversion, facilitates subsequent maintenance, and improves code conversion speed and maintainability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120315690A_ABST
    Figure CN120315690A_ABST
Patent Text Reader

Abstract

The invention discloses a method, device, equipment and product for introducing a signal into a code, and the method comprises the steps: traversing an original file in a project, and determining a reconfigurable file; determining key nodes in the reconfigurable file; establishing a rule base; codes in the reconfigurable file are matched with rules in a rule base; converting a state management mode compiling code in the reconfigurable file into a signal mode compiling code. The invention discloses a method, a device, equipment and a product for introducing a signal into a code, which can accurately position original files which are possibly reconstructed in a project, do not need to manually search one by one by a developer, and simultaneously adopts a uniform rule to reconstruct the code, so that the consistency of the style of the reconstructed and replaced code is ensured; the method has the advantages that the code conversion speed is high, the conversion quality is high, and later maintenance is facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer software, and in particular, relates to a method, device, equipment and product for introducing signals into a kind of code. Background Art

[0002] In the field of front-end development, signals, as an emerging reactive programming feature, have attracted much attention. They emerged with the continuous evolution of frameworks. Signals provide a more direct way for application state processing. Developers can easily define and update the values of signals. And due to their reactive nature, any change to the signal value can be reflected in the behavior of the application in real time. This makes the reactive logic of the application clearer, easier to understand and maintain. At the same time, by precisely controlling the update and propagation path of the state, signals can avoid unnecessary rendering and calculation processes. In complex application scenarios, this optimization of performance can significantly improve the running efficiency of the application and reduce waste of resources. Under the existing technical conditions, for many old software projects developed before the emergence of signal characteristics, it is not easy to introduce signals. These old projects often contain a large amount of code, involving various components, services and intricate business logics, making it difficult for subsequent maintenance personnel to introduce signals manually into the old projects. There are problems such as large workload, inaccurate signal introduction positions, and difficulty in ensuring the quality of the code and its maintainability in the later stage. Summary of the Invention

[0003] In view of this, the present invention aims to overcome the defects in the prior art and proposes a method, device, equipment and product for introducing signals into code.

[0004] To achieve the above object, the technical solution of the present invention is realized as follows: In a first aspect, the present invention discloses a method for introducing signals into code, including: Traverse the original files in the project. If the original file meets the first preset condition, it is determined that the original file is a refactorable file; Perform semantic analysis on the code of the refactorable file to determine the key nodes in the refactorable file, where the key nodes are the nodes that meet the second preset condition; Establish a rule library, where the rule library includes rules for replacing the code written in the state management method with the code written in the signal method corresponding to different types of key nodes; Match the code in the refactorable file with the rules in the rule library, and use the obtained matching rules to convert the code written in the state management method in the refactorable file into the code written in the signal method.

[0005] In an embodiment of the present invention, the first preset condition is that the original file can simultaneously meet: The file type of the original file matches the type of the project; The source file and dependent files of the original file can be obtained; The initial node can be determined in the original file; Based on the initial node in the original file, it is possible to recursively query upward to find the parent node until the class declaration node in the original file is found; The class declaration node carries the input instructions or components.

[0006] In an embodiment of the present invention, the second preset condition includes: If the node is a variable declaration node, and the variable of the variable declaration node is read several times in the entire application and the change of its value affects the behavior of several components, then the variable declaration node is a key node; If the node is a function call node, and the function of the function call node is used to update the component state and its call logic matches the usage pattern of the signal, then the function call node is a key node; If the node is an attribute access node, and the write operation of the attribute access node affects the display or behavior of the component and conforms to the signal-driven update pattern, then the attribute access node is a key node.

[0007] In an embodiment of the present invention, using the matched rules, the code writing of the state management method in the reconfigurable file is converted into code writing in the signal manner, including: According to the matched rules, a template is established, and the template includes the standard code structure and logic for converting the code writing of the state management method into code writing in the signal manner; Using the template, the code writing of the state management method in the reconfigurable file that matches the template is converted into code writing in the signal manner.

[0008] In an embodiment of the present invention, the method further includes: if the function of converting the code writing in the reconfigurable file into the signal manner is abnormal, then restore to the original code writing of the state management method and re-match the rules in the rule library.

[0009] In an embodiment of the present invention, the rules in the rule library are established by manual setting and / or scraping from third-party data sources using an automated script.

[0010] In an embodiment of the present invention, if the function of converting the code writing in the reconfigurable file into the signal manner is abnormal, it further includes: recording the abnormal function in the error log.

[0011] In a second aspect, the present invention discloses a device for introducing signals into code, and the device includes: Determine a reconfigurable file module for traversing the original files in a project. If an original file meets the first preset condition, determine that the original file is a reconfigurable file; Determine a key node module for performing semantic analysis on the code of the reconfigurable file to determine the key nodes in the reconfigurable file, where the key nodes are the nodes that meet the second preset condition; Establish a rule library module for establishing a rule library, where the rule library includes rules for replacing the code written in the state management method with the code written in the signal method corresponding to different types of key nodes; A code conversion module for matching the code in the reconfigurable file with the rules in the rule library and using the obtained matching rules to convert the code written in the state management method in the reconfigurable file into the code written in the signal method.

[0012] In a third aspect, the present invention discloses an electronic device, including: one or more processors; a storage device for storing one or more programs, where when the one or more programs are executed by the one or more processors, the one or more processors are caused to execute the above method.

[0013] In a fourth aspect, the present invention discloses a computer program product, including a computer program that implements the above method when executed by a processor.

[0014] Compared with the prior art, the present invention has the following advantages: The present invention discloses a method, device, equipment, and product for introducing signals into code, including: traversing the original files in a project to determine reconfigurable files; determining the key nodes in the reconfigurable files; establishing a rule library; matching the code in the reconfigurable files with the rules in the rule library; and converting the code written in the state management method in the reconfigurable files into the code written in the signal method. The present invention discloses a method, device, equipment, and product for introducing signals into code, which can accurately locate the original files that may be reconstructed in the project without the need for developers to manually search one by one. At the same time, unified rules are used for code reconstruction to ensure the consistency of the code style after reconstruction and replacement, making it convenient for subsequent maintenance personnel to understand and modify the code, and having the advantages of fast code conversion speed, high conversion quality, and convenient later maintenance. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention.

[0016] In the drawings: Figure 1 It is a schematic diagram of a method for introducing signals into code according to an embodiment of the present invention; Figure 2 Schematic diagram of a reconfigurable file determined by a method for introducing signals into code according to an embodiment of the present invention; Figure 3 Schematic diagram of key nodes determined by a method for introducing signals into code according to an embodiment of the present invention; Figure 4 Schematic diagram of a device for introducing signals into code according to an embodiment of the present invention; Figure 5 Schematic diagram of an electronic device for introducing signals into code according to an embodiment of the present invention. Detailed implementation manners

[0017] It should be noted that, without conflict, the embodiments in the present invention and the features in the embodiments may be combined with each other.

[0018] In the description of the present invention, it should be understood that the orientation or positional relationship indicated by the terms "center", "longitudinal", "transverse", "up", "down", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. are based on the orientation or positional relationship shown in the 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 thus cannot be understood as a limitation to the present invention.

[0019] In the description of the present invention, it should be noted that, unless otherwise clearly defined and limited, the terms "installed", "connected", "connected" should be understood in a broad sense. For example, it may be a fixed connection, a detachable connection, or an integral connection; it may be a mechanical connection or an electrical connection; it may be directly connected, or indirectly connected through an intermediate medium, and it may be the communication inside two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood through specific situations.

[0020] In the description of the present invention, it should be further noted that the terms "first", "second", etc. are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first", "second", etc. may explicitly or implicitly include one or more of such features. In the description of the present invention, unless otherwise stated, the meaning of "a plurality" is two or more.

[0021] Under the existing technical conditions, currently in the process of introducing signals into a project, the manual method is mainly adopted. Developers must check and modify each code location related to relevant state management or reactive behavior one by one. This manual method of introducing signals involves a huge workload when dealing with old projects with a large amount of code and complex logic. It requires a lot of time and energy, and the efficiency is extremely low. Moreover, manual operations are difficult to ensure that all positions suitable for introducing signals can be accurately identified, and there may be omissions or incorrect judgments, resulting in incomplete signal introduction or signal introduction at inappropriate positions, thus unable to fully utilize the advantages of signal characteristics. At the same time, in the project, when manually introducing signals, due to the lack of unified standards and specifications, the modification methods of different developers may be different, and the code style cannot be completely unified, making it difficult to ensure the quality of the code and its maintainability in the later stage. The present invention discloses a method, device, equipment, and product for introducing signals into code, which can accurately locate the original files that may be refactored in the project without the need for developers to manually search one by one. At the same time, it uses unified rules for code refactoring to ensure the consistency of the code style after refactoring and replacement, facilitating subsequent maintenance personnel to understand and modify the code. It has the advantages of fast code conversion speed, high conversion quality, and convenience for later maintenance.

[0022] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0023] In an embodiment of the present invention, as Figure 1 shown, a method for introducing signals into code includes: Step S101, traverse the original files in the project. If the original file meets the first preset condition, determine that the original file is a refactorable file; Step S102, perform semantic analysis on the code of the refactorable file to determine the key nodes in the refactorable file, where the key nodes are the nodes that meet the second preset condition; In this embodiment, when performing semantic analysis on the code of the refactorable file, the Abstract Syntax Tree (AST) algorithm is used to perform semantic analysis on the code to obtain the key nodes related to state management.

[0024] In this embodiment, the key nodes are the nodes related to state management.

[0025] In this embodiment, by performing semantic analysis to determine the key nodes in the refactorable file, the location for replacing the code written in the signal manner can be determined in the refactorable file.

[0026] Step S103, establish a rule library, where the rule library includes rules for replacing the code written in the state management manner corresponding to different types of key nodes with the code written in the signal manner; In this embodiment, exemplarily, the rules in the rule library are managed using a hierarchical classification architecture. First, at the first level of classification, according to the common state management patterns in front-end development, they are divided into different types of state management patterns such as event-driven, data-binding-based, and global variable-based. For each pattern, a second-level classification is then carried out. For example, for button click event handling and form submission event handling under the event-driven pattern, each rule details information such as the applicable code structure features, variables involved, and function call patterns, which is used to replace the code written for the state management method corresponding to the key node with code in the signal manner.

[0027] In this embodiment, the establishment of the rule library ensures that signals are introduced based on unified standards and specifications, making the code style consistent. This makes it easier for subsequent maintenance personnel to understand and modify the code, reducing the later maintenance cost.

[0028] In this embodiment, the rules in the rule library are established by manual setting and / or scraping from third-party data sources using automated scripts.

[0029] Exemplarily, maintain close contact with the front-end technology community, open-source projects, and industry standards, regularly scan new code practices and technology trends, use automated scripts to scrape new cases involving signal usage and state management optimization from relevant technical forums and code repositories, and supplement new rules into the rule library at any time.

[0030] Step S104: Match the code in the reconfigurable file with the rules in the rule library, and use the matched rules to convert the code written for the state management method in the reconfigurable file into code in the signal manner.

[0031] Furthermore, step S104 further includes: establishing a template according to the matched rules, where the template includes the standard code structure and logic for converting the code written for the state management method into code in the signal manner; using the template to convert the code written for the state management method in the reconfigurable file that matches the template into code in the signal manner.

[0032] Exemplarily, in the reconfigurable file, for the code written for the state management method corresponding to the determined key node, use the template corresponding to the matched rule to convert the code written for the state management method corresponding to the key node into code in the signal manner.

[0033] In this embodiment, the code structure and logic in the template are appropriately abstracted, the common parts are extracted, and the variable parts are parameterized. For example, for different types of variable declarations, their basic structures for conversion to signals are similar, but the variable types, names, and initial values may be different. By parameterizing these variables, the same template can be applied to multiple similar situations, improving the applicability of the template.

[0034] In this embodiment, information such as the location of the refactored code, the applied rules and templates, and the code snippets before and after replacement is backed up and recorded to facilitate subsequent rollback operations.

[0035] Based on the previous embodiment, in another embodiment of the present invention, the method further includes: if the function of writing code in the signal conversion mode in the reconfigurable file is abnormal, then restore to the original state management mode of writing code, re-match the rules in the rule library, and at the same time, record the abnormal function in the error log.

[0036] In this embodiment, according to the records in the error log, the rules in the rule library are supplemented.

[0037] In another embodiment of the present invention, as Figure 2 shown, the first preset condition is that the original file can simultaneously meet: The file type of the original file matches the type of the project; Exemplarily, the project type is judged according to the characteristics of the project's file structure, dependency relationship, code style, etc., and further determine whether the file type of the original file belongs to the type of the project.

[0038] In this embodiment, according to the judged project type, the corresponding rule library and template can be loaded. For small single-page application projects, a lighter signal introduction strategy is adopted; while for large enterprise-level projects, a signal introduction strategy that focuses on performance optimization and architecture compatibility is adopted.

[0039] The source file and dependent files of the original file can be obtained to determine that the subsequent code replacement of the file is meaningful.

[0040] An initial node can be determined in the original file to determine whether the file is damaged.

[0041] In this embodiment, the method for determining the initial node is: determine the starting position to be searched in the file, and find the smallest syntactic unit node containing the starting position, which is the initial node.

[0042] Based on the initial node in the original file, it is possible to recursively query upward to find the parent node until the class declaration node in the original file is found to determine that the file can be refactored within the effective class definition range.

[0043] The class declaration node carries input instructions or components to determine that the file is not a utility class or a mathematical calculation class file.

[0044] In another embodiment of the present invention, as Figure 3 shown, the second preset condition includes: If a node is a variable declaration node, and the variable of the variable declaration node is read several times throughout the application and the change of its value affects the behavior of several components, then the variable declaration node is a key node; If a node is a function call node, and the function of the function call node is used to update the component state and its call logic matches the usage pattern of signals, then the function call node is a key node; Exemplarily, for a function call node, check its specific function call example in the code. For example, for a function used to update the component state, check whether the called function is related to state management and whether the way of passing function parameters conforms to the logic of signal usage.

[0045] Exemplarily, whether the way of passing function parameters conforms to the logic of signal usage can be to update the state according to specific conditions and trigger the re - rendering of related components.

[0046] If a node is an attribute access node, and the write operation of the attribute access node affects the display or behavior of the component and conforms to the signal - driven update mode, then the attribute access node is a key node.

[0047] As Figure 4 shown, the present invention also discloses a device for introducing signals into code, including: A determining re - configurable file module 401, configured to traverse the original files in the project. If the original file meets the first preset condition, it is determined that the original file is a re - configurable file; A determining key node module 402, configured to perform semantic analysis on the code of the re - configurable file to determine the key nodes in the re - configurable file, where the key nodes are nodes that meet the second preset condition; A rule library establishing module 403, configured to establish a rule library, and the rule library includes rules for replacing the code written in the state management method corresponding to different types of key nodes with the code written in the signal method; A code conversion module 404, configured to match the code in the re - configurable file with the rules in the rule library, and use the obtained matching rules to convert the code written in the state management method in the re - configurable file into the code written in the signal method.

[0048] The present invention also discloses an electronic device, as Figure 5 shown, discloses an embodiment, which is a block diagram of an electronic device applicable to the above - mentioned device for introducing signals into code.

[0049] In this embodiment, the electronic device 50 includes a processor 501, which can perform various appropriate actions and processes according to programs stored in the ROM 502 or programs loaded from the storage section 508 into the RAM 503. The processor 501 can include, for example, a general-purpose microprocessor, an instruction set processor, and / or a related chipset, and / or a dedicated microprocessor, etc. The processor 501 can also include on-board memory for caching purposes. The processor 501 can include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiments of the present invention.

[0050] In the RAM 503, various programs and data required for the operation of the electronic device 50 are stored. The processor 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. The processor 501 performs various operations of the method flow according to the embodiments of the present invention by executing programs in the ROM 502 and / or the RAM 503. It should be noted that the programs can also be stored in one or more memories other than the ROM 502 and the RAM 503, and the processor 501 can also perform various operations of the method flow according to the embodiments of the present invention by executing programs stored in one or more memories.

[0051] According to an embodiment of the present invention, the electronic device 50 may further include an I / O interface 505, and the I / O interface 505 is also connected to the bus 504. The electronic device 50 may further include one or more of the following components connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube, a liquid crystal display, a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 5010 is also connected to the I / O interface 505 as needed. A removable medium 5011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 5010 as needed so that a computer program read from it can be installed into the storage section 508 as needed.

[0052] The present invention also provides a computer-readable storage medium.

[0053] The computer-readable storage medium may be included in the electronic device / device system described in the above embodiments; or it may exist separately without being assembled into the electronic device / device. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiments of the present invention is implemented.

[0054] According to an embodiment of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include but is not limited to: portable computer disks, hard disks, random access memory RAM, read-only memory ROM, erasable programmable read-only memory EPROM or flash memory, portable compact disk read-only memory CDROM, optical storage devices, magnetic storage devices, or any suitable combination of the above. In the present invention, the computer-readable storage medium may be any tangible medium that contains or stores a program, and this program can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0055] An embodiment of the present invention further includes a computer program product.

[0056] This computer program product includes a computer program, and this computer program contains program code for executing the method provided by the embodiment of the present invention. When the computer program product runs on an electronic device, this program code is used to cause the electronic device to implement the method provided by the embodiment of the present invention.

[0057] In one embodiment, this computer program can rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, this computer program can also be transmitted and distributed in the form of a signal on a network medium. The program code contained in this computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0058] According to an embodiment of the present invention, the program code for executing the computer program provided by the embodiment of the present invention can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level procedures and / or object-oriented programming languages. Programming languages include but are not limited to, such as Java, C++, python, C language, or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user's computing device through any type of network, including a local area network or a wide area network, or can be connected to an external computing device.

[0059] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks may occur in a different order than that noted in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and combinations of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions. Those skilled in the art will understand that the features described in various embodiments and / or claims of the present invention can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present invention. In particular, without departing from the spirit and teachings of the present invention, the features described in various embodiments and / or claims of the present invention can be combined and / or combined in various ways. All such combinations and / or combinations fall within the scope of the present invention.

[0060] The embodiments of the present invention have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present invention. Although the embodiments have been described separately above, this does not mean that the measures in each embodiment cannot be used advantageously in combination. The scope of the present invention is defined by the appended claims and their equivalents, and without departing from the scope of the present invention, those skilled in the art can make various substitutions and modifications, and all such substitutions and modifications should fall within the scope of the present invention.

Claims

1. A method for introducing signals into code, characterized in that, Including: Traverse the original files in the project. If the original file meets the first preset condition, determine that the original file is a refacturable file; Perform semantic analysis on the code of the refacturable file to determine the key nodes in the refacturable file, where the key nodes are the nodes that meet the second preset condition; Establish a rule library, which includes rules for replacing the code written in the state management method with the code written in the signal method corresponding to different types of the key nodes; Match the code in the refacturable file with the rules in the rule library, and use the matched rules to convert the code written in the state management method in the refacturable file into the code written in the signal method.

2. The method for introducing a signal into code according to claim 1, characterized in that The first preset condition is that the original file can simultaneously meet: The file type of the original file matches the type of the project; The source file and dependent files of the original file can be obtained; An initial node can be determined in the original file; Based on the initial node in the original file, recursively query the parent node upward until the class declaration node in the original file is found; The class declaration node carries input instructions or components.

3. A method for introducing a signal into code according to claim 1, characterized in that, The second preset condition includes: If the node is a variable declaration node, and the variable of the variable declaration node is read several times in the entire application program and the change of its value affects the behavior of several components, then the variable declaration node is the key node; If the node is a function call node, and the function of the function call node is used to update the component state and its call logic matches the usage pattern of the signal, then the function call node is the key node; If the node is an attribute access node, and the write operation of the attribute access node affects the display or behavior of the component and conforms to the signal-driven update mode, then the attribute access node is the key node.

4. A method for introducing a signal into code according to claim 1, characterized in that, The step of using the matched rules to convert the code written in the state management method in the refacturable file into the code written in the signal method includes: According to the matched rules, establish a template, which includes the standard code structure and logic for converting the code written in the state management method into the code written in the signal method; Use the template to convert the code written in the state management method in the refacturable file that matches the template into the code written in the signal method.

5. A method for introducing a signal into code according to claim 1, characterized in that, The method further includes: if the function of converting the code written in the state management method into the code written in the signal method in the refacturable file is abnormal, restore to the original code written in the state management method, and re-match the rules in the rule library.

6. A method for introducing a signal into code according to claim 1, characterized in that, The rules in the rule library are established by manual setting and / or scraping from third-party data sources using an automated script.

7. A method for introducing a signal into code according to claim 5, characterized in that, The step of if the function of converting the code written in the state management method into the code written in the signal method in the refacturable file is abnormal further includes: recording the abnormality in the error log.

8. A device for introducing a signal into code, characterized in that: The device includes: A refacturable file determination module, configured to traverse the original files in the project. If the original file meets the first preset condition, determine that the original file is a refacturable file; A key node determination module is used to perform semantic analysis on the code of the reconfigurable file to determine the key nodes in the reconfigurable file, where the key nodes are nodes that meet the second preset condition; A rule library establishment module is used to establish a rule library, and the rule library includes rules for replacing the code written in the state management method corresponding to different types of the key nodes with the code written in the signal method; A code conversion module is used to match the code in the reconfigurable file with the rules in the rule library, and use the obtained matching rules to convert the code written in the state management method in the reconfigurable file into the code written in the signal method.

9. An electronic device, characterized in that, It includes: One or more processors; A storage device for storing one or more programs, where when the one or more programs are executed by the one or more processors, the one or more processors are caused to execute the method according to any one of claims 1 to 7.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Code conversion method and device for pre-compiler, medium, and equipment

    CN114035805A

  • Data processing method and device, equipment and storage medium

    CN114489670A

  • Method, system and equipment for extracting code data model library based on source code file and medium

    CN118626134A

  • Front-end code generation method and system based on UI design drawing

    CN118963735A

  • Automatic online code review method and system

    CN119512902A